Skip to main content
QUICK REVIEW

[Paper Review] Lookahead-then-Verify: Reliable Constrained Decoding for Diffusion LLMs under Context-Free Grammars

Yitong Zhang, Yongmin Li|arXiv (Cornell University)|Jan 31, 2026
Natural Language Processing TechniquesComputer Science0 citations
TL;DR

LAVE is a constrained decoding approach for diffusion LLMs that uses lookahead on parallel token predictions to verify CFG constraints, achieving near-100% syntactic correctness with negligible runtime cost across multiple models and benchmarks.

ABSTRACT

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.

Motivation & Objective

  • Identify reliability gaps in CFG-constrained decoding for diffusion LLMs (dLLMs).
  • Develop a constrained decoding method tailored to the non-autoregressive generation of dLLMs.
  • Ensure intermediate outputs remain extendable to valid sentences under CFGs.
  • Demonstrate that the proposed method improves syntactic and functional accuracy across diverse grammars.
  • Evaluate runtime overhead and robustness of the approach across multiple models and benchmarks.

Proposed method

  • Leverage the parallel token predictions of dLLMs to perform lookahead by sampling complete prefixes for the current incomplete output.
  • Use a grammar parser to verify if any lookahead complete prefix can be extended to a valid sentence (IsExtendable).
  • Accept a proposed token only if at least one sampled complete prefix is extendable; otherwise reject and resample.
  • Maintain a cache (y_cache) of verified prefixes to guide recovery when stuck during decoding.
  • Introduce a lightweight cache-enhanced recovery that replaces the current context with a verifiable prefix and, if needed, restricts the next-token distribution to admissible tokens.
  • Provide implementation details with parameters: lookahead size N and attempt budget τ, and use Earley parsing for CFG validation.

Experimental results

Research questions

  • RQ1RQ1: How well does LAVE ensure syntactic correctness of dLLM outputs versus baselines?
  • RQ2RQ2: How much does LAVE improve functional correctness of dLLM outputs?
  • RQ3RQ3: What runtime overhead does LAVE introduce?
  • RQ4RQ4: How does each component of LAVE contribute to overall performance?
  • RQ5RQ5: How do hyperparameters affect LAVE performance?

Key findings

  • LAVE consistently outperforms baselines in syntactic correctness across four dLLMs and three CFG-based benchmarks.
  • Syntactic correctness improves to nearly 100% in many settings, with substantial gains over prior constrained decoding methods.
  • Functional correctness also improves in many scenarios, often exceeding gains of alternative approaches.
  • Runtime overhead of LAVE is reported as negligible.
  • Ablation studies show each component positively contributes to performance and LAVE is robust to hyperparameter variations.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.