Diffusion Language Models: Writing the Whole Text at Once
Two ways to write a sentence
A classic language model (GPT, Mistral, Claude) writes the way you type: one word after another, left to right, never going back. To produce 500 tokens (a token is a piece of a word, see tokenization), it has to run the whole network 500 times in a row, each pass waiting for the previous one. This is called autoregressive generation: each token depends on all the ones before it.
Now picture a fill-in-the-blanks exercise where every word is a blank. The model is asked to guess each blank by looking at everything else. It fills in the ones it is sure of first, then, with that extra context, the next ones, and so on. In ten or a few dozen passes, the whole sentence is written. That is the idea behind diffusion language models (often shortened to DLM or dLLM).
The problem: autoregressive generation is a bottleneck
An autoregressive pass makes poor use of a graphics card. For every token, the model must read all of its weights from memory just to produce one small result: the card spends most of its time waiting for data rather than computing. The KV cache avoids recomputing everything, and speculative decoding lets a small model guess several tokens ahead, but the principle stays sequential.
Meanwhile, inference (running models to answer requests) has become one of the industry's largest compute expenses. Producing several tokens per pass could cut both latency and the bill.
The mechanism: corrupting text by masking it
Reminder: diffusion for images
An image diffusion model learns to undo a noising process: noise is gradually added to a photo until only static remains, and a network is trained to remove that noise step by step. At generation time, you start from pure static and denoise.
The catch with text: you cannot "slightly noise" a word
An image is made of continuous numbers: you can add 3% noise to a pixel. A word is discrete: "cat" cannot be "a little noisy". Text needed a different kind of corruption, and the one that won out is masking:
- Noising (training). Take a sentence and replace some of its tokens with a special
[MASK]symbol. At a noise level between 0 and 1, each token has probability of being masked. At , everything is masked. - Learned denoising. A Transformer looks at the sentence full of holes and predicts the original token for each one. It sees the whole sentence in both directions (bidirectional attention), exactly like BERT.
- Generation. Start from a fully masked sequence of the desired length. At each step, the model proposes a token for every hole; keep the most confident ones and re-mask the rest. Repeat until no holes are left.

