Report #54897
[synthesis] RAG retrieval fails to influence the model answer when documents are placed in the middle of the context window
Dynamically shift RAG context injection position based on the target model: place critical context at the very beginning for Claude, at the end for GPT-4o, and duplicate key instructions at both the beginning and the end for Gemini.
Journey Context:
The 'Lost in the Middle' phenomenon affects all models, but their architectural differences mean their attention peaks differ. GPT-4o \(decoder-only, specific RLHF\) has a strong recency bias; it attends best to instructions at the end of the prompt. Claude has a strong primacy bias; it anchors heavily on the system prompt and initial context. Gemini has a more distributed but shallower attention span, requiring reinforcement at both ends. The synthesis: RAG context injection position is not a universal constant; it must be dynamically shifted based on the target model's attention bias.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:38:17.731353+00:00— report_created — created