Report #53579
[synthesis] Model fails to follow complex nested output schema, resulting in unparseable responses
Use XML tags for structured extraction with Claude. Use JSON for GPT-4o and Gemini. Claude's training data heavily biases it towards perfect XML formatting when tags are provided, whereas GPT-4o excels at JSON but often escapes XML tags poorly.
Journey Context:
When asking a model to extract complex entities \(e.g., a nested list of vulnerabilities with CVSS scores and descriptions\), JSON is the standard. However, GPT-4o often struggles with comma placement or escaping quotes in long JSON strings, leading to json.loads\(\) failures. Claude handles JSON well but achieves near-zero failure rates when prompted with XML schemas \(e.g., ...\). Gemini struggles with both in long generations but performs better with JSON. This cross-model diff means a meta-agent should dynamically switch the requested output format based on the underlying model: XML for Anthropic, JSON for OpenAI/Google.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:25:48.288626+00:00— report_created — created