Here's a result that surprises most teams: giving a model more context can make it hallucinate more.
In Google Research's work on "sufficient context", Gemma answered incorrectly 10.2% of the time with no context at all. When it was given context that was related to the question but didn't actually contain the answer, the wrong-answer rate jumped to 66.1%. The retrieved text didn't make the model careful. It made it confident.
That's the core problem with how we talk about "RAG hallucination". It's treated as one bug with one fix: better prompt, bigger model, more chunks. In practice it's at least five distinct failures, split across two layers: retrieval (did the right text reach the model?) and generation (did the model stay faithful to it?). If you don't know which one you have, you'll spend a week tuning prompts when the real problem is recall.
Here are the five, how to spot each one, and what to change.
Start here: diagnose before you fix
Before touching anything, take 30 to 50 real questions where you know the correct answer and the document it lives in. For each failure, ask two questions:
- Was the correct passage in the retrieved chunks?
- If yes, did the answer stick to it?
That gives you a quick triage table:
| Symptom | Likely cause | Metric that confirms it |
|---|---|---|
| Right passage never retrieved | #1 Retrieval miss | Context recall, recall@k |
| Retrieved text is on-topic but lacks the answer | #2 Insufficient context | Sufficiency label (LLM judge) |
| Right passage retrieved, answer still wrong | #3 Lost in the context | Faithfulness + passage position |
| Answer matches an outdated document | #4 Conflicting sources | Doc version / date of cited chunk |
| Answer includes facts found in no chunk | #5 Parametric override | Faithfulness, citation coverage |
Tools like Ragas give you context precision, context recall and faithfulness out of the box. The point isn't the tool. The point is scoring retrieval and generation separately.
1. The retriever never found the answer
Usually the first place to look, and the least glamorous. The model can't be faithful to a passage it never saw.
Typical reasons: a chunk boundary split the fact in half, the chunk lost its context ("the limit is 30 days", but limit of what?), or the query uses an exact term (a product code, an error string, a clause number) that dense embeddings blur.
Fix: combine lexical and semantic search, give chunks their context back, then rerank.
Anthropic's Contextual Retrieval experiments are the clearest public numbers here. Measuring top-20 retrieval failure rate:
- Contextual embeddings alone: 5.7% → 3.7% (35% fewer failures)
- Plus contextual BM25: 5.7% → 2.9% (49% fewer)
- Plus a reranker: 5.7% → 1.9% (67% fewer)
"Contextual" means prepending a short, generated description of where the chunk sits in its document before you embed and index it. A minimal hybrid merge with reciprocal rank fusion looks like this:
def rrf_merge(bm25_ids, dense_ids, k=60, top_n=20):
scores = {}
for ranked in (bm25_ids, dense_ids):
for rank, doc_id in enumerate(ranked):
scores[doc_id] = scores.get(doc_id, 0) + 1 / (k + rank + 1)
return sorted(scores, key=scores.get, reverse=True)[:top_n]
RRF merges by rank, not raw score, so you don't have to normalise BM25 scores against cosine similarity. Feed the merged top 20 into a reranker and keep the best few.
2. The context is related, but it doesn't contain the answer
This is the failure from the opening. Retrieval "worked" in the sense that it returned on-topic text. But on-topic isn't the same as sufficient. The model sees a policy document about refunds, the question is about refunds for a specific edge case the document doesn't cover, and it fills the gap with something plausible.
Google's paper frames this as sufficient context: does the retrieved text contain enough to answer the question? They found an LLM rater could make that call with at least 93% agreement with human labels, and that using the sufficiency signal to decide when to answer improved accuracy on answered questions by up to 10%.
Fix: add an explicit sufficiency check and give the model a real way to abstain.
You will be given a QUESTION and CONTEXT.
Decide if the CONTEXT alone contains enough information to fully answer the QUESTION.
Reply with exactly one word: SUFFICIENT or INSUFFICIENT.
Do not use outside knowledge.
If the answer is INSUFFICIENT, don't generate. Retrieve again with a rewritten query, ask a clarifying question, or return "I couldn't find this in the documents". In customer-facing systems, a clean "I don't know" is almost always cheaper than a confident wrong answer.
3. The answer was retrieved, then lost in the context
The passage is there. The model still misses it.
Liu et al.'s "Lost in the Middle" paper showed a U-shaped curve: models use information best when it sits at the start or end of the context, and noticeably worse when it's buried in the middle, even for models built for long context. Chroma's 2025 "Context Rot" study, across 18 models, found performance degrades as input length grows, and that adding even a single distractor (text that looks relevant but isn't) lowers accuracy, with four distractors lowering it further.
So the instinct to "just send 50 chunks, the window is huge" works against you. Every extra near-miss chunk is a distractor.
Fix: retrieve wide, pass narrow.
- Retrieve 20 to 50 candidates, rerank, pass the top 3 to 8.
- Put the highest-scoring chunks at the start and end of the context block, not the middle.
- Drop near-duplicate chunks before generation. Two copies of the same paragraph don't add evidence, they add noise.
4. Your sources disagree with each other
The retriever returns the 2023 pricing page next to the 2025 one. Both are relevant. Both score well. The model picks one, or blends them into an answer that matches neither.
This doesn't show up as "hallucination" in a dashboard, because the answer is grounded in a retrieved chunk. It's just grounded in the wrong one.
Fix: treat freshness and authority as metadata, not as something the embedding will figure out.
- Store
version,effective_date,status(active / superseded) andsourceon every chunk. - Filter superseded documents at query time instead of hoping the reranker demotes them.
- When two active sources conflict, surface both with dates rather than letting the model silently choose.
- Deduplicate at ingestion. If a document is replaced, retire the old chunks.
5. The prompt lets the model fall back on what it already "knows"
The model has its own training data. If the prompt doesn't force it to stay inside the context, it will mix retrieved facts with remembered ones, and the remembered ones may be outdated or simply wrong for your domain.
Fix: require evidence for every claim, then check it.
Answer using ONLY the numbered CONTEXT passages.
After every sentence, cite the passage it came from, like [2].
If a sentence cannot be supported by a passage, do not write it.
If the passages do not answer the question, say so.
Then verify after generation: split the answer into claims, and for each claim check whether the cited passage actually supports it. An LLM judge works for this, and it's exactly what faithfulness metrics measure. Unsupported claims either get removed or trigger a regeneration. Citations without verification are decoration. Citations with verification are a guardrail.
The order that saves you the most time
- Measure. Build the small labelled set and score retrieval and generation separately.
- Fix retrieval first. Hybrid search, contextual chunks, reranking. Nothing downstream can recover a passage that was never retrieved.
- Cut the context. Fewer, better chunks, strongest at the edges.
- Clean the corpus. Versions, filters, dedup.
- Constrain and verify generation. Sufficiency check, citations, claim verification.
It's tempting to start at step 5 because the prompt is the easiest thing to edit. Hold off until steps 1 to 4 check out.
RAG doesn't hallucinate. Specific parts of your pipeline do. Find which one, and the fix is usually boring, and that's a good sign.
Sources
- Joren et al., "Sufficient Context: A New Lens on Retrieval Augmented Generation Systems", ICLR 2025. https://arxiv.org/abs/2411.06037
- Google Research, "Deeper insights into retrieval augmented generation: The role of sufficient context". https://research.google/blog/deeper-insights-into-retrieval-augmented-generation-the-role-of-sufficient-context/
- Anthropic, "Introducing Contextual Retrieval". https://www.anthropic.com/news/contextual-retrieval
- Liu et al., "Lost in the Middle: How Language Models Use Long Contexts", TACL. https://arxiv.org/abs/2307.03172
- Chroma Research, "Context Rot: How Increasing Input Tokens Impacts LLM Performance" (July 2025). https://www.trychroma.com/research/context-rot
- Ragas documentation, available metrics. https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/