Lookahead-then-Verify: Reliable Constrained Decoding for Diffusion LLMs under Context-Free Grammars
Not on the map. Why?
Abstract (arXiv)
Diffusion Large Language Models (dLLMs) have demonstrated promising generative capabilities and are increasingly used to produce formal languages defined by context-free grammars, such as source code and chemical expressions. However, as probabilistic models, they still struggle to generate syntactically valid outputs reliably. A natural and promising direction to address this issue is to adapt constrained decoding techniques to enforce grammatical correctness during generation. However, applying these techniques faces two primary obstacles. On the one hand, the non-autoregressive nature of dLLMs renders most existing constrained decoding approaches inapplicable. On the other hand, current approaches specifically designed for dLLMs may allow intermediate outputs that are impossible to complete into valid sentences, which significantly limits their reliability in practice. To address these challenges, we present LAVE, a constrained decoding approach specifically designed for dLLMs. Our approach leverages a key property of dLLMs, namely their ability to predict token distributions for all positions in parallel during each forward pass. Whenever a new token is proposed by model, LAVE performs lookahead using these distributions to efficiently and reliably verify the validity of the proposed token. This design ensures reliable constraints by reliably preserving the potential for intermediate outputs to be extended into valid sentences. Extensive experiments across four widely used dLLMs and three representative benchmarks demonstrate that LAVE consistently outperforms existing baselines and achieves substantial improvements in syntactic correctness, while incurring negligible runtime overhead.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Builds on 46 of its 64 references that are in the map. First posted on arXiv 31 Jan 2026.
Builds on
46 of 64 references.
References · 46
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2023SGLang: Efficient Execution of Structured Language Model Programscited by 1,107
- 2024Simple and Effective Masked Diffusion Language Modelscited by 800
- 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
- 2025LLaDA 1.5: Variance-Reduced Preference Optimization for Large Language Diffusion Modelscited by 273
- 2024Scaling Diffusion Language Models via Adaptation from Autoregressive Modelscited by 268
- 2025Mercury: Ultra-Fast Language Models Based on Diffusioncited by 225
- 2025AgentSpec: Customizable Runtime Enforcement for Safe and Reliable LLM Agentscited by 196
- 2023Grammar-Constrained Decoding for Structured NLP Tasks without Finetuningcited by 186
34 more
- 2025DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generationcited by 184
- 2025Seed Diffusion: A Large-Scale Diffusion Language Model with High-Speed Inferencecited by 173
- 2025dLLM-Cache: Accelerating Diffusion Large Language Models with Adaptive Cachingcited by 168
- 2025LLaDA2.0: Scaling Up Diffusion Language Models to 100Bcited by 154
- 2025LLaDA-V: Large Language Diffusion Models with Visual Instruction Tuningcited by 145
- 2025Diffusion LLMs Can Do Faster-Than-AR Inference via Discrete Diffusion Forcingcited by 111
- 2024Guiding LLMs The Right Way: Fast, Non-Invasive Constrained Generationcited by 99
- 2022Learning to Break the Loop: Analyzing and Mitigating Repetitions for Neural Text Generationcited by 90
- 2020A Theoretical Analysis of the Repetition Problem in Text Generationcited by 83
- 2025Dream-Coder 7B: An Open Diffusion Language Model for Codecited by 81
- 2025FlashDLM: Accelerating Diffusion Language Model Inference via Efficient KV Caching and Guided Diffusioncited by 77
- 2024SynCode: LLM Generation with Grammar Augmentationcited by 66
- 2025Sparse-dLLM: Accelerating Diffusion LLMs with Dynamic Cache Evictioncited by 64
- 2025Syntactic and Semantic Control of Large Language Models via Sequential Monte Carlocited by 45
- 2025Flexible and Efficient Grammar-Constrained Decodingcited by 42
- 2023Repetition In Repetition Out: Towards Understanding Neural Text Degeneration from the Data Perspectivecited by 39
- 2025WeDLM: Reconciling Diffusion Language Models with Standard Causal Attention for Fast Inferencecited by 38
- 2024Constrained Decoding for Secure Code Generationcited by 35
- 2025Attention Is All You Need for KV Cache in Diffusion LLMscited by 32
- 2024IterGen: Iterative Semantic-aware Structured LLM Generation with Backtrackingcited by 28
- 2025Free Draft-and-Verification: Toward Lossless Parallel Decoding for Diffusion Large Language Modelscited by 19
- 2025DINGO: Constrained Inference for Diffusion LLMscited by 15
- 2025Constrained Decoding of Diffusion LLMs with Context-Free Grammarscited by 13
- 2025Pre3: Enabling Deterministic Pushdown Automata for Faster Structured LLM Generationcited by 11
- 2025TreeDiff: AST-Guided Code Generation with Diffusion LLMscited by 11
- 2025DEER: Draft with Diffusion, Verify with Autoregressive Modelscited by 9
- 2022CodePAD: Sequence-based Code Generation with Pushdown Automatoncited by 7
- 2024Using Grammar Masking to Ensure Syntactic Validity in LLM-based Modeling Taskscited by 6
- 2024Constrained Decoding with Speculative Lookaheadscited by 6
- 2025Rethinking Repetition Problems of LLMs in Code Generationcited by 6
- 2024FANTAstic SEquences and Where to Find Them: Faithful and Efficient API Call Generation through State-tracked Constrained Decoding and Rerankingcited by 5
- 2022On the Intersection of Context-Free and Regular Languagescited by 3
- 2025Earley-Driven Dynamic Pruning for Efficient Structured Decodingcited by 3
- 2025Constrained Adaptive Rejection Samplingcited by 3
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026To See is Not to Master: Teaching LLMs to Use Private Libraries for Code Generationcited by 3
- 2026Constrained Decoding for Diffusion Language Models via Efficient Inference over Finite Automatacited by 3
- 2026EPIC: Efficient and Parallel Inference under CFG Constraints for Diffusion Language Modelscited by 1
- 2026Grammar-Constrained Decoding Can Jailbreak LLMs into Generating Malicious Codecited by 0
- 2026CanvasAnneal: Curriculum Reinforcement Learning for Diffusion Language Modelscited by 0
- 2026Constraints Are Graphs, Not Chains: Exact Decoding for Diffusion Language Modelscited by 0
- 2026Constraints Are Graphs, Not Chains: Exact Decoding for Diffusion Language Models26 Sep 2026
- 2026CanvasAnneal: Curriculum Reinforcement Learning for Diffusion Language Models11 Sep 2026
- 2026Constrained Decoding for Diffusion Language Models via Efficient Inference over Finite Automata8 Jul 2026
- 2026Grammar-Constrained Decoding Can Jailbreak LLMs into Generating Malicious Code10 Jun 2026
- 2026EPIC: Efficient and Parallel Inference under CFG Constraints for Diffusion Language Models30 May 2026
- 2026To See is Not to Master: Teaching LLMs to Use Private Libraries for Code Generation16 Mar 2026