Chunk size gets all the attention because it's the one knob everyone knows. But plenty of RAG pipelines have their chunking right and still return garbage — because the failure is somewhere else in the retrieval path.
Chunk size is the first thing everyone tunes in a RAG pipeline, and with reason — badly cut chunks do wreck retrieval. But it has also become a comfortable scapegoat. Teams tune chunk size, see some improvement, and stop, while their pipeline still returns confidently wrong answers. If your chunking is sensible and quality is still poor, the problem has moved downstream. Here are the failure modes that live in the rest of the retrieval path, with a way to spot each one.
First, what RAG is doing
Keep the mechanism in view, because every failure below is a break in one link of it:
"Retrieval-augmented generation (RAG) is a technique that enables large language models (LLMs) to retrieve and incorporate new information from external data sources. With RAG, LLMs first refer to a specified set of documents, then respond to user queries."
— Wikipedia, "Retrieval-augmented generation" (CC BY-SA 4.0)
Retrieve, then respond. Chunk size affects what's retrievable. These other failures affect whether the right thing is actually retrieved, fits, and is then actually used.
Before tuning anything: build a tiny test set
Every fix below is guesswork unless you can measure it. Write down twenty or thirty real questions, and for each one note which chunk (or document) holds the answer. Then for each change, check one thing: did the right chunk appear in what the model received? That separates "retrieval missed it" from "retrieval found it and the model ignored it" — two failures with completely different fixes.
1. The query/document phrasing mismatch
Vector search matches on semantic similarity, and users don't phrase questions the way your documents phrase answers. A user asks "why won't it turn on"; the manual says "troubleshooting power supply failures." A human sees these as the same topic; two embeddings of them can sit surprisingly far apart. The chunk containing the answer exists, is well-sized, and still isn't retrieved.
Fixes live at the query end: rewriting or expanding the user's question before searching, or generating a hypothetical answer and searching with that. The second idea has a name in the research literature — HyDE, from Gao et al. (arXiv 2212.10496), where a language model writes a hypothetical document that "captures relevance patterns but is unreal and may contain false details", and its embedding is used to find real documents. That caveat matters: the generated text is only a search key, never something to show the user.
How to spot it: the right chunk is missing from the results, but searching with the document's own wording finds it immediately.
2. Pure vector search misses exact terms
Embeddings are good at meaning and weaker at literals. Search for an error code like E-4021, a product SKU, or a person's surname, and semantic similarity can shrug — it retrieves things that are "about" the topic while missing the chunk containing the exact string. Keyword ranking functions such as BM25, which Wikipedia describes as a bag-of-words function ranking documents by the query terms they contain, handle that case well. That's why many pipelines use hybrid search: run both, then merge the lists.
A common merge is reciprocal rank fusion, from Cormack, Clarke and Büttcher (SIGIR 2009): each document scores 1 ÷ (k + rank) in each list, summed, with k = 60 in the paper. An invented example with five chunks per list:
- Vector order: c7, c2, c9, c4, c1
- Keyword order: c4, c8, c7, c3, c2
| Chunk | Vector rank | Keyword rank | RRF score |
|---|---|---|---|
| c7 | 1 | 3 | 0.03227 |
| c4 | 4 | 1 | 0.03202 |
| c2 | 2 | 5 | 0.03151 |
| c8 | — | 2 | 0.01613 |
| c9 | 3 | — | 0.01587 |
Chunks that both searches like rise to the top, and the method only needs ranks, so you don't have to make two very different score scales comparable.
How to spot it: questions containing codes, names or identifiers fail far more often than descriptive questions.
3. No reranking of the top results
Vector search gives you the top-k chunks by raw similarity, and raw similarity is a rough sort. The most relevant passage might be your 8th result — and if you only pass the top 3 to the model, it never sees it. A reranking step fixes this: retrieve a generous set (say the top 20), run a slower, more accurate model over just those to reorder them, and pass the true top few to the LLM. A chunk at rank 8 is outside a top-3 cut but inside a top-20 pool, which is the whole point of retrieving wide and passing narrow.
How to spot it: in your test set, the right chunk is in the top 20 but not in the handful you pass on.
4. The context doesn't fit — or gets buried
Here's a failure that looks like a model problem and is really arithmetic. Suppose (illustrative numbers) you retrieve 20 chunks of about 450 tokens each — 9,000 tokens — and add a 1,200-token system prompt, an 80-token question, and 1,500 tokens reserved for the answer. That's 11,780 tokens against an 8,000-token window, 3,780 over. Only 11 chunks actually fit, and depending on the framework, the rest may be silently cut off. If your best chunk was 14th, it's gone.
Fitting isn't the end of it. In Liu et al., "Lost in the Middle" (arXiv 2307.03172), performance was often highest when relevant information came at the beginning or end of the context and "significantly degrades" when models had to use information in the middle of long contexts. So put the best chunks where they're most likely to be used, and pass fewer, better chunks rather than padding the window.
How to spot it: count the tokens actually sent with a token counter, and check whether the answer chunk survived.
5. The answer isn't grounded
The last failure happens after retrieval works. The right chunks are in the context window, and the model still answers from its own training instead of the documents, or blends the two and states something the sources don't support. This is a grounding and prompting problem: the instruction should tell the model to answer only from the provided context, say it doesn't know when the context doesn't cover it, and cite which chunk it used. Citations also make the failure checkable — if the cited chunk doesn't say what the answer claims, you've caught it. This failure is the hardest to notice, because the answer looks well-sourced while being wrong.
How to spot it: the right chunk was in the context, and the answer still contradicts it.
Diagnose the path, not just the chunks
When RAG underperforms, resist the reflex to re-tune chunk size again. Confirm the chunks themselves are coherent in a RAG text chunker, then walk down the path with your test set: was it retrieved, was it ranked high enough, did it fit, was it used? A token counter catches budget failures, a system prompt linter can help tidy the grounding instructions, and a prompt diff shows exactly what changed between prompt versions so you can tell which edit improved the answers. Chunk size is the first knob. Once it's right, the interesting failures are everywhere else in the pipeline.
← All articles