A 2026 systematic analysis found that overlap delivered no measurable retrieval benefit while increasing indexing cost, and that sentence chunking matched semantic chunking up to about 5,000 tokens. It also found a clear quality drop beyond roughly 2,500 tokens in the evaluated context window. Those findings overturn a lot of casual RAG advice: complex chunking isn't automatically better, and overlap isn't automatically useful.
Chunking determines what your retriever can find, what your language model receives, and how much your indexing pipeline spends before a user asks a question. The right strategy depends on document structure, query complexity, retrieval metrics, and operational constraints. The practical path is to start with a measurable baseline, preserve meaningful boundaries, and pay for advanced methods only when the evaluation proves they help.
Table of Contents
- Why Chunking Decides Whether Your RAG Works
- Chunk Size, Overlap, and Recursion
- Choosing Between Fixed, Sentence, Recursive, Semantic, and Structure-Aware Splits
- Evaluating Chunk Quality Before You Ship
- Latency and Cost Trade-offs of Advanced Chunkers
- Handling Multimodal Documents and Web Content
- A Practical Chunking Playbook and Final Checklist
Why Chunking Decides Whether Your RAG Works
Chunking defines the units an embedding model represents and a vector store retrieves. Split a definition from its qualifying condition, and the index may contain the right words while returning a fragment that cannot answer the question. In a production retrieval-augmented generation system, chunk boundaries belong in the information architecture, not in an afterthought preprocessing script.
A bad boundary often looks like an embedding failure, prompt failure, or model hallucination. The underlying problem is simpler: the index contains poorly formed retrieval units. That distinction matters because changing the model will not repair context that was discarded during ingestion.
Retrieval quality and operating cost are linked
Large chunks combine several topics in one embedding. Small chunks can isolate a fact and remove the qualification that makes it accurate. Both choices change vector count, metadata volume, generator context, and re-indexing work. Retrieval quality therefore has to be evaluated alongside indexing cost and end-to-end answer accuracy.
A 2026 systematic analysis tested token, sentence, semantic, and code chunking across Natural Questions while varying chunk size, overlap, and context length. It found sentence chunking was the most cost-effective approach and matched semantic chunking up to about 5,000 tokens. Quality declined beyond roughly 2,500 tokens in the evaluated context window. The study's results support testing inexpensive boundary rules before adding model calls.
Practical rule: Optimize chunking and retrieval as one pipeline. Higher recall is not useful if the generator receives duplicate or incomplete passages.
Chunking also affects how content appears in search and answer experiences. A reliable hybrid AEO GEO workflow needs source material that retrieval systems can find, quote, and combine without losing meaning. Coherent chunks make those properties measurable in evaluation rather than dependent on presentation alone.
The document should decide the default
A support ticket, product FAQ, technical manual, and financial report have different natural answer units. One global rule is easy to operate, but it can hide failures concentrated in a particular document family. Route evaluation by corpus type, then keep the simplest splitter that meets the target.
A 2026 benchmark measured 90 chunker-model configurations across seven arXiv domains and 2,520 retrieval runs. A sentence-based splitter using a 512-token window and 200-token overlap reached the highest token-level Intersection-over-Union, at about 0.099. The benchmark shows why chunking decisions need measured retrieval results, indexing cost, and answer accuracy instead of folklore.
Chunk Size, Overlap, and Recursion
Three controls determine how a practical RAG chunker behaves: chunk size, overlap, and the separator order used during splitting. Treat them as separate variables. Changing all three together makes retrieval gains difficult to explain and regressions difficult to diagnose.
Start with a constrained size
For a general English corpus, 256 to 512 tokens is a useful starting band, not a fixed rule. Smaller chunks can improve answer localization, while larger ones may retain the context required by multi-clause questions. As noted earlier, the 2026 analysis found quality declining beyond roughly 2,500 tokens in its evaluated context window. Very large chunks therefore need evidence from your own retrieval and end-to-end tests.
Recursive splitting works well as a default because it preserves document structure before applying a hard limit:
- Try paragraph boundaries.
- If a segment remains too large, try line or sentence boundaries.
- If it still exceeds the limit, use a fixed token window.
- Apply overlap only after creating valid chunks.
- Store identifiers for the source, section, page, and position.
The separator order should match the corpus. Markdown headings, HTML sections, code functions, and PDF pages often produce better boundaries than a character counter.

