Soft-Masked Diffusion Language Models
Michael Hersche, Samuel Moor-Smith, Thomas Hofmann, Abbas Rahimi
TL;DR
This work addresses the information loss inherent in binary masking in masked diffusion language models (MDLMs) by introducing Soft-Masked Diffusion Language Models (SM). SM blends the mask token with a weighted mixture of the top-$k$ predictions from the previous step, guided by a confidence-based weight $\lambda(\mathbf{p}) = \omega_s \sigma(\omega_a(-H(\mathbf{p})-\omega_b))$, enabling continuous feedback and partial information propagation across decoding steps. The authors propose a training procedure that jointly optimizes SM parameters with the backbone MDLM in a two-pass fashion, and demonstrate consistent performance gains on both a $169$M-parameter language model and large-scale Dream models for code generation, including improvements in perplexity, MAUVE, and coding benchmarks under high-throughput decoding budgets. SM also complements existing efficiency techniques like unmasking schedulers, caching, and Fast-dLLM, yielding faster, higher-quality generation in high-NFE regimes. The results suggest continuous feedback is a viable direction to enhance discrete diffusion models for language and code tasks, with practical implications for faster, more reliable generation systems.
Abstract
Diffusion models have demonstrated strong potential in language modeling, offering various advantages over traditional autoregressive approaches. Their ability to generate and revise entire responses in parallel enables faster generation and built-in self-correction mechanisms. Most modern diffusion-based language models employ masked diffusion, where decoding involves iteratively processing masked tokens based on a binary decision: either retaining the mask or replacing it with the predicted token. However, this binary choice discards valuable predictive information when the mask is retained. To address this limitation, we introduce soft-masking (SM), a novel method that dynamically blends the embedding of the mask token with the embeddings of the top-$k$ predicted tokens from the previous decoding step, for each retained mask. This provides the model with a more informative prior, preserving context from earlier computations and allowing partial information about masked tokens to propagate beyond a single step. We propose a training methodology that adapts a pretrained masked diffusion language model to incorporate SM. We demonstrate that continuing pretraining a 169M parameter model with SM leads to improved perplexity and MAUVE scores. Furthermore, we finetune two state-of-the-art diffusion models, Dream-7B and Dream-Coder-7B, with SM. SM consistently improves performance across multiple coding benchmarks, particularly in high-throughput settings.
