Glossary/Inference & ServingValidation and repairGenerating freely, then validating the output against a schema and retrying with the error fed back.By Kunj Shah·Entry last reviewed2026-09·methodWhat it impliesWeaker than constrained decoding but far more ergonomic, and it handles messy extraction that token masking handles awkwardly. It gives a typed retry rather than a guarantee. If you cannot decide between the two, start here.Tools in this indexInstructorRelated termsConstrained decodingMasking the token space during generation so the output can only be a valid instance of a schema, grammar or regex.