AI engineering glossary · Prompt context engineering
What is schema-constrained generation?
Schema-constrained generation (also called Structured Outputs): Producing model output that is forced to obey a supplied schema, such as a JSON Schema listing required fields, types and allowed values. Enforcement usually happens during decoding, so invalid tokens cannot be chosen, giving reliable parsing.
Schema-constrained generation: an example
Provide a schema where 'status' must be one of 'paid', 'pending' or 'failed'; the model cannot output any other value.
Related terms
More Prompt context engineering terms
- Scratchpad
- Seed parameter
- Self-ask
- Self-consistency
- Self-refine
- Skeleton-of-Thought
- Sliding window history
- Stateless API
Where you learn it
Schema-constrained generation is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.