Report #7390
[research] LLM ignores relevant factual information placed in the middle of a long RAG context window, leading to hallucinations despite the answer being present in the prompt
Restructure RAG contexts to place the most critical factual evidence at the very beginning and very end of the prompt. Alternatively, force the model to output a summary of the retrieved context before generating the final answer.
Journey Context:
Agents often stuff the prompt with retrieved chunks assuming the LLM attends uniformly. However, LLMs exhibit distinct U-shaped attention curves for long contexts. If a crucial fact is buried in chunk 5 of 10, the model may hallucinate an answer based on its parametric memory rather than the ignored chunk. Liu et al. \(2023\) quantified this lost-in-the-middle phenomenon. Repositioning or extracting ensures high attention weights on the grounding data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:38:55.254576+00:00— report_created — created