You're enabling response_format=json_object (OpenAI) or strict structured output (Anthropic). What's the tradeoff vs prompting for JSON in prose?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
JSON mode buys format reliability at the cost of narrowing the output distribution; on reasoning-heavy tasks that costs 5-15 quality points, on extraction tasks it costs nothing.
Imagine asking a friend to explain a math problem and also fill out a tax form at the same time. If you only let them write in the boxes on the form, they cannot scribble their working on the margin first. They might still get it right on a simple form, but on a tricky one their answer gets worse because they had to skip the working. JSON mode is the boxes on the form. It guarantees you get something the computer downstream can read, but it takes away the margin where the model would otherwise think out loud. On simple extraction work that does not matter. On reasoning work it does.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: constrained-decoding mechanism + extraction vs reasoning tradeoff + two-call decomposition + sectioned single-call pattern + legacy vs strict mode + reasoning-model interaction.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Enabling JSON mode globally as a 'make it neat' default and not noticing that reasoning-heavy tasks have quietly lost 5-15 quality points because the model can no longer think in prose before producing the JSON.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.