Constraints Are Graphs, Not Chains: Exact Decoding for Diffusion Language Models
cs.AI, cs.FL
Submitted: 2026-09-26
Updated: 2026-09-26
License: http://creativecommons.org/licenses/by/4.0/
The gist: Diffusion language models (dLLMs) predict masked positions in arbitrary order, but their exact constrained decoders still encode constraints as sequential languages, whose state must track every
Terminology
Abstract
Diffusion language models (dLLMs) predict masked positions in arbitrary order, but their exact constrained decoders still encode constraints as sequential languages, whose state must track every unresolved dependency between positions. For relational constraints this encoding grows exponentially: for same-order copy, every finite automaton needs 4 k states, deterministic or nondeterministic, and every context-free grammar has size 2 Ω(k), while the factor graph of the same relation has size O(k) and a 16-entry peak table. We introduce FactorDLM, a training-free decoder that represents finite-domain relations as a factor graph and, at each denoising step, conditions the model's mean-field prediction on that graph exactly by variable elimination. Decoding cost then grows exponentially with the induced width of the constraint graph, which replaces automaton size as the governing parameter. Because a finite automaton is a chain-shaped factor graph, one compiler enforces syntax and nonlocal relations together: on JSON records with cross-field references, a schema automaton alone leaves references dangling, relational factors alone produce malformed JSON, and the combined plan is valid on both counts, including on records of variable length. Across nine relational benchmarks and three backbones, every output satisfies every declared constraint at 0.4-6.9% projection overhead, where unconstrained decoding is 0-79% valid, and compiled projection answers repeated queries 13.6x faster than CP-SAT with eight parallel workers. Because model-free rules solve three of five standard benchmarks, we construct benchmarks with exact chance and fixed-template floors, on which selecting among exact constrained samples beats greedy projection. Which encoding is cheaper, sequential state or direct factors, depends on the constraint and is computable before decoding begins.
Sources
- Generative Recursive Reasoning
- Search or Accelerate: Confidence-Switched Position Beam Search for Diffusion Language Models
- Constrained Decoding for Diffusion Language Models via Efficient Inference over Finite Automata
- Mitigating Bias in Locally Constrained Decoding via Tractable Proposals
- EPIC: Efficient and Parallel Inference under CFG Constraints for Diffusion Language Models
- Guided Discrete Diffusion for Constraint Satisfaction Problems
- Breaking the Factorization Barrier in Diffusion Language Models
- Constrained Decoding of Diffusion LLMs with Context-Free Grammars
- The Hidden Cost of Structured Generation in LLMs: Draft-Conditioned Constrained Decoding
- Constrained Code Generation with Discrete Diffusion
- Primal-Dual Guided Decoding for Constrained Discrete Diffusion
- Dream 7B: Diffusion Large Language Models
- Lookahead-then-Verify: Reliable Constrained Decoding for Diffusion LLMs under Context-Free Grammars
- NATURAL PLAN: Benchmarking LLMs on Natural Language Planning
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems