How to Chunk Documents for RAG: Strategies for Better Retrieval

How to chunk documents for RAG and improve retrieval quality

Evidence: Documentation reviewed, plus one hands-on test (6 November 2026)

Last checked: September 2026 (documentation); 6 November 2026 (test)

What was done: Written from official documentation and the published sources linked in this article. One hands-on test was added on 6 November 2026: 14 questions in Gemini Notebook (free plan) and 4 in ChatGPT, shared with eight other RAG articles. See Our test.

Files: RAG test files (documents, questions, score sheet and screenshots)

Affiliate links: No

Learning how to chunk documents for RAG matters because retrieval quality is often blamed on the embedding model or vector database, when an earlier decision decides whether those components have useful material at all: how source documents are divided into retrievable units. Get that division wrong and even an excellent retrieval stack returns text that is technically relevant but practically useless to the language model.

A document can contain exactly the information an assistant needs and still fail at retrieval because the information was split badly. A policy exception may be separated from the rule it modifies, a table may lose its column headings or a long explanation may be cut into fragments that make little sense alone. The retriever then hands the model passages that mention the topic without containing the evidence needed to answer.

That is why chunking is more than a choice between 500, 1,000 or 2,000 tokens. It is a retrieval-unit design problem. The goal is units specific enough to retrieve accurately while keeping enough context to stay understandable after retrieval. Chroma’s research on evaluating chunking strategies found that the choice of strategy alone changed recall by up to 9%.

There is no universal chunk size, because legal agreements, handbooks, manuals, catalogs, research papers, financial reports and support tickets organize information differently. This guide explains how to decide systematically, covering size, overlap, structural, recursive and semantic chunking, parent-child and contextual retrieval, tables, metadata, multilingual content, failure diagnosis, evaluation and a production workflow you can apply this week.

What Is Document Chunking in RAG?

Document chunking is the process of dividing source material into smaller units that can be indexed, retrieved, ranked and supplied to a language model as context independently. If you are new to the overall pattern, our retrieval-augmented generation guide explains how retrieval and generation fit together, and the original RAG paper by Lewis et al. describes where the approach began.

The important word is independently. A chunk is more than a smaller piece of a document, because it becomes a unit inside the retrieval system. Once a document is divided, the retriever may select one chunk and ignore its neighbours. Each chunk therefore needs enough information for the retriever to recognize its relevance, and enough context for the model to interpret what it says.

Take a company policy with a section on travel reimbursement. It explains eligible expenses in one paragraph, approval rules in another and exceptions several paragraphs later. A mechanical splitter might create three separate chunks. A user asking whether staff can claim premium hotels on international trips could then retrieve the accommodation rule but miss the exception that changes how it applies.

The problem there is neither the embedding model, the vector database nor the language model. The evidence existed in the source, but ingestion created units that broke the link between rule and exception. A more useful definition follows: a good chunk is a retrieval unit that preserves the information relationships needed for the questions the system is expected to answer, whatever its exact length turns out to be.

That definition changes how decisions are made. Instead of starting with how many tokens each chunk should contain, the team starts with what information must stay together for retrieval and interpretation to work. The answer differs by document type and use case, which is why copying a chunk size from someone else’s project so often produces disappointing results on your own data.

Why Chunking Has Such a Large Effect on Retrieval

Chunking influences RAG at several stages at once. It decides what gets embedded, what gets matched to a query, what reaches the generation model, how much irrelevant material fills the context window and how easily the system can point to the precise evidence behind an answer. A weak decision here weakens every later stage.

Think of the knowledge base as a library where documents are books and chunks are the catalogue entries the search system can find. If entries cover huge portions of each book, results are broad but imprecise. If every sentence gets its own entry, results become very specific but lose the surrounding meaning needed to understand each sentence. Neither extreme serves readers well.

Chunking therefore creates a basic trade-off between retrieval precision and contextual completeness. Smaller chunks make it easier to isolate a narrow piece of evidence, which helps when users ask precise questions and the source covers many unrelated topics. However, small units can also strip out the definitions, qualifiers, examples, headings and exceptions that make a passage interpretable.

Larger chunks keep more context but bring a different problem. A large chunk may hold the answer alongside many unrelated paragraphs, which blurs semantic matching and fills the model’s context with noise it must sort through. The right strategy is neither the largest nor the smallest chunk. It is the unit that provides the right level of granularity for the questions your application receives.

Why document chunking affects RAG retrieval quality

Our Test: Finding Facts in a Table and Deep in a Long Document

On 6 November 2026 I ran a test with Gemini Notebook, Google’s RAG notebook (formerly NotebookLM), on the free plan. I gave it four short documents for a made-up bike shop, Quillmoor Cycles, and asked it 14 questions. I wrote the documents for this test, so no AI could know the answers in advance. This one test is shared by nine RAG articles on this site; the documents, questions, score sheet and screenshots are on our RAG test files page.

Chunking problems usually show up in three places: tables, facts buried in the middle of long documents, and rules whose conditions sit in different sentences. I built the longest test document, a warranty and service guide, with all three on purpose. Gemini Notebook got every one right:

