Databricks Generative AI Engineer Associate Question 48
Single answerYou are working with a large legal document containing sections, subsections, and paragraphs. You need to prepare the document for a Generative AI model that has a maximum token limit of 2048 tokens per input. Which chunking strategy would best ensure the model can process the document effectively while preserving context?
- A
Split the document into equal-sized chunks of 2048 tokens, disregarding section or paragraph boundaries.
- B
Chunk the document by splitting at logical boundaries such as sections or subsections, ensuring each chunk stays under 2048 tokens.
- C
Combine smaller sections into a single chunk, even if it exceeds the 2048-token limit, to ensure semantic completeness.
- D
Split the document at random intervals to create chunks of approximately 2000 tokens, ignoring the logical structure of the text.
Show answer and explanation
Correct answer: B
Explanation
Chunking a document effectively involves balancing the need to preserve context and ensure the input remains within the model's token limit. By splitting the document at logical boundaries such as sections or subsections, you maintain the semantic integrity of the content while adhering to the 2048-token constraint. This approach ensures the Generative AI model processes the input effectively and generates meaningful outputs.
- A. Incorrect.
Splitting into equal-sized chunks of 2048 tokens disregards logical boundaries, which can lead to incomplete or incoherent inputs for the model.
- B. Correct.
Splitting at logical boundaries such as sections or subsections ensures that the context is preserved, while keeping each chunk within the model's token limit. This strategy maintains both coherence and compliance with model constraints.
- C. Incorrect.
Combining smaller sections into a single chunk exceeding the token limit would result in the model being unable to process the input, as it violates the token constraint.
- D. Incorrect.
Splitting at random intervals ignores the structure and meaning of the text, leading to chunks that may lack context or coherence, which can degrade the model's performance.