Report #92047
[cost\_intel] Why does my cheap model generate invalid JSON on complex schemas?
Use GPT-4o or Claude 3.5 Sonnet for JSON schemas with nesting deeper than 3 levels or arrays exceeding 50 items. GPT-4o-mini and Claude 3 Haiku exhibit 5-15% malformed JSON rates on complex schemas versus less than 1% for larger models, making retry loops more expensive than using the bigger model once.
Journey Context:
Small models struggle with strict output formats when content complexity increases. The 'cheap model \+ JSON repair prompt' pattern often requires 2-3 calls to fix syntax errors, eliminating the cost advantage. Structured Outputs \(OpenAI\) and Tool Use \(Anthropic\) improve reliability but still show higher failure rates on small models with complex nested objects. The crossover point is roughly 3\+ nested levels or long arrays.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:05:39.689959+00:00— report_created — created