Report #62504
[research] LLM ignores retrieved factual context placed in the middle of the prompt
Place the most critical retrieved documents at the very beginning and very end of the context window. Do not rely on linear document insertion.
Journey Context:
Agents often concatenate RAG results sequentially. However, transformer attention mechanisms exhibit a strong positional bias \(U-shaped curve\) where start and end tokens receive the most attention. If the only document containing the factual answer is in the middle, the model will default to parametric memory \(hallucination\) rather than the provided context. Reordering retrieved context is a zero-cost inference optimization that significantly recovers retrieval accuracy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:23:56.932945+00:00— report_created — created