Report #45250
[research] LLM ignores relevant retrieved documents placed in the middle of the context window
Reorder retrieved RAG chunks so that the highest-relevance documents are placed at the very beginning and very end of the context prompt, and aggressively filter out low-relevance chunks to minimize context length.
Journey Context:
Agents often stuff all top-k retrieved chunks into the prompt sequentially. Research demonstrates LLMs exhibit a U-shaped attention curve—they attend heavily to the start and end of the context but suffer severe performance degradation for information in the middle. Simply reordering the context layout yields immediate factuality gains without retraining the model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:25:22.405810+00:00— report_created — created