Zenaique
Glossary · Production

Structured Output

Also known as: JSON mode, Constrained decoding

Force the model's output to match a schema: JSON, regex, or a context-free grammar.

Constraining an LLM to produce output that conforms to a specific schema (JSON, regex, grammar). Implemented via prompt-and-pray, retry loops, or constrained decoding that masks invalid tokens at sample time.

In practice

Foundational for any LLM-as-API integration. Expect questions on outlines/llguidance, OpenAI JSON mode, and failure modes.

How it compares

Function calling is a specific case of structured output (schema = tool signature); structured output is the general idea.

Related topics

Related terms