Report #42735
[research] Agent ignores retrieved context placed in the middle of the prompt and hallucinates using parametric memory
Position the most critical retrieved documents at the very beginning and end of the context window. If an agent must extract specific facts, force it to quote the relevant snippet from the context before synthesizing the answer.
Journey Context:
It is commonly assumed that providing a model with 10 retrieved documents via RAG guarantees it will use them. However, LLMs exhibit a strong 'lost in the middle' U-shaped attention curve; they attend heavily to the beginning and end of the context, but ignore middle context, falling back on pre-trained weights \(which may be outdated or wrong\). Restructuring context is computationally free and significantly boosts grounding.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:11:56.813813+00:00— report_created — created