A masked diffusion model looks a lot like BERT, which already learned to guess hidden words. The difference: BERT always masked about 15% of the words, whereas a diffusion model trains at every masking rate, from almost nothing to everything. That is what lets it start from a blank page.
A little math: the loss
The MDLM paper (2024) showed that the training objective boils down to an average of ordinary fill-in-the-blank losses, weighted by the masking rate. Under the simplest masking schedule, it reads:
Symbol by symbol: is the original sentence, the sentence masked at level , the original token at position , and the probability the network (with weights ) assigns to the right token. The sum runs only over masked positions: the model is graded only where it had to guess. The factor gives more weight to lightly masked examples, where each mistake matters more.
A short, fast history
- 2021, D3PM (Google) lays out diffusion for discrete data.
- 2023, SEDD (Stanford; Lou, Meng and Ermon) makes discrete diffusion competitive with GPT-2 at equal size; the paper won a best paper award at ICML 2024.
- 2024, MDLM (Cornell) shows that simple, well-trained masked diffusion comes close to autoregressive perplexity.
- February 2025, LLaDA (Renmin University and Ant Group) scales to 8 billion parameters, trained from scratch, and holds its own against LLaMA 3 8B on in-context learning.
- 2025, the first products. Inception Labs launches Mercury Coder: according to its technical report, over 1,100 tokens per second for the Mini version on an NVIDIA H100, with quality comparable to speed-optimized models. Google shows Gemini Diffusion as an experimental demo in May 2025. Dream 7B (University of Hong Kong and Huawei) shows you can start from an existing autoregressive model rather than from scratch.
- July 2026, DiffusionGemma (Google DeepMind): an open-weight model obtained by converting Gemma 4 (a MoE with 25.2 billion parameters, 3.8 billion active), using less than 10% of the original training budget. It refines blocks of 256 tokens in parallel, produces around twenty tokens per pass on average, and reaches roughly 1,500 tokens per second on one H100.
The limits: speed is not free
On paper, a diffusion model can write 1,000 tokens in 10 steps. In practice, three obstacles eat into that gain.
1. Fewer steps, lower quality. When the model fills several holes in the same step, it picks each one independently of the others. If the sentence begins "I flew to ... ..." and the two holes should read "San Francisco" or "Los Angeles", the model may draw "San" for the first and "Angeles" for the second: each plausible on its own, the pair absurd. The faster you want to go (more holes filled per step), the more these inconsistencies show up.
2. Each step is expensive. Because attention is bidirectional, every step reprocesses the whole sequence, including words already settled. The KV cache that spares autoregressive models from recomputing the past does not apply directly.
3. Training is data-hungry. The model has to learn to guess words in every possible order, not just left to right. Reference diffusion models often go over the same data many times to reach good quality.
In its pure form, a diffusion model must know the length of the text before it starts, since it begins from a sequence of N masks. For a chatbot reply, whose length nobody knows ahead of time, that is awkward.
The compromise: block diffusion
The most common fix is block diffusion: the text is cut into blocks of a few dozen or a few hundred tokens. Blocks are generated one after another, left to right like a classic model, but within a block all tokens are denoised in parallel. You get back the KV cache for past blocks and free length, at the cost of some parallelism. DiffusionGemma works this way.
Block Diffusion: Interpolating Between Autoregressive and Diffusion Language ModelsOther work such as Fast-dLLM adds, without retraining, an approximate cache, and only commits in parallel the tokens the model is confident enough about.
Fast-dLLM: Training-free Acceleration of Diffusion LLM by Enabling KV Cache and Parallel DecodingFinally, diffusion can serve as a helper to a classic model: in DFlash (2026), a small block diffusion model drafts a run of tokens in one go, which the large autoregressive model then checks in parallel (the principle of speculative decoding). The authors report over 6x acceleration with no loss of quality.
DFlash: Block Diffusion for Flash Speculative DecodingComparison
| Autoregressive | Masked diffusion | Block diffusion | |
|---|---|---|---|
| Tokens produced per pass | 1 | Several, across the whole sequence | Several, within the current block |
| Number of passes | One per token | A few dozen (adjustable) | A few per block |
| Cost of one pass | Low (KV cache) | High (whole sequence) | Medium (cache for past blocks) |
| Revising a word already written | No | Yes, by re-masking | Yes, within the current block |
| Text length | Free | Fixed in advance | Free |
Why it matters
Text diffusion is the main serious alternative to word-by-word generation. It goes after the cost of inference, which weighs more and more heavily, and it brings an ability classic models lack: revising a word already placed in light of what comes after, which helps with code, infilling, and problems with global constraints. Whether quality holds at very large scale is still debated: the fastest diffusion models rival mid-sized autoregressive models, not yet the best ones. Text diffusion is also the yardstick for newer approaches such as Next-Concept Modeling, which try to keep the parallelism without paying for all of its flaws.
Key takeaways
- A diffusion language model starts from fully masked text and fills in the holes in a few dozen steps, several tokens at a time.
- For text, the "noise" is masking: the model is a bidirectional Transformer, close to BERT, trained at every masking rate.
- LLaDA (2025) showed such a model holds up at 8 billion parameters; Mercury and DiffusionGemma brought it to production at over 1,000 tokens per second.
- Three brakes: quality drops when you cut the number of steps, each step reprocesses the whole sequence, and training needs a lot of data.
- Block diffusion is the dominant compromise: sequential across blocks, parallel within them.
1. Why do text diffusion models corrupt sentences by masking tokens rather than by adding noise as with images?
2. A diffusion model fills two holes in the same step and produces "San Angeles". Where does this kind of error come from?
3. What trade-off does block diffusion make compared with pure masked diffusion?