TrapQuestionResult
Answer in a table rowHow many years is the frame warranty on the Quillmoor Cargo?7 years: correct
Fact in the middle of a long sectionIs there a free service for new bikes, and how do I book it?Free within 60 days, code FIRSTSPIN: correct
Rule with two conditionsMy Quillmoor Volt is 11 months old and has done 12000 km. Is the motor still under warranty?No, the 10,000 km limit comes first: correct
Item in an exclusions listDoes racing my bike affect the warranty?Competitive downhill racing voids the frame warranty: correct
Two rules combinedI opened an e-bike battery and want to return it 20 days after delivery. What will I get back?90% back after the 10% restocking fee: correct
The citation for the free-service answer opened the exact paragraph in Part 5 of the warranty guide (6 November 2026)
The citation for the free-service answer opened the exact paragraph in Part 5 of the warranty guide (6 November 2026)

What this does and does not show. Gemini Notebook does not reveal its chunk size, overlap or splitting method, so this test cannot tell you which chunking strategy works best. It shows the outcome: with short, well-structured documents, a managed tool kept tables and buried facts retrievable. Your own documents will be longer and messier, which is exactly when the strategies in this guide start to matter. One tool, one run, so treat it as a demonstration, not a benchmark.

Design Useful Retrieval Units, Not Uniform Blocks

A common mistake is to begin chunking by choosing a token number. A stronger process begins with the information architecture of the documents. Technical documentation, for example, usually contains a title, introduction, installation requirements, configuration steps, troubleshooting, examples, warnings and version notes. Splitting it every 800 tokens ignores boundaries the document already provides.

A better strategy recognizes headings and subheadings first, then splits unusually long sections into smaller units while keeping related information together. The resulting chunks vary in size but have a more useful shape. Uniform size is not the same as uniform information value: one section may need 350 tokens for a complete definition, while another needs 1,400 for a procedure to stay coherent.

A production system should judge chunk quality on several dimensions. Boundary quality asks whether a chunk starts and ends at a meaningful point rather than cutting through a concept. Self-sufficiency asks whether a reader can understand what the chunk is about without the whole document. Specificity asks whether it holds a focused idea, rule or procedure rather than several unrelated ones.

Two more dimensions complete the picture. Context recoverability asks whether information the chunk depends on can be brought back through metadata, parent-child links or neighbouring retrieval. Retrieval usefulness asks whether the chunk helps the system find the evidence that matters for realistic questions. These dimensions say far more about quality than chunk size alone, because they connect ingestion directly to the task.

Start With Document Structure Before Chunk Size

The first practical step in any chunking workflow is document inspection. Many documents already signal where information belongs together through headings, subheadings, paragraphs, numbered procedures, bullet groups, tables, captions, chapters, appendices and metadata. Ignoring those signals and applying a blind character or token splitter throws away structure the document is giving you for free.

Picture a 40-page employee handbook with sections on leave, pay, conduct, remote work, expenses and benefits. A fixed-size splitter may produce a chunk containing the end of the remote-work section and the start of the expense policy, purely because a token boundary fell there. A structure-aware splitter keeps section boundaries and only subdivides a section when it grows too large for efficient retrieval.

Structural chunking is not always sufficient on its own, because one section can still be too long. The point is that structural boundaries should usually be considered before arbitrary length boundaries. A typical hierarchy runs from the document to a major section, then a subsection, then a paragraph or logical block and finally a smaller semantic unit when needed, adapted to each source format.

Microsoft’s guidance on RAG with Azure Document Intelligence shows one way to recover that structure: its layout model extracts content and document structure into Markdown, which you can then use as building blocks for a semantic chunking strategy. Similar layout-aware parsers exist across most RAG toolkits.

Fixed-Size Chunking: Simple, Useful and Often Misunderstood

Fixed-size chunking divides text by a predetermined length, usually measured in tokens or characters. It remains popular because it is simple, predictable, cheap and easy to implement. There is nothing inherently wrong with it, and it can be a strong baseline when source material is fairly uniform and lacks reliable structure. It also gives more elaborate strategies something measurable to beat.

Microsoft’s guide to chunking documents in Azure AI Search recommends starting with 512-token chunks, roughly 2,000 characters, and an initial overlap of 25%, or 128 tokens. That is a reasonable starting point, but it is a starting point. The problem comes when a fixed size becomes an assumed answer rather than the first configuration in an experiment.

Suppose a knowledge base mixes short product descriptions, support articles and long technical manuals. A fixed 1,000-token setting might suit the manuals but waste space on short articles, while dropping everything to 300 tokens could fragment procedures. The question is whether your corpus and query patterns fit fixed-size assumptions. Homogeneous text often works well, and mixed corpora usually need structure-aware or hybrid approaches.

Choosing Chunk Size: What Should Decide the Number?

Chunk size is an engineering variable tied to the retrieval task, and several factors should shape it. Query specificity comes first. If users ask narrow factual questions, smaller units can isolate evidence more effectively. If they ask broad questions that need several connected concepts, larger or hierarchical units usually work better because the answer spans more text than a narrow chunk holds.

Document structure matters next. Short, self-contained FAQ entries behave very differently from long procedures in a technical manual, so a size that suits one can fail on the other. Context dependency matters too. If passages often rely on earlier definitions, headings or exceptions, aggressive splitting damages answerability, and the system needs larger chunks, metadata or parent-child retrieval to recover that context.

Embedding behaviour and generation context complete the list. A chunk holding several unrelated ideas produces a blended representation that matches queries less precisely, while a chunk with too little content may lack enough signal to distinguish it from similar passages, as our guide to how embeddings work in RAG explains. Huge chunks also waste generation context.

