Databricks Generative AI Engineer Associate Question 43
Single answerYou are tasked with fine-tuning a generative AI model on a large legal document containing multiple sections, each with distinct topics. The model has a maximum token limit of 2048. Which chunking strategy would be most appropriate to ensure the model processes the document effectively while maintaining contextual integrity?
- A
Split the document into fixed-size chunks of 2000 tokens, regardless of section boundaries.
- B
Split the document into chunks by section, ensuring each chunk stays within 2048 tokens.
- C
Split the document into single sentences to ensure no token limit is exceeded.
- D
Combine all sections into a single chunk and truncate it to fit within the 2048-token limit.
Show answer and explanation
Correct answer: B
Explanation
Chunking by section ensures that the model processes logically grouped information without breaking context, while staying within the token limit of 2048. This strategy maintains the balance between context and token constraints, enabling the model to perform optimally on complex, structured documents like legal texts.
- A. Incorrect.
Splitting into fixed-size chunks of 2000 tokens may break the context or meaning if a chunk divides content in the middle of a section, leading to poor model performance.
- B. Correct.
Splitting by section while ensuring each chunk remains within the 2048-token limit preserves contextual integrity and adheres to the model's constraints, making it the optimal strategy.
- C. Incorrect.
Splitting into single sentences may cause the model to lose the broader context required for accurate understanding and generation, as sentences often rely on surrounding content for meaning.
- D. Incorrect.
Combining all sections into a single chunk and truncating it would lead to significant loss of information if the document exceeds the token limit, resulting in suboptimal model outputs.