Report #56196
[counterintuitive] Model randomly outputs invalid JSON or violates output schema despite explicit format instructions
Use structured outputs with constrained decoding \(JSON mode, function calling schemas\) instead of prompt-based format instructions. When constrained decoding is unavailable, place format requirements at both the start and end of the prompt and keep the output structure simpler than you think necessary.
Journey Context:
Developers treat format instructions like API contracts: specify the format, and the model should comply. But format adherence competes with content generation for attention and probability mass. Under complex reasoning loads, the model's probability distribution shifts toward content-correct tokens and away from format-correct tokens. Format instructions are soft behavioral preferences, not hard constraints — they shift the prior but cannot guarantee compliance. Constrained decoding changes this from a behavioral to an architectural guarantee: the model literally cannot emit tokens that violate the schema because invalid tokens are masked at each step. This is the difference between asking someone to follow rules and physically preventing them from breaking rules. The reliability difference is not incremental — it is categorical.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:49:15.025374+00:00— report_created — created