ModelRefs / Structured Output — AI Glossary
Structured Output — AI Glossary
Constraining LLM responses to conform to a predefined JSON schema, data model, or typed format. Libraries: Instructor, Outlines, Pydantic AI, Marvin.
Overview
Structured output is the modern term for JSON mode + schema validation. Implemented via constrained decoding, OpenAI's response_format with json_schema, or Anthropic's tool use with a single forced tool. Libraries: Instructor, Outlines, Pydantic AI, Marvin.
Reference details
| Topic | prompting |
|---|---|
| Also known as | structured generation, typed output |
| Last reviewed | 2026-06-24 |
Related terms
Example: Asked for JSON vs. constrained to JSON
Ask politely for JSON and you will eventually get a fenced code block, a trailing comma, or a helpful sentence before the object — rare enough to pass review, frequent enough to page someone. Constrained decoding makes invalid tokens unreachable during generation, so the output is valid by construction rather than by luck, and your parser stops being a source of incidents.
Commonly confused with
Schema-valid is not correct. Constrained decoding guarantees shape, never truth: a response can satisfy the schema perfectly and still put the wrong value in every field. Validation checks the container, not the contents.
When to use it
Reach for it when:
- The output feeds code, a database or an API rather than a human
- You need fields present and typed so downstream logic can rely on them
- You are extracting records from unstructured text
Reach for something else when:
- The reader is a person — schemas make prose worse
- The schema is very large or deeply nested; quality degrades and latency rises
- You are treating validity as accuracy and skipping evaluation
Referenced by
This term is used by the following ModelRefs references:
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Structured Output — AI Glossary.
Frequently asked questions
What is Structured Output?
Constraining LLM responses to conform to a predefined JSON schema, data model, or typed format.
Is Structured Output the same as structured generation?
Yes — structured generation, typed output are common aliases for Structured Output.
What concepts are related to Structured Output?
Closely related concepts include json mode, function calling, output parser.