Twist, Don't Tilt: Trajectory-Exact Constrained Decoding for Masked Diffusion Models
Aditya Thimmaiah, Lara Marinov, Jayanth Srinivasa, Haris Vikalo, Junyi Jessy Li, Milos Gligoric
Abstract
Constrained decoding for Masked Diffusion Language Models (MDLMs) aims to ensure that generated outputs satisfy a specified structure or syntax constraint. MDLMs generate outputs by repeatedly unmasking masked positions present in their current state. Recent strategies for constrained decoding constrain the model's per-step mean-field posterior (which factorizes over masked positions) by enforcing the desired constraint with an automaton. The resulting chain-structured factor graph allows exact constrained sampling via dynamic programming. However, despite each draw being exact and constraint-satisfying, we prove that their composition, in general, tilts away from the model's relative probabilities over valid trajectories, thus leading to trajectory bias. We derive an exact expression for this bias as a product of ratios measuring how valid continuation mass changes when the denoiser is reconditioned, and characterize when the bias vanishes. We then correct the bias by introducing TWISTER, the first automaton-twisted Sequential Monte Carlo decoder for MDLMs, using the step-exact decoder as the proposal. We show that for regular language constraints, the Feynman-Kac correction is exactly computable, with the twists obtained efficiently using quantities pre-computed for step-exact sampling. We prove that the resulting Feynman-Kac model targets the unbiased Doob h-transformed path law conditioned on constraint satisfaction.
Create a lesson
Metadata
- Categories
- cs.LG, cs.AI, cs.CL
- Comments
- Preprint under review
Related papers
Looking Back to Forget: Self-Anchored Unlearning Along the Generation Trajectory of Diffusion Language Models
Shared title terminologycs.LGRuihao Pan, Suhang Wang
Strong EEG Decoding without EEG-Specific Pretraining: A Simple Reversible Interface for Vision Backbones
Shared title terminologycs.LGZi Liang, Haibo He, Peng Hu et al.
LinearSpec: Drafting from the Target's Memory for Long-Context Speculative Decoding in Hybrid Vision-Language Models
Shared title terminologycs.LGHaiyu Wang, Sai Qian Zhang, Steven Li
Beyond Routing Flips: Asymmetric Silencing, Phase Bifurcation, and Bitwise-Exact Diagnosis of MoE Reinforcement Learning
Shared title terminologycs.LGZhiyuan Zhang
Conformal Prediction with Nested Modality Masks
Shared title terminologycs.LGAlireza Moayedikia
CHORD: Rollout-Free Off-Policy Replay of the Denoising Chain for Sample-Efficient Diffusion-Policy Reinforcement Learning
Shared title terminologycs.LGKuanyen Liu, Ren-jyun Huang, Chong-Yan Chen et al.