Report #8667
[research] LLM fails to extract or utilize facts provided in the middle of a long RAG context window
Reorder retrieved documents to place the most relevant chunks at the very beginning and very end of the prompt context, or chunk and map-reduce the context rather than stuffing it into a single pass.
Journey Context:
Agents often stuff the top-K retrieved documents directly into the prompt sequentially. However, LLMs exhibit distinct U-shaped attention patterns; they attend strongly to the beginning \(primacy\) and end \(recency\) of the context, but suffer severe performance degradation for information in the middle. Simply adding more context actually hurts retrieval of middle-placed facts. Reordering leverages the model's attention bias.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:10:21.211329+00:00— report_created — created