The best chunk size is therefore the one that performs well against a representative evaluation set, not the number that happens to appear in a popular tutorial. Treat any recommended figure, including the 512-token default above, as a hypothesis to test. The rest of this guide explains the techniques you can combine with size to fix the specific failures your tests reveal.

The Overlap Question

Chunk overlap lets consecutive chunks share part of their content. The rationale is simple: if an important sentence or relationship sits near a boundary, overlap reduces the chance that its meaning is split completely between two units. A paragraph that states a reimbursement rule and ends with an exception, for example, may keep both parts together in at least one chunk.

Overlap improves continuity, but it has costs. More overlap means more duplicated content in the index, higher storage and embedding costs, redundant results and more context consumed during generation. Excessive overlap can return several chunks containing essentially the same passage instead of several independent pieces of evidence. The aim is enough overlap to protect meaningful boundaries without filling results with duplicates.

Overlap also cannot fix bad chunking on its own. If a document is divided at arbitrary positions, overlapping those positions still produces arbitrary units. A 20% overlap between setup instructions and configuration parameters may carry some setup text forward, yet still drop the heading, prerequisites, warning and version note needed to interpret the configuration. Create good boundaries first, then use overlap selectively.

Recursive Chunking: A Practical Middle Ground

Recursive chunking tries to preserve larger structural boundaries before falling back to smaller ones. A system might first split by major headings, then by subheadings or paragraphs if a section is still too large, and finally by sentences if a paragraph remains too long. It respects document structure while still enforcing a practical maximum size for each retrieval unit.

Its strength lies in prioritizing better boundaries before resorting to mechanical ones rather than in understanding meaning. Chroma’s evaluation found that heuristic strategies such as the widely used RecursiveCharacterTextSplitter often perform well in practice when their parameters are set appropriately, which makes recursive chunking a strong default for many corpora before anything more complex is tried.

Recursive chunking still depends on the structural signals available in the source. A badly extracted PDF with missing headings or corrupted formatting can undermine it completely, because the splitter has nothing reliable to split on. That is why the ingestion and parsing steps matter as much as the chunking algorithm, a point that comes up repeatedly in the failure diagnosis later in this guide.

Semantic Chunking: When Meaning Matters More Than Length

Semantic chunking divides text where meaning changes rather than at mechanical boundaries. The idea is that neighbouring sentences belong together until the subject shifts, and when the semantic relationship weakens enough, a new chunk begins. It helps with documents that have irregular paragraph lengths or weak formal structure, where every paragraph break is not equally meaningful.

Semantic chunking adds complexity. It may require extra model processing, threshold tuning and evaluation, and it can produce unpredictable chunk sizes. More importantly, similarity between neighbouring sentences is not the same as retrieval usefulness. A heading and the short paragraph beneath it can look semantically different yet be essential together, while two similar sentences may serve different purposes.

Chroma’s research tested embedding-based and model-based chunkers alongside simpler heuristics, and the simpler methods were often competitive. Pinecone’s guide to chunking strategies for LLM applications reaches a similar conclusion. Treat semantic chunking as one tool rather than an automatic upgrade. If your documents already have good structure, a structure-aware or recursive approach may deliver most of the benefit at a fraction of the processing cost.

RAG document chunking process from source document to retrieval

Headings Are Context, Not Decoration

One of the most common chunking mistakes is stripping headings from the text that gets embedded or retrieved. A sentence such as “Employees must submit claims within 30 days” is ambiguous on its own. It could refer to travel expenses, medical reimbursement, equipment purchases or a particular employee group, and neither the retriever nor the model can tell which without more information.

If the original document carries a heading such as “Travel Expense Claims,” that heading contains valuable retrieval information. Removing it makes the sentence harder to match and harder for the model to interpret. A better pipeline keeps structural context with the content, so the retrieved unit makes clear that the rule belongs to the travel policy. Retrieval quality depends on the context that travels with each chunk as well as its text.

Contextual Chunking: Meaning Without Huge Chunks

A useful strategy is to enrich chunks with context instead of simply making them larger. A chunk can carry the document title, section heading, subsection heading and relevant metadata alongside the passage itself, so a fairly small unit stays interpretable. This matters most when the source repeats similar language, as large policy libraries often do across hundreds of sections.

Anthropic’s work on contextual retrieval takes this further by having a model write a short explanation of where each chunk sits in its document and prepending it before embedding. Anthropic reports that this reduced failed retrievals by 49%, and by 67% when combined with reranking, which shows how much retrieval depends on context the raw chunk lacks.

Contextual enrichment preserves a chunk’s identity while keeping it granular, which large chunks achieve less efficiently. It becomes more important as a knowledge base grows. In a small collection, similar passages are manageable, but in an enterprise corpus with thousands of documents, ambiguous chunks compete with each other and the wrong one wins far too often.

Parent-Child Chunking: Separate Search From Reading Context

Parent-child retrieval resolves the tension between precise retrieval and sufficient context in another way. The system creates small child units for retrieval and links each to a larger parent unit with broader context. A specific child chunk is easier to match to a query, and once it is selected, the system returns the associated parent section or a controlled amount of surrounding text to the model.

