What is a diffusion language model?
A diffusion language model generates text not token by token from left to right but by starting from a fully masked or noised sequence and cleaning it step by step. In training, masks or noise are added gradually and the model learns to reverse the corruption.
Unlike an autoregressive model, which predicts only the next token at each step, it predicts every masked position together and uses context in both directions. Unlike masked language modelling, the mask ratio is drawn at random between 0 and 1 rather than fixed.
- Topic
- Machine learning, models and training
- Also known as
- Masked diffusion language model, discrete diffusion model, diffusion LLM
- Origin
- 2021 discrete diffusion study, 2022 continuous diffusion language model
How a diffusion language model works
- Tokens in training text are masked at a randomly chosen ratio.
- A network, usually a Transformer, learns to predict all masked tokens at once.
- Generation starts from a fully masked response; each step keeps some predictions and masks the rest again.
- The number of steps trades quality against speed; response length is chosen in advance.
In more detail
Continuous and discrete approaches
The continuous approach maps words to embedding vectors and works with Gaussian noise; the continuous nature of the intermediate latent variables lets a simple gradient-based algorithm perform complex controllable generation. The discrete approach moves tokens directly into a mask state; a 2024 study of masked diffusion shows its training objective is a mixture of classical masked language modelling losses.
Commonly confused terms
| Term | How it differs |
|---|---|
| Diffusion model | A diffusion model is the general family of generative models that remove noise step by step from continuous data such as images and audio. A diffusion language model adapts the idea to the discrete tokens of text and mostly uses masking instead of noise. |
Why a diffusion language model matters for on-premises AI
A 2021 study defined diffusion models for discrete data and a 2022 study showed fine-grained controllable generation with a non-autoregressive diffusion language model. In 2024 simple masked diffusion was reported to approach autoregressive perplexity; in 2025 an 8-billion-parameter model trained from scratch performed comparably to autoregressive baselines built by its authors.
Testing a diffusion language model for code completion, a software company's research team varies the number of sampling steps and measures answer quality and throughput on its own test set.
Common questions
Are diffusion language models faster than autoregressive ones?
It depends. Because several tokens can be produced per step, cutting the number of steps gains speed but may cost quality. A 2025 study saw higher throughput on some datasets and a regression on one.
Is it the same as image diffusion models?
The core idea is the same. Because text consists of discrete tokens, however, most diffusion language models use masking or discrete transitions instead of Gaussian noise.
Related terms
Sources
- Structured Denoising Diffusion Models in Discrete State-Spaces, arXiv, 2021
- Diffusion-LM Improves Controllable Text Generation, arXiv, 2022
- Simple and Effective Masked Diffusion Language Models, NeurIPS, 2024
- Large Language Diffusion Models, arXiv, 2025
In the glossary: Glossary, A to D