Constraints Are Graphs, Not Chains: Exact Decoding for Diffusion Language Models
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 states, deterministic or nondeterministic, and every context-free grammar has size , while the factor graph of the same relation has size 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.
Create a lesson
Metadata
- Categories
- cs.AI, cs.FL
Related papers
Look Before You Commit: Visual-Evidence-Guided Decoding for Multimodal Diffusion Language Models
Shared title terminologycs.AITongxiao Hu, Yikai Zhao, Qiyan Zhao et al.
One Latent, Many Tokens: Jointly Learning Compressed Embeddings for Efficient Language Diffusion
Shared title terminologycs.AIYulin Yuan, Ying Zhang, Xiangming Meng
Unmask the State: When Does State Adaptation Matter for Masked Diffusion Language Models
Shared title terminologycs.AIInjin Kong, Sunghwan Choi, Yohan Jo
LimoBench: How Street Smart Are Large Language Models?
Shared title terminologycs.AIGautam Choudhary, Jack Peng, Udesh Kumarasinghe et al.
Wavefront: Low-Rank Drafting with Parallel Causal Refinement for Speculative Decoding
Shared title terminologycs.AIHuy Huu Nguyen, Xin Huang
Frequency-Conditioned Privacy Auditing of Fine-Tuned Language Models
Shared title terminologycs.AIAymen Noor, Ke Lyu, Honglu Jiang