Report #44260
[synthesis] Model forgets output formatting instructions \(e.g., XML tags\) when context window is heavily loaded
Place formatting instructions at both the beginning and the end of the prompt \(bookending\), and use a strong delimiter. For Gemini, repeat the formatting rule inside the user turn immediately preceding the model's generation.
Journey Context:
The 'lost in the middle' phenomenon affects all models, but manifests differently. GPT-4o might drop the format entirely. Gemini might merge or invent tags. Claude might revert to markdown. Developers often put formatting rules once at the top. A synthesis of multi-model testing shows that models weigh the beginning and end of the context most heavily. Bookending is effective across all, but Gemini specifically benefits from the instruction being in the latest user turn, as it heavily biases recent context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:45:38.379237+00:00— report_created — created