This note distinguishes server-side constrained decoding from prompt-only formatting. In constrained decoding, the inference server masks invalid next tokens while generating; it does not merely ask the model to follow a format and parse the finished text.
| Interface | Expressive power | Typical use |
|---|---|---|
| JSON Schema | Structured JSON objects and arrays | API responses, function arguments |
| Regex | Regular languages | IDs, dates, fixed records |