Structured Decoding — AI Glossary

Structured decoding is an inference-time technique that constrains the model's output to conform to a grammar, regular expression, or JSON schema by masking invalid tokens at each generation step. Because the constraint is enforced during sampling rather than hoped for via prompt instructions, the output is syntactically valid by construction — no parsing retries, no regex cleanup, no hallucinated fields.