Report #9695
[research] RAG system fails to extract the answer even when it is present in the retrieved context
Re-rank retrieved documents to place the most relevant at the very beginning and very end of the context window, or use short-context iterative retrieval rather than stuffing everything into one long prompt.
Journey Context:
Developers assume providing more context is strictly better. However, LLMs exhibit a U-shaped attention curve; they attend heavily to the start and end of the prompt but ignore the middle. If a crucial fact lands in the middle of a 10k-token context, the model will hallucinate an answer from its parametric weights instead of using the context. Reranking mitigates this positional bias.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:49:19.977351+00:00— report_created — created