Use overlap to solve a demonstrated boundary problem
Overlap can preserve context when a sentence, list, or argument crosses a boundary. It also creates near-duplicate passages, increases indexed text, and can make retrieval return several versions of the same evidence.
The 2026 systematic analysis found no measurable benefit from overlap in its tested settings, despite higher indexing cost. A separate domain-specific benchmark reported a high-performing configuration using a 512-token window with 200-token overlap, so overlap should be tested rather than prohibited.
Start with modest overlap and compare it with zero overlap using identical embeddings and queries. If boundary-focused questions do not improve, remove overlap. If it helps, retain each chunk's original position so downstream systems can collapse adjacent duplicates.
A simple implementation can follow this shape:
split(text, separators, max_tokens, overlap):
if tokens(text) <= max_tokens:
return [text]
separator = first separator that appears in text
parts = split(text, separator)
chunks = []
current = []
for part in parts:
candidate = join(current, part)
if tokens(candidate) <= max_tokens:
current.append(part)
else:
if current is not empty:
chunks.append(join(current))
current = [part]
if current is not empty:
chunks.append(join(current))
return add_boundary_overlap(chunks, overlap)
Do not apply one global size to manuals, source code, policies, and web pages. Change the separator priority and metadata model with the document structure, then verify the result against indexing cost, retrieval quality, and end-to-end accuracy.
Choosing Between Fixed, Sentence, Recursive, Semantic, and Structure-Aware Splits
Each splitter trades boundary quality against indexing work. Fixed-size splitting is simple and inexpensive, but it can cut sentences, tables, or code blocks. Use it when the source already consists of short factual units, or when a predictable index matters more than preserving local context.
Sentence splitting keeps retrieved passages readable and performed well in the 2026 Natural Questions analysis. It was the most cost-effective method in that evaluation and stayed comparable to semantic chunking up to about 5,000 tokens. Sentence lengths still vary, so enforce the model's input limit in a second pass and preserve headings as metadata.
Recursive splitting remains a practical production baseline for mixed corpora. The 2026 benchmark guide measured 69% end-to-end accuracy with recursive chunks of about 512 tokens and 50 to 100 tokens of overlap. It described the method as stronger than more expensive alternatives without requiring model calls. The benchmark guide also found 1,024-token fixed chunks weaker than recursive chunks near that smaller size. Treat those results as a starting configuration, then test the same corpus, embeddings, and queries before standardizing it.
Match the method to the corpus
Semantic chunking compares neighboring passages by meaning instead of punctuation alone. It fits dense prose with frequent topic changes, but its embedding work must produce a measurable retrieval or answer-quality improvement. LLM-based splitting offers more control at still higher cost, so reserve it for small, high-value collections where manual structure is unavailable.
Structure-aware splitting is usually the right first choice when headings, pages, sections, tables, or code blocks already express the document's information architecture. A study covering manuals, specifications, and diagrams found better retrieval effectiveness with lower compute cost for structure-aware chunks in its dataset. Another dataset favored recursive splitting across its metrics. The comparative findings support a direct rule: the document structure and query type should determine the chunking rule.
| Chunker | Best For | Indexing Cost | Retrieval Gain | Failure Mode |
|---|---|---|---|---|
| Fixed-size | Short, uniform, factual text | Lowest | Baseline | Breaks semantic boundaries |
| Sentence | Prose and question answering | Low | Cost-effective in tested settings | Uneven lengths and missing section context |
| Recursive | Mixed prose and production baselines | Low | Strong practical baseline | Can miss domain-specific structure |
| Semantic | Dense, topic-shifting prose | Higher | Use only when evaluation shows a gain | Extra preprocessing and indexing work |
| Structure-aware | Manuals, PDFs, code, and organized web content | Low to moderate | Preserves answer-bearing units | Fails when parsing signals are unreliable |
NVIDIA's evaluation found page-level chunking reached the highest average end-to-end RAG accuracy at 0.648, with a standard deviation of 0.107, across its document types. The NVIDIA evaluation also measured Paragraph Group Chunking at about 0.459 mean nDCG@5, roughly 24% Precision@1, and around 59% Hit@5 in a more granular investigation. The practical implication is clear: preserve natural document units first, then apply token limits only where the model requires them.
Evaluating Chunk Quality Before You Ship
A chunker should not reach production because a few sample questions returned plausible answers. Build an offline harness that compares candidate splitters on the same corpus, embeddings, retriever settings, and answer model. This isolates boundary quality from changes elsewhere in the pipeline.
Start with queries drawn from real user behavior. Label the chunks containing direct evidence, the surrounding context required to interpret it, and misleading duplicates. The proposed harness uses at least 200 query-chunk pairs, but coverage matters more than treating that number as a ritual. Include short factual questions, long-form requests, references to definitions, and questions whose evidence spans multiple locations.
Measure retrieval and answers separately
Track nDCG, Precision@1, recall, and hit rate for retrieval. Then score the generated answer against the cited evidence. A chunker can improve recall by returning more text while reducing precision enough to make the final answer worse.
Create failure buckets for:
- Missing context: The answer-bearing text is present, but its qualifier or definition is absent.
- Multi-hop questions: Evidence is distributed across sections or documents.
- Numerical queries: Tables, units, dates, and nearby labels must stay together.
- Boundary failures: A sentence, list, code block, or heading is split incorrectly.
- Duplicate noise: Overlap returns multiple chunks containing the same passage.
Earlier benchmark results show why one metric cannot decide the winner. Page-level chunks performed strongly on average accuracy and consistency, while paragraph groups led on some retrieval measures. The benchmark's methodology, The benchmark's methodology, supports measuring retrieval quality and answer-level performance together. In practice, select the splitter that improves the complete question-answer path, not the one with the strongest isolated retrieval score.
Keep the comparison controlled
Run every candidate chunker with identical embeddings and retrieval parameters. A changed embedding model can hide a regression caused by worse boundaries. Record indexing time as well, because a quality gain that requires disproportionate ingestion work may not suit the corpus.
| Chunker | nDCG@10 | Precision@1 | Recall@10 | Answer Accuracy | Index Time |
|---|---|---|---|---|---|
| Fixed-size | Measure on your corpus | Measure on your corpus | Measure on your corpus | Measure on your corpus | Record your run |
| Sentence | Measure on your corpus | Measure on your corpus | Measure on your corpus | Measure on your corpus | Record your run |
| Recursive | Measure on your corpus | Measure on your corpus | Measure on your corpus | Measure on your corpus | Record your run |
| Structure-aware | Measure on your corpus | Measure on your corpus | Measure on your corpus | Measure on your corpus | Record your run |
Leave the table empty until your pipeline produces the values. Copying metrics from another corpus creates false confidence. For ingestion edge cases, pair the harness with an unstructured data processing workflow, then rerun the suite after parsing or indexing changes. Keep the evaluation set versioned so regressions remain visible over time.
Latency and Cost Trade-offs of Advanced Chunkers
Advanced chunkers move work to ingestion, but that work still affects the system budget. Semantic and LLM-based methods can add preprocessing latency because they require embedding or generation passes to choose boundaries. The right comparison includes retrieval quality, indexing cost, and end-to-end accuracy.
The 2026 evidence supports a cost-conscious sequence. One systematic analysis found that overlap increased indexing cost without measurable benefit, while sentence splitting matched semantic splitting up to about 5,000 tokens. For many corpora, simple rules are therefore a rational baseline rather than a temporary shortcut.
Separate index-time expense from query-time latency
Chunking usually runs during ingestion, so it does not automatically add latency to each query. It can still affect query performance through vector count, duplicate results, metadata filtering, and the amount of context sent to the generator.
As noted earlier, recursive splitting around 512 tokens with 50 to 100 tokens of overlap reached 69% end-to-end accuracy without model calls. The benchmark also found recursive splitting competitive with more expensive alternatives. Evaluate the full pipeline cost, including re-indexing, storage, retrieval, and generation, instead of judging a chunker by preprocessing complexity alone.

