intermediate~3h
5 Chunking Strategies for RAG
Fixed-size, Semantic, Recursive, Document-structure-based, and LLM-based chunking — five distinct ways to split documents for RAG, each with different tradeoffs.
5 Chunking Strategies for RAG
How you split source documents directly determines retrieval quality — a chunk boundary that cuts through meaning is a chunk that will retrieve poorly.
| How it splits | Best for | |
|---|---|---|
| Fixed-size | Equal-length blocks with a small overlap between adjacent chunks | Simple, predictable pipelines; not sensitive to cutting mid-sentence |
| Semantic | Boundaries placed exactly where cosine-similarity between sentences drops sharply (topic shifts) | Content where topical coherence matters more than uniform size |
| Recursive | Two-level cut — paragraph breaks first, then a second cut inside any paragraph still too large | General-purpose documents with mixed structure |
| Document-structure | Splits strictly along the document's own heading/section markers | Well-formatted docs (manuals, reports) where structure = meaning |
| LLM-based | An LLM judges where a 'semantically isolated and meaningful' unit ends | Highest-quality boundaries when the extra LLM call cost is acceptable |
5
Subtopics
1
Exercises
1
Projects
5
Quiz Qs
4
Flashcards
▶📚 Prerequisites(1)
🎓 Learning objectives
- •Implement and compare fixed-size, semantic, recursive, document-structure-based, and LLM-based chunking
- •Explain why chunk overlap matters for fixed-size chunking
- •Choose the right chunking strategy given content type, embedding model, and compute budget
- •Identify the specific failure mode each chunking strategy is prone to
5 Chunking Strategies for RAG is a Pro topic
Sign in, then upgrade to Pro or Power to unlock this topic and the full AI Engineering curriculum.