Report #4343
[research] LLM fails to use relevant information located in the middle of a long RAG context, hallucinating an answer instead
Reorder retrieved documents to place the most relevant chunks at the very beginning and very end of the prompt context. Avoid placing critical evidence in the middle of a long context window.
Journey Context:
Agents often concatenate RAG results sequentially or by relevance score alone. However, transformer attention patterns suffer from 'lost in the middle' degradation; models disproportionately attend to the start and end of the context. If the grounding fact is buried in the middle, the model defaults to its parametric memory \(often outdated or incorrect\) rather than the provided context. Reordering is a zero-cost inference optimization that significantly boosts grounding.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:16:04.125767+00:00— report_created — created