This approach suits cases where the smallest useful retrieval unit differs from the smallest useful reasoning context. A paragraph describing one configuration parameter may be ideal for matching a query about it, but the model may also need the surrounding section to understand prerequisites, supported versions or warnings. Returning the whole manual would be excessive, while returning only the paragraph could be insufficient.

Parent-child retrieval lets the system search at one granularity and reason over another, which is one of the most important ideas in modern chunking. It also explains why advice such as “use 500-token chunks” is incomplete. The more useful questions are what the retriever should search and what context the model should receive once the search succeeds, treated as two separate design decisions.

Neighbouring-Chunk Expansion

Sometimes the best fix is to retrieve neighbouring chunks when one relevant unit is found, rather than enlarging every chunk. If a retrieved paragraph contains a policy rule, the system can also return the preceding heading and the following paragraph, giving the model broader context without making each indexed chunk large. This works well where adjacent sections usually relate.

Neighbour expansion should still be controlled. Blindly returning five chunks before and after every result adds noise, especially in documents where adjacent sections cover different topics. The right neighbourhood depends on document structure and question types, so test it like any other setting. Our guide to context engineering covers how to assemble retrieved material efficiently for the model.

When Small Chunks Work Well

Small chunks work best when passages are fairly self-contained and users ask narrow questions. A product catalogue is a good example: if each entry holds a name, description, specifications and attributes, a small chunk can represent one product cleanly, and retrieval can distinguish products without dragging unrelated catalogue material into the context. FAQ pages often behave the same way.

Small does not automatically mean precise, though. If the corpus contains many similar statements, a tiny chunk may lack the context to distinguish them. If a sentence relies on pronouns, references to earlier sections or omitted subjects, the unit can be semantically weak despite being short. The property to aim for is self-contained specificity rather than smallness for its own sake.

When Larger Chunks Work Better

Larger chunks help when meaning depends heavily on surrounding material. Long procedures are a common example, since a user asking how to configure a system may need prerequisites, instructions, validation steps and troubleshooting notes together. Research papers raise similar issues, because a finding may only make sense alongside the methodology, population and limitations described nearby.

Legal and compliance documents are especially sensitive to context, because definitions, exceptions, scope clauses and cross-references can change the meaning of an individual sentence. In these cases larger chunks may be appropriate, or a hierarchical strategy may be better still. The test is always the same: does the retrieved unit contain enough evidence for a responsible answer to the questions users ask?

A Better Way to Pick a Chunk Size

Rather than choosing a number first, start with a representative set of questions. Take real or realistic user queries and identify the minimum source passage needed to answer each one correctly, then look at where that evidence sits in the document. That exercise turns chunk-size selection from a theoretical debate into an empirical design task that a team can agree on.

If answers consistently fit inside small, self-contained sections, smaller chunks may suit you. If they repeatedly need neighbouring paragraphs, headings, examples or exceptions, your strategy must keep those relationships together. If the evidence is narrow but interpretation needs broader context, separate retrieval granularity from returned context with parent-child retrieval or neighbour expansion rather than inflating every chunk.

How Document Type Should Shape Your Strategy

Different document families create different chunking problems, so one global strategy is convenient operationally but often weak technically. The table below lists common document types, the challenge each poses and a useful starting approach. Treat it as a set of hypotheses for your own tests, because the right strategy still depends on the questions your users ask.

Document typeCommon chunking challengeOften useful starting approach
FAQsEntries are usually self-containedQuestion-and-answer or entry-level chunks
Technical documentationProcedures depend on headings and prerequisitesStructure-aware or recursive chunks
Legal agreementsDefinitions, exceptions and cross-references matterStructure-aware plus contextual or hierarchical retrieval
Research papersFindings depend on methodology and limitationsSection-aware chunks with contextual retrieval
Employee handbooksRules carry exceptions and scope conditionsSection-aware chunks with metadata
Product catalogsRecords are usually distinctRecord-level chunks
Support ticketsConversations carry temporal contextThread-level or contextual chunks
Web pagesNavigation and boilerplate pollute contentClean extraction plus structural chunks
Financial reportsTables and captions carry meaningStructure-aware extraction with table preservation
Code documentationExamples and explanations belong togetherFunction, class or section-aware chunks
AI Hustle World framework for choosing a RAG document chunking strategy

Tables Are One of the Hardest Chunking Problems

Tables need special treatment because their meaning depends on relationships that vanish when they are flattened into plain text. Picture a table with columns for product, region, revenue, growth rate and reporting period. If extraction produces a chunk containing only “North America 24.6%,” the number is almost meaningless, because the column heading and row context are part of the evidence.

A system that treats tables like ordinary paragraphs can create units that look small and tidy while destroying the information needed to interpret them. Better approaches preserve table structure, attach headings, represent each row or logical group with its column labels or use dedicated extraction for structured data. Chunking cannot be fully separated from parsing, because no size setting restores structure that extraction already lost.

Lists, Procedures and Numbered Steps

Numbered procedures raise a related boundary problem. If a six-step configuration process is split across chunks, a user who retrieves step four may miss the prerequisites in steps one to three. Yet putting dozens of unrelated procedures into one giant chunk makes retrieval imprecise. The better approach treats each procedure as a logical unit first and only subdivides it when necessary.

