Picking a chunking strategy for a document structure and model's constraints
Chunking splits documents into passages sized to fit within an embedding model's and LLM's context window while preserving enough semantic coherence for accurate retrieval. The right chunk size and overlap depend on document structure (e.g., code, markdown, PDFs, transcripts) and downstream model token limits, since chunks that are too large lose retrieval precision and chunks that are too small lose context.
1 · Learn the must-know
- Chunk size must respect the embedding model's max input token limit, not just the LLM's context window, since embeddings are computed per chunk.
- Structure-aware splitting (by headers, paragraphs, sentences, or code functions) generally outperforms fixed-length character or token splitting because it preserves semantic units.
- Adding overlap between consecutive chunks helps prevent loss of context at chunk boundaries but increases storage and retrieval redundancy.
- Smaller chunks improve retrieval precision (more specific matches) but may lack surrounding context needed for the LLM to generate a complete answer.
- Larger chunks provide more context per retrieval but risk exceeding token limits when multiple chunks are concatenated into the prompt, and can dilute embedding relevance.
- Different document types (structured tables, code, long-form prose, transcripts) require different chunking strategies rather than a one-size-fits-all approach.
2 · Check your understanding
A team is preparing a corpus of legal contracts, each containing numbered clauses (for example, 1.1, 1.2) that must stay intact for accurate retrieval, for a contract-review RAG assistant. Fixed 800-character chunking with no overlap has split several clauses mid-sentence across chunk boundaries, producing incomplete answers. Chunk size must remain under the embedding model's 8192-token context limit. Which chunking strategy should the team adopt?
What you have tried across Databricks GenAI Engineer's objectives, not a readiness score.
Design Applications10.71% of the exam*0 of 6 tried
Data Preparation14.29% of the exam*0 of 8 tried
Application Development23.21% of the exam*0 of 13 tried
Assembling and Deploying Applications26.79% of the exam*0 of 15 tried
Governance7.14% of the exam*0 of 4 tried
Evaluation and Monitoring17.86% of the exam*0 of 10 tried
* Our estimate. Databricks publishes no section weights.
3 · Keep going
Ready for more? Take a weighted mock or try free practice questions.