Scaling up Masked Diffusion Models on Text

Shen Nie, Fengqi Zhu, Chao Du, Tianyu Pang, Qian Liu, Guangtao Zeng, Min Lin, Chongxuan Li

Overview

This paper establishes the first scaling law for Masked Diffusion Models (MDMs) on text, proving they scale at a rate comparable to standard autoregressive models (ARMs). By scaling MDMs up to 1.1 billion parameters and introducing a novel "unsupervised classifier-free guidance," the authors demonstrate that MDMs can outperform same-sized ARMs, match much larger models (like Llama-2 7B) on math reasoning, and completely bypass the "reverse curse" that plagues GPT-style models.

The Problem with Autoregressive Giants

For years, Autoregressive Models (ARMs)—which predict the next token in a sequence—have been the undisputed kings of Natural Language Processing (NLP). However, they have inherent "blind spots." They struggle with bidirectional reasoning, suffer from the "reverse curse" (knowing "A is B" doesn't guarantee they know "B is A"), and their sampling time grows linearly with text length.

Masked Diffusion Models (MDMs) offer a promising alternative by learning to fill in masked gaps within a sequence, naturally enabling bidirectional context. But until now, it was unknown if MDMs could scale as efficiently as ARMs or if they could handle complex tasks like open-ended generation and math reasoning at scale. This paper sets out to determine if MDMs are a viable competitor for the next generation of Large Language Models (LLMs).

Methods and Technical Innovations

The authors built a family of MDMs based on a Transformer encoder architecture, diverging from the causal decoder typically used in GPT models.

Scaling Law Establishment: The researchers performed an "IsoFLOP" analysis, training models of various sizes to find the optimal balance between parameter count and data size for a given compute budget.

IsoFLOP curves for ARMs and MDMs

They found that MDM validation loss follows a power law almost identical in slope to ARMs, proving that diffusion models can scale predictably on text.

Unsupervised Classifier-Free Guidance (CFG): CFG is a technique widely used in image diffusion to boost generation quality, but it usually requires "paired" data (e.g., an image and its caption). The authors proposed a way to achieve this without paired data by leveraging the MDM’s inherent ability to model joint distributions. They use a "dummy" mask as an unconditional state to guide the model during inference, significantly boosting performance.

Greedy Sampling: They utilized a MaskGIT-style sampling approach, which iteratively unmasks tokens based on the model's highest confidence scores. This allows for faster, parallel generation compared to the strict token-by-token generation of ARMs.

Key Insights

The "Compute Gap" is Real but Manageable: While MDMs scale at the same rate as ARMs, they currently require about 16x more compute to reach the same validation loss.

Scaling laws showing the 16x compute gap between MDMs and ARMs

However, this 16x gap is significantly better than the 64x gap seen in continuous diffusion models, suggesting MDMs are the more efficient diffusion path for text.

Breaking the Reverse Curse: Because MDMs are bidirectional, they do not depend on the order of information. A 1.1B MDM achieved an impressive 92% accuracy on reverse queries (e.g., "Who is [Description]?") where even massive autoregressive models like GPT-3 (175B) and Llama-2 (13B) scored 0%.

Bidirectional Resilience: MDMs are much more robust to "temporal quality degradation." When tested on data from 2024 (after their training cutoff), the MDM's performance dropped significantly less than the ARM's. Its bidirectional nature allows it to better "triangulate" meaning in unfamiliar or shifted contexts.

Key Results

  • Zero-Shot Performance: The 1.1B MDM outperformed the 1.1B TinyLlama on 4 out of 8 language understanding benchmarks and beat the 1.5B GPT-2 on 6 out of 8.
  • Math Reasoning: On the GSM8K dataset, the 1.1B MDM achieved performance comparable to the 7B Llama-2, despite using less than 5% of Llama-2's pre-training FLOPs.
  • Sampling Speed: In text generation, MDMs matched ARMs in quality while being 1.4x faster during sampling (even when the ARM used KV-caching).
  • Guidance Works: The proposed unsupervised CFG significantly boosted zero-shot accuracy across the board (e.g., jumping from 36.0 to 40.99 on the LAMBADA dataset).

Limitations and Future Work

The most obvious limitation is the 16x compute overhead during pre-training compared to ARMs. While MDMs offer faster sampling and better reasoning, they are currently much "more expensive" to train to the same loss level.

The authors suggest that future work should focus on:

  1. Closing the Compute Gap: Finding more efficient training objectives or architectures to reduce the 16x overhead.
  2. Scaling Further: Testing if MDMs exhibit "emergent abilities" (like complex chain-of-thought) when scaled well beyond the 1.1B parameter mark.
  3. System Optimizations: MDMs currently don't use specialized system-level optimizations like KV-caching; developing MDM-specific kernels could widen their speed advantage even further.

Summary updated

BibTeX
@inproceedings{nie2025scaling,
  author = {Shen Nie and Fengqi Zhu and Chao Du and Tianyu Pang and Qian Liu and Guangtao Zeng and Min Lin and Chongxuan Li},
  title = {{Scaling up Masked Diffusion Models on Text}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=WNvvwK0tut},
}
Figure