When subdivision is needed, keep the procedure title and step context with each part. A chunk holding steps four to six should still say which procedure the steps belong to and, where relevant, what they depend on. Metadata and contextual enrichment usually handle this more efficiently than simply enlarging the chunk, and they keep each procedure identifiable when several share similar wording.

PDFs Can Break Chunking Before It Starts

PDFs often look well structured to a reader while extracting as messy text. Headers repeat on every page, footers appear inside paragraphs, multi-column layouts come out in the wrong order, tables collapse into jumbled sequences and captions detach from their figures. Sentences may be split across pages with no structural marker to show the break, which confuses any splitter that relies on punctuation.

If that text goes straight into a chunker, the chunks faithfully preserve the extraction errors. That gives an important diagnostic rule: if chunking seems to fail consistently, inspect the extracted text before changing the chunk size, because a chunking problem is often a parsing problem. A structure-aware chunker cannot use headings that extraction separated from their paragraphs, and overlap cannot repair a flattened table.

Metadata Preserves Context Without Repetition

Metadata offers another way to keep context without copying large amounts of text into every chunk. Useful fields include document title, source type, author, department, publication date, version, product, region, language, access permissions, section title and document status. These fields improve both filtering and interpretation, and they make retrieval failures far easier to diagnose.

Suppose a company holds current and archived versions of the same policy. Two chunks may contain nearly identical wording, but metadata can mark which document is active, so the retriever can filter or rank accordingly. When a failure occurs, metadata also shows whether the system retrieved the wrong section, version, document type or jurisdiction, rather than leaving the team to blame semantic similarity in general.

It helps to think of a retrieval unit as more than text: it carries document identity, structural location, version information, categorical metadata, links to parent or neighbouring units and whatever is needed to rebuild broader context. That richer unit also allows filtering before semantic ranking, so a query about one product version can be limited to matching documents first. Our guide to vector databases explains how filters and vectors work together.

Multilingual Documents Need Extra Care

Chunking multilingual content involves more than changing the tokenizer. Languages differ in sentence structure, writing conventions, tokenization and average information density, so a chunk size that suits one language may not produce equivalent semantic units in another. A 500-token chunk of English and a 500-token chunk of Bengali or Arabic can hold quite different amounts of meaning.

There is also the question of whether users query in the same language as the source. A multilingual knowledge base might hold English policies, Bengali staff communications, Arabic contracts and Spanish support material, and mixed-language documents may have headings in one language and body text in another. Rather than inventing a strategy per language, test whether your segmentation produces comparable retrieval behaviour across every language in the corpus.

Chunking Is Not a One-Time Decision

One of the most common operational mistakes is treating chunking as a one-off preprocessing step. Documents change, new versions arrive, old ones are retired and formatting shifts. User questions evolve, embedding models are replaced and query patterns move as users discover new capabilities. A strategy that tested well at launch can become less effective months later without anyone touching the configuration.

Suppose an internal assistant initially handled simple policy lookups, and users later began asking comparative questions spanning several policies and exceptions. The original chunks were designed for narrow lookups and may not hold enough context for the broader queries. The strategy has not become wrong. The workload changed, which is why production RAG needs ongoing evaluation rather than permanent ingestion settings.

The Most Common Chunking Mistakes

Several mistakes appear repeatedly because they are easy to implement and easy to overlook. Each one quietly reduces retrieval quality, and each tends to be misdiagnosed as a model or database problem. The list below covers the errors we see most often in RAG pipelines, with a short note on why each one causes trouble for the questions users ask.

  • Choosing a popular chunk size without testing. A number copied from another project is not evidence that it fits your documents or questions.
  • Splitting only by token count. Mechanical boundaries cut through headings, definitions, procedures, tables and exceptions.
  • Making chunks too small. Tiny chunks raise apparent precision while removing the context needed to interpret evidence.
  • Making chunks too large. Big chunks reduce specificity and flood the model with irrelevant context.
  • Assuming overlap solves everything. Overlap protects some boundaries but cannot repair bad structure or extraction.
  • Removing headings. Headings carry essential semantic context that makes passages unambiguous.
  • Ignoring tables. Flattened tables produce numbers without the labels that explain them.
  • Mixing document versions. Without version metadata, retrieval can surface outdated rules.
  • Testing only on synthetic questions. A handful of hand-written queries rarely reflects real user language.
  • Blaming chunking for every failure. Extraction, embeddings, filters, top-K and ranking can all cause similar symptoms.

Diagnose the Failure Before Blaming Chunking

When a RAG system gives poor answers, teams often jump straight to adjusting chunk size. Sometimes that is right, but the same symptom can come from many stages. A document may have been extracted badly, a table may have lost structure, the embedding model may struggle with the domain or language, metadata filters may be missing, the query may be ambiguous, top-K may be miscalibrated or the source may hold contradictory versions.

Chunking is highly visible and easy to change, so teams can burn weeks tuning it while the failure sits elsewhere. A better diagnostic sequence asks where the evidence was lost. If the right information exists in the source but never appears among retrieved candidates, the problem is retrieval-side. If the right chunk was retrieved but the model ignored it, the problem lies in context construction or generation.

Retrieval Failures vs Generation Failures

Suppose a user asks whether staff can carry unused vacation days into the next year, and the knowledge base holds the correct policy. If retrieval returns sections on sick leave, travel and remote work, that is a retrieval failure, because the model cannot answer from evidence it never saw. If retrieval returns the right carryover paragraph but the model says all unused days expire, that is a generation failure.

Chunking can contribute to both, but the fixes differ, so evaluation should check five things separately: whether the right document was retrieved, whether the right section was retrieved, whether the necessary evidence was in the context, whether enough surrounding context came with it and whether the model used it correctly. Our guide to reducing hallucinations with RAG covers the generation side.

Comparison of RAG chunking strategies for different document types

A Practical Chunking Decision Framework

Instead of asking which chunking method is best, work through a sequence of decisions about your corpus. First, identify the natural information unit, whether that is a paragraph, FAQ entry, product record, section, procedure, conversation or table. Second, check whether that unit is small enough for efficient retrieval, and if not, find where meaningful subdivisions exist within it.

Third, ask whether the unit depends on surrounding context, and if so, preserve that link through larger chunks, metadata, contextual enrichment, neighbour retrieval or parent-child design. Fourth, look for repeated or ambiguous passages and strengthen their identity with headings, document metadata or version information. Fifth, test against real queries to confirm the units provide enough evidence and specificity.

Sixth, define how success will be measured before declaring a configuration finished, using retrieval metrics and answer-level outcomes. That sequence is far more reliable than choosing a token number and forcing the rest of the architecture to fit around it, and it produces a written rationale that helps the next engineer understand why the pipeline looks the way it does.

Run a Controlled Experiment, Not a Debate

Chunking debates can become surprisingly subjective, with one engineer preferring 500 tokens, another 1,000 and a third arguing for semantic chunking. The reliable way to settle it is to test the options against the same evaluation set. Start with a simple baseline suited to the corpus, such as recursive or structure-aware chunking, and build a question set covering the query types the system must handle.

For each question, record which source passage holds the necessary evidence, creating a retrieval ground truth. Then change the chunking strategy while holding other variables steady. If the embedding model, top-K, reranker, query processing and prompt all change at once, nobody can tell which change helped. Compare strategies on the dimensions in the table below and choose the one that improves the outcomes that matter.

StrategyRetrieval precisionEvidence coverageContext qualityDuplicate retrievalOperational complexity
Fixed-size baselineMeasureMeasureMeasureMeasureLow
Structure-awareMeasureMeasureMeasureMeasureLow to medium
RecursiveMeasureMeasureMeasureMeasureMedium
SemanticMeasureMeasureMeasureMeasureMedium to high
Parent-childMeasureMeasureMeasureMeasureHigher
Context-enrichedMeasureMeasureMeasureMeasureHigher

What Should You Measure?

Chunking should be judged by retrieval and answer quality rather than by how elegant the pipeline looks. Useful retrieval measures include whether the correct evidence appears among retrieved candidates, how high it ranks, how much irrelevant context is included and how often duplicate chunks consume retrieval slots. Recall at K asks whether the required evidence appeared in the top K results at all.

Precision at K asks how much of what was retrieved is relevant. Chroma’s evaluation also measured recall and precision at the token level and used intersection over union to capture how much retrieved text overlapped the evidence. No single metric tells the whole story, so pair retrieval metrics with answer-level checks. Our guide to evaluating RAG retrieval quality covers these in depth.

Evidence Completeness

Retrieval can look successful while the context is functionally incomplete. A question may need two pieces of evidence, a rule and its exception, and a system that returns only the rule technically retrieves relevant text while still failing the question. The same happens with a term returned without its definition, or a table row returned without the column heading that explains it.

That is why good chunking aims to preserve the evidence relationships realistic questions require, rather than simply maximizing relevance scores. Add evidence completeness to your evaluation by marking, for each test question, every passage needed for a correct answer, and count a retrieval as successful only when all of them arrive. That stricter test exposes chunking problems that recall at K alone will hide.

How Top-K, Reranking and Query Rewriting Interact With Chunking

Top-K sets how many candidates pass from the first search stage, and it interacts with chunk size. With very small chunks, a low K may return only fragments, while raising K recovers context but adds noise. With very large chunks, a low K may bring enough context but plenty of irrelevant material. Raising K should not become a substitute for good chunking, since needing six fragments every time signals units that are too granular.

A reranker reorders an initial set of candidates using a more detailed relevance judgment, which helps when several plausible passages compete. Anthropic’s 67% figure shows how well reranking can combine with contextual chunks. Reranking cannot recover evidence that was never retrieved, however, and it cannot rebuild a table whose structure extraction destroyed. Later stages refine what earlier stages provide without undoing upstream losses.

Query rewriting matters because users rarely phrase questions the way documents do. A policy might say “eligible dependent healthcare expenditures” while the user asks about claiming a child’s medical costs. Rewriting can bridge that gap, but it cannot create information the chunks fail to represent, so chunking should always be evaluated against real query language rather than the vocabulary of the documents.

Chunking and Embeddings Are Tightly Coupled

The embedding model represents whatever each chunk contains. A chunk holding several unrelated concepts produces a blended vector, so a query aimed at one concept may match it because of one part while dragging unrelated topics into the context. A focused chunk produces a sharper representation, but excessive fragmentation removes context, creating a balance between semantic concentration and completeness.

Changing the embedding model does not fix bad chunking. A stronger model may represent meaning better, but it still receives whatever units the ingestion pipeline created, and if a key relationship was destroyed before embedding, the model cannot rebuild it. That is also why more chunks do not mean better retrieval. Splitting a document into 500 pieces instead of 50 enlarges the index without making it more useful.

