IndexMapAbout
ConceptLLM

Structured Outputs & Constrained Decoding

Also known as: Structured Outputs · Constrained Decoding · JSON Schema Mode · XGrammar · Outlines

Plain English

Forcing an LLM to reply in an exact format like valid JSON, SQL, or a typed schema so downstream code never crashes on malformed model output.

Technical Overview

Constrained decoding compiles a regular expression, JSON Schema, or Context-Free Grammar (CFG) into a finite-state machine or pushdown automaton and masks invalid token logits at every decoding step. Libraries like Outlines and XGrammar—alongside native API strict: true modes—achieve near-zero latency overhead inside vLLM, SGLang, and TensorRT-LLM.

Timeline (3)

RSS

2023

  1. Paper

    Willard and Louf published Efficient Guided Generation for Large Language Models (Outlines), recasting regex- and grammar-constrained decoding as finite-state machine transitions over pre-indexed vocabulary masks—turning O(V) per-step regex checks into O(1) lookups.

2024

See also (bkz.) (7)

Open full graph
2 more connections