Report #91171
[synthesis] Structural Bias: XML vs. Markdown for System Prompt Adherence
Use XML tags for structural boundaries in system prompts and outputs for Claude. Use Markdown headers or JSON code blocks for GPT-4o and Gemini. If you must use a single prompt, enforce JSON mode rather than relying on free-text formatting.
Journey Context:
A common anti-pattern is writing one massive Markdown-based system prompt and expecting uniform structural compliance. Claude 3.5 Sonnet strongly prefers and adheres better to XML tags due to its RLHF data distribution, often ignoring Markdown hierarchy. GPT-4o handles Markdown well but can struggle with deeply nested XML, sometimes treating it as raw text. Gemini aligns with GPT-4o but is even worse at XML extraction. Aligning the prompt format to the model's native attention patterns drastically reduces structural parsing failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:37:31.233689+00:00— report_created — created