Report #10373
[research] RAG system fails to use relevant documents placed in the middle of the context window
Reorder retrieved context chunks so the highest-relevance chunks are at the very beginning and very end of the prompt context. Never place critical evidence in the middle of a long prompt.
Journey Context:
Agents often concatenate retrieved documents sequentially by relevance score. However, transformer attention mechanisms exhibit a strong U-shaped attention pattern. If the gold answer is in chunk 5 of 10, the model will likely ignore it and hallucinate an answer based on chunk 1 or 10, or its parametric memory. Reordering is a zero-cost accuracy improvement that aligns context layout with attention mechanics.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:37:16.539585+00:00— report_created — created