NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Constrained Decoding for Diffusion Language Models via Efficient Inference over Finite Automata

Meihua Dang, Stefano Ermon

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: LLM Reasoning, Memory & RAG › Diffusion Language Model Decoding · Type: new method · Keywords: diffusion language models, constrained decoding, finite automata, parallel inference, arithmetic circuit theory

Areas: Model Architectures & Sequence Modeling › Language Model Architectures › Diffusion Decoding

Summary

The paper presents an exact algorithm for constrained decoding of diffusion language models using finite automata, enabling efficient inference while guaranteeing constraint satisfaction.

Explained to a 5-year-old

Some computers that write stories pick many words at the same time, like drawing several puzzle pieces together. Usually, computers add one word after another, which makes it easy to check that the words follow a shape. The new idea is a clever way to check the puzzle pieces even when they are chosen together, so the computer can still make correct shapes. It helps the computer do better at making useful things like function calls, solving puzzles, and answering questions, without making the computer slower. Because of this, the computer can be used more safely in real apps where the output must be exactly right.

Explained to a 5-year-old, longer

Some computers that write stories pick many words at the same time, like drawing several puzzle pieces together. This is different from the usual way, where the computer adds one word after another, like writing a sentence line by line. When words are chosen all at once, it is hard to make sure they follow a rule, such as forming a shape like a JSON object or a function call. The paper introduces a clever trick that works like a puzzle checker that can look at all the chosen words together and see if they obey the rule. It treats the rule as a simple set of steps that must be followed, similar to a game where you must go from start to finish without breaking the path. By using this trick, the computer can guarantee that the final output will always be correct, even when many words are generated at the same time. The method also lets the computer choose words randomly or pick the best one, giving flexibility for different uses. It works with both greedy choices and random sampling, making it useful for many tasks. The approach can be used in parallel, meaning several parts of the work happen at once, which saves time. It also supports block-wise decoding, where the computer processes chunks of the output together. The technique reduces the depth of the computation from linear to logarithmic, meaning it scales well even for very long texts. As a result, the computer can produce accurate, structured outputs quickly, making it suitable for real-world applications like function calls, planning puzzles, and answering questions. The new method improves accuracy on many benchmarks while keeping the extra computational cost low, so it can be safely used in production systems.

For a technical reader

The paper addresses the challenge of enforcing constraints on diffusion language models, which generate tokens in parallel rather than sequentially. By modeling constraints as finite automata and leveraging arithmetic circuit theory, the authors derive a tractable inference algorithm that guarantees constraint satisfaction. The algorithm supports both greedy and stochastic decoding, works with parallel and block-wise schedules, and reduces sampling depth to logarithmic complexity. Empirical results on multiple structured-generation benchmarks show significant accuracy gains with minimal overhead compared to unconstrained decoding.

Problem

Diffusion language models generate text by sampling multiple positions simultaneously, which conflicts with existing constrained decoding methods that assume sequential left-to-right generation, making it difficult to enforce constraints such as JSON schemas.

Method

The approach treats finite automata as graphical models to obtain tractable representations of the constrained distribution, enabling efficient inference that guarantees constraint satisfaction. It supports both greedy and sampling-based decoding, works with parallel and block-wise decoding under arbitrary remasking schedules, and uses depth-reduction techniques from arithmetic circuit theory to lower sampling depth to logarithmic in sequence length.

Results

The approach raises greedy decoding accuracy on BFCL-Live from 63.9% to 71.5% and stochastic sampling accuracy from 22.3% to 69.0%, while incurring less than 5% wall-clock overhead, and shows consistent gains on other tasks.

Contributions

The paper provides an exact algorithm for constrained decoding of diffusion language models that works with any finite-automaton constraint, supports parallel decoding, and reduces sampling depth to logarithmic complexity. It also demonstrates large accuracy improvements on multiple structured generation benchmarks with minimal overhead.

Practical relevance

The method enables reliable deployment of diffusion language models in production systems that require structured outputs, improving safety and usability.

Research questions this paper is counted under

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction