DConstrain: Compiling Context-Parameterized Transitions for Diffusion Language Model Constrained Decoding
Shidong Cao, Jing Ma, Wenhao Chai, Yuchen Tian, Lun Du, Da Zheng
Key points
From the paper's conclusion- The study presents DConstrain, a method that compiles schemas into context-parameterized transition programs for diffusion language model constrained decoding.
- DConstrain compiles 100% of BFCL schemas under arbitrary property orders, whereas an optimized finite-state baseline compiles only 71.30-85.81%. It reduces BFCL end-to-end decoding latency by 6.65-46.26 times with 100% schema validity and raises DiffusionGemma's BFCL accuracy from 37.27% under fixed order to 81.56%.
- DConstrain enables efficient and valid constrained decoding for diffusion language models across various schemas and property orders.
Abstract
Diffusion language models (DLMs) decode multiple tokens in parallel, so individually valid tokens can be incompatible together under a schema. Exact joint inference over a grammar graph enforces compatibility, but it requires token-labeled successors across many hypothetical parser configurations. Encoding stacks and field histories in compiled states can cause exponential growth, which forces prior exact decoders to fix property orders and exclude valid outputs. We present DConstrain, which compiles schemas into context-parameterized transition programs. Cold compilation specializes token consumption to local grammar states while retaining context-dependent stack operations, environment guards, and caller-dependent deferred parsing symbolically. Tracking field histories as runtime values supports arbitrary property order without enumerating field subsets offline. At runtime, warm compilation binds reached configurations to these programs to construct exact successors, overlapping with the model forward pass because graph construction requires no model scores. Furthermore, token-effect grouping merges tokens with identical compiled effects before runtime contexts are bound, so groups are reused across stacks and environments even when concrete successors differ. Objective-specific score aggregation and token restoration provably preserve both the Viterbi optimum and the token-labeled path distribution of ungrouped inference. Across three benchmarks and two DLM families, DConstrain compiles 100% of BFCL schemas under arbitrary property orders, whereas an optimized finite-state baseline compiles only 71.30-85.81%. Under arbitrary property order, it reduces BFCL end-to-end decoding latency by 6.65-46.26 times with 100% schema validity and raises DiffusionGemma's BFCL accuracy from 37.27% under fixed order to 81.56%.
Read the paper
Discussion · 1
Science Skim's AI key points, plus readers' public thoughts
- The study presents DConstrain, a method that compiles schemas into context-parameterized transition programs for diffusion language model constrained decoding.
- DConstrain compiles 100% of BFCL schemas under arbitrary property orders, whereas an optimized finite-state baseline compiles only 71.30-85.81%. It reduces BFCL end-to-end decoding latency by 6.65-46.26 times with 100% schema validity and raises DiffusionGemma's BFCL accuracy from 37.27% under fixed order to 81.56%.
- DConstrain enables efficient and valid constrained decoding for diffusion language models across various schemas and property orders.
Readers' thoughts
No reader thoughts yet.
Related papers
- From Grammar Deltas to Token Masks: Incremental Constrained Decoding under Runtime Grammar EvolutionarXiv · 2026
- Learning to Couple: Context-Adaptive Joint Denoising for Diffusion Language ModelsarXiv · 2026
- Breaking the Space Barrier and its Application to Language Model InferencearXiv · 2026
- Lookahead-Then-Verify: Reliable Constrained Decoding for Diffusion LLMs under Context-Free GrammarsProceedings of the ACM on Software Engineering · 2026
- Efficient Grammar-Constrained Decoding via Parser Stack ClassificationProceedings of the ACM on Software Engineering · 2026
- dLoop: Looped Diffusion Language Models via Recurrent Latent RefinementarXiv · 2026