Someone picks 512 tokens with 50 of overlap because a blog post said so, and it quietly becomes permanent infrastructure. Nobody revisits it, because no number ever says it is wrong.

Chunk size is a decision about what a complete answer looks like for the questions your users actually ask.

Chunk to the shape of the question

A fact lookup and a procedure have different natural units, and one strategy cannot serve both well.

Question typeChunk toWhy
Specific fact lookup200 to 400 tokens, tight boundariesPrecision matters, and extra text dilutes the match
Procedure or how-toWhole section, headings preservedStep 4 is useless without steps 1 to 3
Comparison or synthesisSection plus a parent summaryThe model needs whole units it can compare
Policy or contract clauseClause boundary, never mid-sentenceA half-quoted clause is a legal problem, not a retrieval one

Split on structure first, at headings, list boundaries and table boundaries. Fixed-size splitting with overlap is only the fallback for unstructured prose. And carry the heading path into the chunk text itself, so a chunk reading "must be approved within 5 business days" also carries "Expenses > International travel > Approval" and stops being ambiguous.

Rerank before you pack

Retrieve wide and keep narrow: pull fifty candidates from hybrid search and score each one against the full query with a cross-encoder. It is slower per candidate and much more accurate than vector similarity, which is why it runs over fifty documents instead of fifty million. The effect is the right chunk moving from rank 14 to rank 2, and position in the context window changes what the model leans on.

Add a diversity rule at the same step, such as a cap on chunks per document. Five chunks from one document look like strong corroboration and are really one source repeated. The cap costs you on procedures, where one document genuinely holds the whole answer, so set it per question type rather than globally.

Treat the context window as a budget

Bigger windows made this problem less visible without making it any less real.

Every extra chunk costs tokens, adds latency, and gives the model another place to find something plausible but irrelevant. Set the budget explicitly: a chunk count, a token ceiling, and a minimum relevance score below which a chunk is dropped even when room remains. Order the survivors so the strongest evidence sits at the start or end of the packed context, because long-context models tend to use material in the middle least reliably (the "lost in the middle" effect). Label each block with its source ID and section so citations can be generated rather than invented.

Weak evidence deserves a weak answer

The failure that erodes trust fastest is a confident answer assembled from chunks that all scored 0.31.

Pass the scores into the generation step along with the text, and give the system a refusal path. Below the threshold, the honest response states what was searched, says nothing conclusive was found, and offers the closest sources instead of synthesising a paragraph out of near misses.

Set that threshold from data rather than instinct. Run labelled questions through retrieval, some the corpus can answer and some it cannot, and put the line where the top reranker scores of the two groups separate. Too high and the system refuses answers it had; too low and the 0.31 answers come back. Raw scores are not calibrated across models, so re-derive the threshold whenever the embedding model or the reranker changes.

Live · Chunking lab

Try it: the chunking lab shows how chunk size, overlap and top k decide whether retrieval hands the model the whole answer.

Try

The default: the hotel sentence lands across a boundary.

Question What is the hotel limit per night in London?

No chunk holds the whole answer: a boundary cut it in two. Try another size or add overlap. With fixed windows, a bigger chunk is not always safer.2 of 5 chunks sent · 80 words

The document, cut into chunks

Each band is a chunk; a numbered rule is where the next one starts. Shown: the paragraphs the answer and the retrieved chunks are in.

RetrievedThe answer

Open the full lab, with every control

About this explainer

Format
Explainer
Level
Practitioner
Read
2 min read
Published
Aug 13, 2026

Short mental models: one idea, why it matters, what to do about it.

Checklist · · 12 checks

RAG production-readiness checklist

Twelve checks to pass before a retrieval system answers a real user. Tick them locally; progress stays in your browser.