Forcing structured output without breaking the model

JSON mode and schema constraints look like a free win until they aren’t. The first time the model produces valid JSON for a complicated nested schema, the temptation is to push everything through structured output. The second time it produces structurally valid but semantically empty fields, you start to see the trade-off.

Why constraints sometimes hurt

Forcing the model into a tight schema cuts off its room to reason. If your schema demands a single-paragraph summary and a binary classification, the model is going to commit to the classification before it has finished thinking about the summary. The order of fields matters. The required-vs-optional split matters. Required arrays of length 0 are the most common silent failure — the model satisfies the schema by giving you nothing.

Patterns that keep both

Two passes are simpler than they sound: a free-form reasoning pass, then a constrained-extraction pass that turns reasoning into JSON. You spend two model calls but stop fighting the model into a single one. For simpler tasks, ordered fields — reasoning first, decision last — do most of the work that two passes would.

The schema you ship is rarely the schema you sketched at the start.

Related Posts

Tool use patterns that survive context decay

Tool use looks easy in a one-shot example and hard once the conversation grows past a few thousand t ...

Self-consistency sampling: cheap reliability when you need the right answer

Self-consistency sampling sounds like the kind of thing a researcher proposes and a production engin ...