Long Documents Need Hierarchy

Very long documents expose the limits of flat chunking. In a 300-page regulatory document, an answer about one requirement may depend on the chapter, jurisdiction, definitions section and exception clauses. Representing that document as hundreds of independent chunks loses the hierarchy that makes it understandable, and the retriever has no way to know that a clause in chapter twelve depends on a definition in chapter two.

A hierarchical strategy preserves relationships between document, chapter, section, subsection and passage, so retrieval can find a specific passage while still recovering broader context when needed. That matters for complex knowledge bases that behave like structured information systems rather than piles of paragraphs. As source material grows, relationships between retrieval units matter more than the size of any single unit.

Versions and Permissions Must Survive Chunking

Versioning deserves special attention in enterprise RAG. If a company publishes a new travel policy each year and indexes old and new versions without clear version metadata, a query about current rules may retrieve an obsolete paragraph that happens to be semantically closest. That looks like a retrieval-quality problem, but the fix is metadata filtering or document lifecycle management rather than a new chunk size.

Access control adds another requirement. If a document is restricted to one team, its chunks must keep enough identity and permission metadata for the retriever to enforce that restriction. A technically excellent strategy becomes unacceptable if it lets a user retrieve content they cannot see. Each chunk must carry where it came from, who may access it, which version it represents and where it sits in the larger structure.

What Happens When You Do Nothing?

Poor chunking rarely causes an obvious crash, which is part of the problem. The application keeps responding while retrieval quality slowly degrades, and users receive answers that sound plausible but drop qualifications, cite incomplete evidence or blend related but distinct information. Nobody files a bug report saying the chunk boundaries are wrong, so the cause goes unnoticed for months.

Teams then often read these failures as model hallucinations and start swapping prompts, models, vector databases or top-K settings. If the underlying issue is retrieval-unit design, those changes achieve little and the pattern repeats: more experimentation without fixing the information architecture. Treating chunking as part of the quality foundation, and evaluating it alongside retrieval and generation, breaks that cycle.

RAG troubleshooting framework for distinguishing chunking and retrieval failures

A Practical Production Workflow for Chunking

A dependable process does not need to be complicated, but it should be disciplined. Start by inventorying the corpus, separating PDFs, web pages, manuals, policies, spreadsheets, support conversations, research papers and product records instead of assuming they share a structure. Then inspect extraction quality, checking headings, tables, lists, page breaks, repeated headers, footers and captions before measuring anything.

Next, identify natural boundaries such as sections, records and procedures, and preserve them where practical. Establish a simple baseline so later strategies have something to beat, and build a representative evaluation set covering lookups, multi-step questions, exceptions, comparisons, table questions and questions that need contextual interpretation. Include real user queries wherever you can collect them.

Then test alternative sizes, overlaps, structural rules, semantic methods and hierarchical strategies while holding other retrieval variables steady. For every failed question, diagnose whether the problem arose in extraction, chunk creation, indexing, retrieval, ranking, context assembly or generation. Choose the strategy that best balances retrieval quality, answer quality, cost, latency and operational complexity for your workload.

Finally, keep monitoring after deployment with a regularly refreshed set of representative queries, because documents, users and retrieval patterns change. That last step is the one most teams skip, and it is the reason so many RAG systems perform well in their launch review and noticeably worse six months later. Our comparison of the best RAG platforms notes which tools help with ongoing evaluation.

A Simple Chunking Evaluation Checklist

Before adopting a production strategy, run it against the checklist below. It is deliberately broader than chunk size, because production retrieval quality depends on boundaries, context, structure, versions and permissions as much as on how many tokens each unit holds. Any “no” answer points to a specific improvement worth testing before launch.

QuestionWhy it matters
Does each chunk have a meaningful boundary?Prevents arbitrary concept splitting
Can the chunk be understood with limited surrounding context?Improves generation quality
Does it contain a focused topic or task?Improves retrieval specificity
Are headings preserved?Maintains semantic identity
Are tables represented correctly?Protects structured evidence
Are versions and permissions preserved?Prevents unsafe or outdated retrieval
Can related context be recovered?Protects context-dependent answers
Does the strategy work across document types?Reduces corpus-specific failures
Does it perform well on real questions?Connects chunking to actual utility
Can the system be monitored and re-evaluated?Supports production maintenance

How to Improve Chunking Without Rebuilding Everything

Treating chunking as its own layer means teams can often improve it without replacing the whole architecture. Start by inspecting failed queries and checking whether evidence was split incorrectly. If headings are missing, preserve them. If sections are too large, add structure-aware subdivision. If small chunks keep needing neighbouring context, test parent-child or neighbour retrieval before changing anything else.

If tables fail, improve table extraction rather than token limits. If current and outdated documents compete, strengthen version metadata and filtering. If chunks retrieve well but confuse the model, test contextual enrichment. These targeted fixes beat swapping the embedding model or vector database blindly, and if you are weighing a bigger change, our guide to RAG versus fine-tuning helps decide.

The Core Trade-Off: Precision vs Completeness

Almost every chunking decision comes back to one tension. Precision asks whether the retrieved unit closely matches what the user is looking for. Completeness asks whether it contains enough evidence and context to answer correctly. Smaller chunks tend to raise precision and lower completeness, while larger chunks tend to do the reverse, and no single size optimizes both at once.

