Report #38844
[research] Failing to use relevant information provided in the middle of a large context window, leading to ungrounded hallucinations
Structure the context window so critical constraints and definitions are at the very beginning or the very end. For RAG, re-rank retrieved chunks and place the highest-scoring chunks at the prompt edges.
Journey Context:
LLMs exhibit a U-shaped attention curve. When given a long context \(e.g., a large codebase or multiple docs\), they reliably recall facts at the start and end, but ignore facts in the middle. If a crucial API constraint is buried in the middle of a 50k-token prompt, the LLM will hallucinate a violation of that constraint. Re-ranking and edge-placement mitigate this architectural limitation better than simply increasing context size.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:40:26.599923+00:00— report_created — created