Spend more only when the evidence supports it
A semantic chunker earns its cost when it fixes a documented failure class, such as topic transitions that recursive rules repeatedly miss. An LLM-based chunker can fit a small legal, scientific, or compliance corpus where an individual retrieval error has unusually high value. It is harder to justify for a large, frequently changing collection with modest accuracy gains.
Track each cost separately:
- Parsing time: Time required for extraction and structural analysis.
- Boundary computation: Calls to embedding or language models.
- Embedding volume: Chunks that must be represented and indexed.
- Storage impact: Vector and metadata growth caused by chunk count.
- Regeneration cost: Work required after source documents or chunk rules change.
Run richer methods against recursive and sentence baselines on the same evaluation set. Hold embeddings, retrieval settings, and answer-generation settings constant. If end-to-end accuracy does not improve, the extra computation is overhead rather than optimization.
Handling Multimodal Documents and Web Content
Layout errors can turn correct source material into incorrect retrieval evidence. A character offset may detach a table value from its header, reverse PDF columns, or separate a figure caption from the image it explains. In 2026 benchmarks, multimodal pipelines should therefore be judged on retrieval quality and end-to-end answer accuracy, not text extraction alone.
Treat extraction as part of chunking. Use a layout-aware parser that preserves reading order and, when available, bounding boxes. Then split on headings, paragraphs, table boundaries, and figure captions. Keep those relationships in the indexed representation instead of assuming the raw text stream matches the document.

