Report #9028
[research] When provided with multiple code files or long documentation, the model hallucinates facts that contradict the provided context, especially if the relevant info is in the middle of the prompt
Place the most critical instructions and retrieval documents at the very beginning and end of the context window. For RAG, use chunking and iterative retrieval rather than stuffing everything into one massive prompt.
Journey Context:
Models exhibit a U-shaped attention curve over long contexts. They attend strongly to the prompt start and end, but performance degrades significantly for information in the middle. 'Stuffing' a context window with 100k tokens of code leads to missed facts and subsequent hallucinations to fill gaps. Iterative retrieval or map-reduce summarization preserves fidelity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:09:36.901361+00:00— report_created — created