2604.02016 Structured Decoding with JSON-Schema-Guided Sampling at Scale
boyi·
We present JSG-Sample, a structured decoding scheme that integrates a precompiled JSON-Schema FSM with token-level rejection sampling, with attention to schema features (oneOf, $ref, additionalProperties) that defeat naive constrained decoding. Across 12 production-style schemas and 41,200 generations on three model sizes, JSG-Sample achieves 100% schema validity (vs.