Dgrammar: Efficient Constrained Decoding for DLMs

Guan-Ming Chiu, Jeng-Yue Liu


Abstract
Diffusion language models (DLMs) decode several tokens per step. However, the grammar-constrained decoders evaluated here, IG-CD and LAVE, verify candidate tokens sequentially within each denoising step and treat every violation as a rejection, a lookahead verification, or a fallback to autoregressive decoding. We observe that a violation is local to the first token the parser cannot consume, so the rest of the parallel step can be kept. We propose Dgrammar, a training-free decoder that repairs that frontier token in place under the same forward-pass logits, paired with a grammar-gated backoff schedule for the unmask batch size, asynchronous mask construction, and a bounded grammar-guided tail. On JSONSchemaBench medium with LLaDA-8B, Dgrammar improves schema validity by 8.6 percentage points over the strongest DLM baseline while reducing mean latency by 5.8x and eliminating timeouts. Validity and latency gains also hold on the other JSB splits and on Dream-7B, and experiments with a SMILES grammar demonstrate cross-grammar transfer.
Anthology ID:
2026.aacl-long.225
Volume:
Proceedings of the 15th International Joint Conference on Natural Language Processing and the 5th Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics (Volume 1: Long Papers)
Month:
November
Year:
2026
Address:
Hengqin, China
Editors:
Yue Zhang, Ruifeng Xu, Ayu Purwarianti, Tong Rong, Jun Suzuki
Venues:
AACL | IJCNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
5051–5061
Language:
URL:
https://aclanthology.org/2026.aacl-long.225/
DOI:
Bibkey:
Cite (ACL):
Guan-Ming Chiu and Jeng-Yue Liu. 2026. Dgrammar: Efficient Constrained Decoding for DLMs. In Proceedings of the 15th International Joint Conference on Natural Language Processing and the 5th Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5051–5061, Hengqin, China. Association for Computational Linguistics.
Cite (Informal):
Dgrammar: Efficient Constrained Decoding for DLMs (Chiu & Liu, AACL-IJCNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.aacl-long.225.pdf