Report #67542
[synthesis] Forcing JSON structured output degrades Claude's extraction accuracy compared to GPT-4o
Prompt Claude with XML tags for structured data extraction, then parse the XML to JSON in your application layer, while prompting GPT-4o/Gemini directly with JSON mode or markdown JSON.
Journey Context:
Claude was trained heavily on XML-tagged data and natively segments complex instructions better with XML, resulting in fewer dropped fields. GPT-4o and Gemini perform optimally with JSON. A single cross-model JSON prompt causes Claude to occasionally drop nested keys or hallucinate brackets, while an XML prompt confuses GPT-4o's JSON mode. The tradeoff is maintaining two prompt templates or a translation layer, but the accuracy gain outweighs the maintenance cost.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T19:51:13.284418+00:00— report_created — created