Preserve the units users ask about
Tables require separate treatment because semantic retrieval and exact lookup have different requirements. Store the logical table with its headers, retain row and column context in metadata, and generate a searchable text form that pairs each value with its label.
A practical table record includes:
- Table identity: Document, page, section, and table title.
- Header context: Column and row labels repeated beside relevant values.
- Raw structure: Cells preserved for exact answers and downstream rendering.
- Search representation: Natural-language text describing relationships among fields.
- Provenance: Coordinates or source references for citing the original location.
Images also need linked evidence. Apply a multimodal encoder when the query may depend on visual content, then associate the image vector with its surrounding text chunk, figure title, and caption. A diagram question can then retrieve the visual asset and its explanation together. Compare this setup with a text-only baseline using the same retrieval and answer-generation settings, and include indexing cost in the evaluation.
Clean web pages before splitting
Web crawls often include navigation, cookie notices, advertisements, footers, repeated menus, and other boilerplate. Remove those elements before embedding. Use semantic HTML boundaries, including headings, paragraphs, lists, and tables, to retain the page hierarchy.
DOM extraction can fail on client-rendered or poorly structured pages, so keep a recursive or fixed-size fallback. The fallback must preserve provenance. Record the URL, title, heading path, and extraction method, allowing reviewers to distinguish evidence from a clean article body and evidence from a noisy scrape. Re-run the 2026 evaluation after parser or fallback changes, since improved retrieval is useful only if end-to-end accuracy rises without an indexing-cost increase the application cannot support.
A Practical Chunking Playbook and Final Checklist
A production baseline should be reproducible before it becomes advanced. Start with recursive chunking around 512 tokens, modest overlap, and separators that preserve headings and other boundaries. The 2026 benchmark guide reports 69% end-to-end accuracy for recursive 512-token chunks with 50 to 100 tokens of overlap. A domain-specific benchmark found a strong sentence-based configuration using a 512-token window with 200-token overlap. Use these configurations as starting points, then validate them against your corpus and query mix.
Keep the embedding model, similarity metric, index, and retrieval settings fixed while comparing chunkers. If the validated stack uses BGE-M3 or text-embedding-3-large with cosine similarity on HNSW, changing those components during the test makes chunking results difficult to interpret. Record retrieval quality, indexing cost, and end-to-end accuracy for every candidate.
Deviation rules should be explicit
Leave short, self-contained documents intact when they already match the likely question. Use structure-aware rules for Markdown, code, organized HTML, and PDFs with reliable layout. Add semantic processing only when evaluation shows that simpler boundaries lose meaningful topic changes.
Reserve LLM-based chunking for low-volume, high-value material. Generation calls across routine support pages and repeated product records add cost and latency without a measured accuracy gain.
Use this checklist before shipping:
- Set the baseline: Record recursive splitting, token limits, overlap, and separators.
- Protect boundaries: Keep headings, definitions, lists, tables, captions, and code blocks intact where possible.
- Test overlap: Compare modest overlap with zero overlap on boundary-focused queries.
- Control the experiment: Hold embeddings, retrieval settings, and answer models constant.
- Cover query types: Test factual, numerical, multi-hop, and context-dependent questions.
- Track precision and recall: Reject higher recall if Precision@1 or answer quality declines.
- Inspect duplicates: Collapse neighboring or overlapping results before generation.
- Record provenance: Store source, section, page, position, and parser metadata with each chunk.
- Define re-indexing triggers: Rebuild after changes to chunk rules, parsing, embeddings, or source structure.
- Keep a fallback: Use recursive or fixed-size splitting when layout signals are missing or corrupted.
For teams building a customer-facing question-answering system, ingestion needs the same test discipline as prompts and models. AgentStack automatically chunks and indexes uploaded PDFs and crawled website content. Teams can also build and operate the pipeline directly with tools such as LangChain or LlamaIndex.
The reliable pattern is evidence-led: preserve structure, establish a recursive baseline, measure retrieval and answer outcomes, then add semantic or LLM-based decisions only for a measured failure. A chunking configuration is ready when it improves end-to-end accuracy without exceeding the application's indexing-cost and latency limits.
AgentStack can ingest website and document content, automatically chunk and index it for retrieval, and connect grounded answers to web, email, Slack, and voice support workflows. Visit AgentStack to evaluate a managed path for testing chunking, retrieval, analytics, and human handoff in one customer-support platform.