Each technique in this guide manages that trade-off differently. Parent-child retrieval separates the two goals, contextual enrichment adds context without growing chunks much, neighbour retrieval restores local context after a precise match and structure-aware and semantic chunking improve the boundaries themselves. Seen this way, they are complementary tools rather than competing schools of thought.

Final takeaway on choosing effective RAG document chunks

Why There Is No Best Chunk Size

A universal optimal chunk size is an attractive idea because it makes RAG engineering sound simpler than it is. A 300-token chunk can be excellent for a self-contained FAQ answer and poor for a multi-step procedure. A 1,500-token chunk can be excessive for a product description and right for a regulatory section with definitions and exceptions, and the same size can behave differently across languages.

The target is a retrieval behaviour rather than a number. If changing chunk size improves evidence retrieval, context completeness and answer quality on representative queries, the change has value. If it only produces a preferred number without better outcomes, the number means nothing. Every strategy in this guide is ultimately an answer to one question: what information must travel together for retrieval to produce useful evidence?

Sophistication should also be earned by evidence. Semantic chunking, hierarchical retrieval and contextual embeddings are not automatically better because they are more complex. A clean structure-aware strategy can beat an elaborate semantic system on well-organized documents with straightforward questions, so do not add complexity to fix a problem you have not measured.

The Future of Chunking

Chunking is likely to shift from static splitting toward retrieval-aware context design. Traditional pipelines divide a document once and keep those divisions fixed. More advanced systems keep hierarchical relationships, contextual metadata, document structure, neighbouring links and several representations of the same content, so the retriever can assemble context dynamically for each question.

That direction makes sense because questions are not uniform: one needs a sentence, another a paragraph and its exception, another a whole procedure and another evidence from several documents. A single static chunk size suits none of those perfectly. The likely long-term model is a system that searches at one granularity and builds context at another, staying precise in search without losing the context needed for reasoning.

Final Thoughts

The biggest mistake in RAG chunking is treating it as a contest to find the perfect token count. Chunking is about designing retrieval units that preserve relationships between pieces of information while balancing search precision and reasoning context. Making documents smaller is only a side effect of that design work, and treating it as the goal leads teams in the wrong direction.

Instead of debating 500, 800 or 1,500 tokens, examine your documents, find their natural boundaries, study the questions users ask and decide what evidence must stay together for correct answers. Sometimes that means small chunks, sometimes larger sections, and often small child units with broader parent context, preserved headings and metadata, neighbour expansion or special handling for tables.

Each decision should have a reason tied to retrieval behaviour, tested against representative questions and revisited as the corpus changes. Judge chunks by whether they help the system retrieve the right evidence with enough context to use it, not by how evenly they divide a document. That is the difference between splitting text and designing a retrieval system.

Keep Building Your AI Knowledge

Once documents are chunked, they need to be stored and searched, which is the job of a vector database.

Read About Vector Databases →

Frequently Asked Questions

What is the best chunk size for RAG?

There is no universal best size. It depends on document structure, query style and context needs. Microsoft suggests starting at 512 tokens with 25% overlap, then testing against real questions.

How much overlap should RAG chunks have?

Enough to protect meaning at boundaries without flooding the index with duplicates. Common starting points range from 10% to 25%, but test overlap as part of your retrieval setup.

Are smaller chunks better for RAG?

They can raise precision by isolating narrow evidence, but they often strip context. They suit self-contained content such as FAQs and product records more than long procedures.

Are larger chunks better for RAG?

They keep context for procedures, regulations and research, but they can add irrelevant text and reduce retrieval specificity. Parent-child retrieval often gives the benefits of both.

Is semantic chunking better than fixed-size chunking?

Not automatically. Chroma found well-tuned recursive splitters often perform well, while semantic methods add processing and tuning. Compare them on your own evaluation set.

Should headings be included in RAG chunks?

Usually yes. Headings carry context that makes passages unambiguous, and keeping document and section titles with each chunk improves both retrieval and the model’s interpretation.

How should tables be chunked for RAG?

Treat them as structured data. Keep column headings, captions and units with each row or group, preserve table structure during extraction or use a dedicated representation for tables.

Can better embeddings fix poor chunking?

No. A stronger embedding model improves matching, but it cannot restore a heading, exception or table relationship that extraction or chunking already separated from its evidence.

How do I evaluate whether my chunking strategy works?

Build representative questions, mark the evidence each needs and compare strategies on recall, ranking, evidence completeness and answer support, while holding other variables steady.

Should I use one chunking strategy for every document?

Usually not for mixed corpora. FAQs, manuals, contracts, research papers, catalogs and tickets have different natural units, so a shared baseline plus specialized paths often works best.

Written by

Muntasir Ahmad Chowdhury

Founder, AI Hustle World

Muntasir Ahmad Chowdhury is the Founder of AI Hustle World, an independent publication dedicated to making Artificial Intelligence practical, trustworthy, and easy to understand. He researches AI tools, automation, customer service, productivity, and real-world business applications, helping readers make smarter technology decisions through research-driven, experience-backed content.

Expertise:
AI Tools • AI Automation • AI Customer Service • AI Productivity • Generative AI • AI Workflows

Read Full Author Profile →