Fixed and Recursive Chunking
Chunking decides how your source knowledge is sliced before retrieval. Fixed chunking cuts by size. Recursive chunking tries to respect natural boundaries first. The real skill is choosing boundaries that preserve meaning without flooding retrieval with noise.
How to read this chapter
- Read it as retrieval design: chunking is not formatting. It directly changes what evidence the retriever can find.
- Think like a learner and a debugger: a chunk should be small enough to retrieve precisely and large enough to make sense.
- Compare strategies: fixed chunking is predictable; recursive chunking is structure-aware and usually safer for text documents.
- Keep production in mind: chunk size, overlap, separators, count, cost, latency, citations, and evaluation must be tuned together.
Why Chunking Matters
- Tiny chunks can lose context.
- Huge chunks can retrieve too much noise.
- Overlap protects boundary context but increases cost and duplication.
- Chunking decisions affect embeddings, vector-store size, retrieval recall, reranking, citations, and generation quality.
Chunking is the first major design decision after ingestion. The pipeline has prepared a clean source. Now we decide how to slice it so a search system can retrieve the right evidence later.
The best chunk is not always the smallest or largest. It is the one that keeps the concept, exception, source, and citation boundary together.
Policy, FAQ, runbook, table, API docs, tutorial, legal clause, or support article.
Definitions, eligibility, troubleshooting, comparison, exception, step-by-step action, or exact value lookup.
Paragraph, heading, bullet list, table row, section, code block, or procedure step.
Recall@k, citation support, context utilization, lost-context rate, duplicate retrieval rate, and chunk-noise score.
Real-Life Analogy: Pizza Slices
If you slice a pizza into pieces that are too tiny, every bite is incomplete. If you slice it into one giant piece, nobody can handle it properly. The best slice is easy to pick up and still contains the toppings that belong together.
Chunks work the same way. A chunk should be manageable for retrieval, but it should not separate a rule from its exception, a heading from its paragraph, or a troubleshooting step from its warning.
- Chunking is slicing knowledge for retrieval.
- Boundaries matter as much as size.
- Overlap helps, but it is not free.
Fixed Chunking
Fixed chunking splits text by a target size, often characters or tokens, with optional overlap. It is simple, predictable, and easy to implement.
Fixed-size chunking
Text stream:
[0........500]
[400........900]
[800........1300]
chunk_size = 500 characters
overlap = 100 charactersBest fit
Large plain-text documents, quick baselines, homogeneous content, and early experiments where simplicity matters.
Strength
Predictable chunk count, easy cost estimation, straightforward re-indexing, and simple debugging.
Risk
Can split headings from paragraphs, steps from warnings, tables from labels, and exceptions from rules.
Recursive Chunking
Recursive chunking tries larger natural separators first, then falls back to smaller ones. A common separator order is section, paragraph, sentence, word, and finally character.
Recursive splitting idea
Try split by headings
if chunk still too large -> split by paragraphs
if still too large -> split by sentences
if still too large -> split by words / charactersRespect natural boundaries
Documents already carry structure. Recursive chunking uses that structure before falling back to blunt size cuts.
Policy sections
Keep "Eligibility", "Exceptions", and "Approval process" as meaningful units instead of cutting through them randomly.
Better context preservation
Headings, paragraphs, bullet groups, and procedures often stay together, improving citations and answer faithfulness.
Still needs limits
Natural sections can be huge. Recursive splitting still needs max size, overlap, metadata, and validation.
Overlap and Separators
Overlap repeats a small part of the previous chunk in the next chunk. It helps preserve context at boundaries, but too much overlap creates duplicate retrieval and higher cost.
Policy exception at the boundary
A refund policy says annual plans are refundable within 14 days. The next paragraph says enterprise contracts require account-manager approval. If the split separates the rule and exception, the assistant may answer too broadly.
- No overlap: faster and cheaper, but boundary context may be lost.
- Moderate overlap: safer for policies, procedures, and explanations.
- High overlap: can cause duplicate retrieval and distract the model.
Separator choices
Headings, paragraphs, bullet lists, sentences, code blocks, table rows, and line breaks.
Overlap choices
Usually enough to carry local context, not enough to make chunks near-duplicates.
Metadata choices
Every chunk should keep source id, chunk id, heading path, section, page or row, version, access, and index version.
Production Trade-Offs
Small chunks can miss meaning
They retrieve precisely, but may not include the full rule, exception, or procedure needed for a faithful answer.
Large chunks can blur intent
They include more context, but can mix multiple topics and reduce retrieval precision.
More chunks increase index size
Small chunks and high overlap create more embeddings, more storage, more reranking work, and higher cost.
Boundary quality affects trust
Good chunks make citations inspectable. Bad chunks cite broad pages or partial evidence that reviewers cannot trust.
Architecture View
Chunking pipeline
parsed document
-> choose chunking strategy
-> split with metadata
-> validate chunk size and boundaries
-> detect lost context / duplicate overlap
-> embed and index chunk recordsChunk Evaluation
Chunking should be evaluated with the same seriousness as retrieval and prompting. You are not just asking "Did it split?" You are asking "Can retrieval find useful evidence after this split?"
- Chunk size distribution: too many tiny or huge chunks signals unstable boundaries.
- Boundary break rate: how often rules and exceptions split apart.
- Duplicate overlap rate: how often near-identical chunks dominate retrieval.
- Recall@k by golden question: whether the right chunk appears in top results.
- Citation support: whether retrieved chunks fully support final claims.
- Context utilization: whether the model actually uses retrieved chunks.
Common Mistakes
Splitting headings from content
Using overlap as a magic fix
Ignoring tables and lists
Making chunks too large
Making chunks too tiny
Not versioning chunking strategy
Skipping retrieval evals after chunking changes
Mini Assignment
Choose one source type: policy, runbook, tutorial, support article, or pricing table. Propose a fixed chunking baseline and a recursive chunking strategy. Include chunk size, overlap, separators, required metadata, and two golden questions to test the result.
Points To Remember
- Chunking creates retrieval units from parsed documents.
- Fixed chunking is simple and predictable but may cut through meaning.
- Recursive chunking tries natural boundaries before falling back to smaller splits.
- Overlap protects boundary context but increases duplication and cost.
- Chunking should be evaluated with real retrieval questions, not only size statistics.
Next, test chunking judgment in the quiz, then build a chunk-quality evaluator in exercises and the project.