Report #72021
[synthesis] Model fails to output valid JSON or XML when requested due to native format preferences
Use Claude with XML tags for structured extraction/prompting. Use GPT-4o with JSON. If you must use JSON with Claude, use the json tool or strict prefilling. If you must use XML with GPT-4o, provide a very strict few-shot example.
Journey Context:
Developers often standardize on JSON because it is the web standard. However, forcing Claude to do complex JSON extraction when it natively prefers XML leads to subtle syntax errors \(missing commas, trailing commas\). Claude is heavily trained on XML due to Anthropic's internal use. GPT-4o is highly optimized for JSON and struggles with complex XML schemas. Leveraging each model's native format strength drastically reduces parsing errors in multi-model orchestrators.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:27:55.890974+00:00— report_created — created