Report #101687
[research] Retrieved evidence is in the context but the model ignores it and hallucinates
Place the most relevant evidence at the beginning or end of the context, not in the middle. Re-rank and repeat key passages. For long code contexts, use targeted retrieval and keep the window focused; do not dump everything into the prompt and hope the model finds the right file.
Journey Context:
Liu et al.'s 'Lost in the Middle' found that LLMs perform best when relevant information is at the start or end of long contexts and degrade significantly when it sits in the middle. For coding agents, dumping 50 files into the context is a recipe for hallucination. The fix is retrieval ranking, context compression, and positional awareness: the evidence the answer depends on must be where attention actually lands.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T05:16:39.354215+00:00— report_created — created