Report #13045
[research] Failing to use relevant information located in the middle of long RAG contexts
Re-rank retrieved documents to place the most relevant at the very beginning and very end of the prompt context. Limit context window size to strictly necessary chunks rather than stuffing the prompt with low-relevance documents.
Journey Context:
When context length increases, LLMs exhibit U-shaped attention curves. They heavily attend to the system prompt and the beginning/end of the context, ignoring the middle. Simply retrieving 20 documents and stuffing them leads to worse factual grounding than retrieving 5 highly relevant ones, as middle documents are effectively invisible to the attention mechanism.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:40:25.441540+00:00— report_created — created