- Rating
- 5
- Clarity
- 3
- Confidence
- 4
- Originality
- 3
- Quality
- 4
- Significance
- 3
Read review
Summary
This paper introduces a method for constrained decoding from (masked) diffusion language models under constraints that are representable as finite automata (e.g. regular expressions, many JSON and Python function calling schemas, etc.). For a given constraint , the method works by sampling from the product distribution between the mean-field reverse diffusion process and the constraint factor at each unmasking step . This is non-trivial because the constraint couples the tokens across the entire sequence, such that they are no longer independent.
To efficiently compute the product distribution, the method relies on the fact that the finite automaton (FA) encoding the constraint can be represented as a graphical model / HMM, s.t. that the product distribution itself can be represented as a graphical model with unnormalized factors. Since this is just a HMM, both sampling and computation of various marginals can be done tractably via variants of the forward-backward algorithm, allowing tokens to be sampled sequentially according to the constrained distribution . The authors also contribute a (to-my-knowledge) novel tree-structured sampling strategy, which recursively samples the middle token in the sequence, then the middle token in the left and right sub-sequences, and so on. This requires more FLOPS, but enables greater parallelism in both the backward and forward pass, resulting in greater GPU utilization and better scaling as the sequence length increases.
The authors demonstrate the effectiveness on their method on a large range of constrained generation tasks (e.g. function calling, Sudoku, text-to-SQL, etc.), and find that their method outperforms unconstrained decoding significantly in accuracy. Most of this improvement is driven by the failure of unconstrained decoding to reliably satisfy the constraint (even with greedy decoding). Furthermore, the authors show that constrained decoding improves the unmasking schedule by using the constrained token marginals to decide which token to unmask next. Constrained decoding also achieves much higher accuracy with fewer generation/diffusion steps, and with the tree-structured sampling approach, only incurs a +4% wall-clock time overhead relative to unconstrained sampling.
Strengths and weaknesses
Overall I think this is a solid and well-written paper that deserves to be accepted.
Quality, Originality, and Significance. The paper shows how to efficiently perform constrained decoding from masked diffusion language models with constraints representable as deterministic or non-deterministic finite automata (D/NFAs). In contrast to prior constrained decoding methods that use rejection sampling (Mündler et al, 2025) or online constrained optimization (Cardei et al, 2026), the proposed method ensures tractable inference by focusing on DFA and NFA constraints (which can represented as Hidden Markov Models (HMMs)), allowing the constrained LM distribution to tractably computed via HMM-stye a forward-backward algorithm. The method also generalizes the previous DINGO method (Banerjee et al, 2026) by allowing for constrained sampling, not just MAP decoding.
In addition, the paper contributes an insightful and novel (to my knowledge) tree-structured decoding algorithm which significantly reduces the depth of the decoding computation graph from to , where is the length of the decoded sequence. This recovers much of the parallelism enabled by diffusion language models (which is otherwise lost by sequential decoding, as in DINGO), enabling much better scaling with sequence length , and a low +4% overhead relative to unconstrained decoding. For these reasons, I believe the paper to be both an original and significant contribution.
Clarity. I think the paper is clearly written and understandable for readers who already familiar with masked diffusion language models (MDLMs) and probabilistic inference. As a reader who was less familiar with diffusion LMs, I felt the need to read the MDLM paper (Sahoo et al, 2024) to understand the setting better, but mostly everything made sense to me after I did so. In general I think the paper achieves the right balance of mathematical detail and verbal + figure-based exposition in the main text. I do still have a few questions / confusions about various aspects -- e.g. why NFA constrained inference isn't exact, and how block-wise decoding / semi-autoregressive decoding is implemented -- which I believe could be better explained in the next revision (see Questions below).
Weaknesses. The main current weakness of the paper is the lack of comparison of the proposed method to other constrained decoding baselines. It seems reasonable to me to at least implement a naive rejection sampling baseline (with some maximum sample bound), to show the overhead comparison against the proposed method. Ideally, the authors would also compare against prior work like the algorithms of Mündler et al (2025) or Cardei et al (2026). My guess is that the authors' method will substantially outperform the other methods in terms of runtime just based on how each method works, which is why I am still comfortable recommending acceptance, but it'd best to confirm this improvement empirically.
References
Suresh, T., Banerjee, D., Ugare, S., Misailovic, S., & Singh, G. (2026). DINGO: Constrained inference for diffusion LLMs. Advances in Neural Information Processing Systems, 38, 160518-160551.
Mündler, N., Dekoninck, J., & Vechev, M. (2025). Constrained decoding of diffusion LLMs with context-free grammars. arXiv preprint arXiv:2508.10111.
Cardei, M., Christopher, J. K., Kailkhura, B., Hartvigsen, T., & Fioretto, F. (2026). Constrained discrete diffusion. Advances in Neural Information Processing Systems, 38, 12383-12416.
Sahoo, S. S., Arriola, M., Schiff, Y., Gokaslan, A., Marroquin, E., Chiu, J. T., ... & Kuleshov, V. (2024). Simple and effective masked diffusion language models. Advances in Neural Information Processing Systems, 37, 130136-130184.
Questions
Main Questions
-
When the constraint is represented as an NFA, the authors say that "sampling from this weighted distribution becomes a soft proxy for ". I'm a little confused why this is the case -- is it because is no longer strictly proportional to due to their being multiple accepting paths? If so, isn't there an alternative way to compute the exact product distribution for the NFA constraint? Perhaps I have the wrong intuition about this, but isn't there a way to modify the forward-backward algorithm to avoid spreading probability mass over the different accepting paths?
-
How does constrained decoding apply to block-wise decoding / semi-autoregressive decoding? Based on Appendix C.2, it seems like block-wise decoding is used, but the paper doesn't explain how this works. For example, it's not clear to me if the constraint is applied over only each block, or over the entire sequence of length . If L is much larger than the block size, doesn't the latter option result in considerable overhead since blocks are sampled sequentially, but the constraint is computed for the whole sequence? Or is it the case that you only need to compute the constraint probabilities for the entire sequence only once?
-
The experiments compare constrained decoding via automata vs. unconstrained decoding, but they would be made stronger by also comparing against other constrained decoding algorithms such as naive rejection sampling or the algorithms of Mündler et al (2025) or Cardei et al (2026).
Minor Suggestions
It would be good to include the standard errors or con for the results reported in the tables (e.g. in Table 1), especially since some of the number are quite close. If there's no space in the main text, this can be done in the appendix.
Limitations
The authors have addressed the main limitation of their approach, which is that it does not apply to constraints that cannot be represented as DFAs or NFAs, such as CFGs, etc.
Another potential limitation is the scalability of the approach to long token sequences ( is very large), where block-wise decoding is typically used -- see my questions about block-wise decoding above, and whether the constraint is computed globally in such cases. The authors currently do not address this potential limitation.
Paper formatting concerns
None.
Final justification
I believe this a strong paper that should be accepted, and the authors have adequately addressed all of my questions and concerns. I thus maintain my score of 5.
Thank you for the detailed reading and for all the great questions. I think all these questions help to improve the clarity and soundness of our paper, and we will include them in the revised version.
We thank the reviewer for this suggestion. We compare against the following baselines.
Rejection sampling. Rejection sampling can be expensive: the CS column of Table 1 gives the single-draw acceptance rate, which falls to 4.4% for Dream-7B on BFCL-Live (Python). The expected number of draws per accepted sample is therefore (1/CS=22.7) in this setting.
Following the reviewer’s suggestion, we evaluate rejection sampling on 200 examples from the BFCL Non-Live JSON split, with a maximum budget of 16 draws per example. The results are shown below.
“Rejection-sampling accuracy” estimates the accuracy achieved by rejection sampling under a budget of up to 16 draws. Our constrained decoder performs comparably, and even outperforms rejection sampling on Dream, largely because rejection sampling fails to find a satisfying output within the budget for 8.5% of the examples. The average number of draws until the first satisfying sample measures the sampling overhead: for Dream, rejection sampling requires an average of 3.94 draws to obtain one constraint-satisfying output.
DINGO. DINGO performs MAP inference over DFA and supports greedy decoding only. Their code is not released, so we compare against the numbers reported in their paper on GSM-Symbolic, the benchmark they evaluate. The table shows the empirical comparison of DINGO and ours:
Cardei et al. CDD enforces constraints through differentiable optimization during sampling, which requires the constraint to admit a differentiable relaxation. The constraints we target are non-differentiable: JSON schema and SQL grammar have no natural continuous surrogate, and our method enforces them exactly by construction rather than by optimization. The two approaches therefore cover different constraint classes and are not directly comparable. We thank the reviewer for the pointer and will add it to the related work section.
Mündler et al. (2025). Their method also targets masked dLLMs and uses per-step rejection sampling with a lookahead check, so it does not guarantee constraint satisfaction within a finite budget. We will add a direct empirical comparison against their method in the revision.
For a DFA, each accepted sequence has exactly one accepting path, so pM is uniform over C and proportional to 1[x1:L∈C]. An NFA may have several accepting paths for the same sequence, in which case pM weights each sequence by its path count and is no longer uniform. Normalizing an NFA requires counting accepted sequences of a fixed length, which is the #NFA problem and is #P-complete [1].
The constraint is always applied globally over the full sequence, independent of the block structure. Each denoising step proceeds as follows.
Thank you for the question. For block-wise decoding, we can easily adapt our approach to the per-block setting to gain extra efficiency at the cost of losing information from mean-field predictions outside the block; i.e., we only perform MAP inference or sampling within the decoding block, and the tree-shaped sampling optimization applies in this setting as well. We will make it clear in our revision.
Unconstrained greedy decoding is deterministic and has no standard deviation. Our method is not fully deterministic even at temperature 0, since the latent automaton path is sampled stochastically, so we report error bars for it in both regimes. Due to compute limits, we cannot obtain standard deviations for all experiments during the rebuttal phase, so we report three seeds on BFCL Non-Live (JSON, N=1000) as a representative case. We can see that variation is small relative to the gaps.
[1] Arenas et al, #NFA admits an FPRAS: Efficient Enumeration, Counting, and Uniform Generation for Logspace Classes, JACM 2021.