- Key idea
- Masked (discrete) diffusion: a forward masking process, a learned reverse process, the ELBO training loss, and the cost of unmasking in parallel
- Real world
- A crossword is solved in no fixed order. You fill in the clues you're surest of first, and each answer constrains the ones that cross it. Filling in two crossing answers at once, without checking each against the other, is how you end up with a clash.
- In an LLM
- LLaDA, Dream and Gemini Diffusion start from a fully masked answer and reveal tokens over a fixed number of steps, many per step. Fewer steps means faster generation, but tokens revealed in the same step are chosen independently, which can produce text that doesn't fit together.
Two ways to factor a sentence
An ordinary language model uses the chain rule left to right:
But the chain rule works in any order. You could predict the last word first, then the third, then the rest. A model that can predict any subset of positions given any other subset can generate in any order. That's the idea behind masked diffusion language models.
The forward and reverse process
- Forward process (fixed, no learning): take real text and replace each token with
[MASK]independently with probability . At the text is intact; at it's all masks. - Reverse process (learned): a network looks at partially masked text and predicts, for each masked position, a distribution over what token belongs there.
To generate, start at all masks and run the reverse process in steps: predict every masked position, reveal some of them by sampling, repeat until nothing is masked.
An archivist restores a page with half the words smudged. They fill in the obvious ones first ("the", "of"), then use those to pin down the harder ones. No left-to-right order is needed; each word is guessed from all the legible words around it, before and after.
Take "the capital of France is Paris". Pick and mask about half: "the [MASK] of France [MASK] Paris". Train the model to put high probability on "capital" and "is" in those slots. Repeat with every between 0 and 1. It's BERT's masked-language-model objective, with a random masking ratio and a weighting that turns it into a proper likelihood bound.
The catch: parallel tokens are independent
Within one step, the model gives each masked position its own distribution, and samples them independently. But the true tokens are not independent of each other. If two positions depend on each other strongly, sampling both at once can produce a combination the data never contains.
After "the capital of [MASK] is [MASK]", the model's slot predictions might be: country 40% France, 35% Japan, 25% Italy; city 30% Paris, 25% Tokyo, and so on. Each is right on its own. Sampled independently in the same step, "France ... Tokyo" comes out about 10% of the time. Reveal one first, and the other is predicted given it, and the clash disappears.
That's the core speed–quality trade-off of diffusion LMs:
- One token per step: an exact sample from the model, but as slow as a normal language model.
- Many tokens per step: fast, but with independence errors between tokens revealed together.
- Which tokens to reveal: revealing in each step every position the model is confident about, and only those, avoids most clashes. Confident positions barely depend on the others, so sampling them together is safe; uncertain, dependent ones go one at a time. LLaDA's low-confidence remasking and Fast-dLLM's threshold decoding both work this way.
Try it
Why it's a likelihood model
Masked diffusion isn't a heuristic. Its training loss is an evidence lower bound (latent variables) on the log-likelihood of the text, with the masked versions as latent variables. So diffusion LMs can be compared with autoregressive ones on perplexity, and trained with RL using the same tools, with one difficulty: the exact log-probability of a whole answer, needed for importance ratios and policy gradients, isn't available, only a bound. Methods like d1 estimate it.
Where this shows up
- LLaDA, Dream, Mercury, Gemini Diffusion: masked diffusion at scale, competitive with autoregressive models of similar size on many tasks.
- RL for diffusion LMs (d1 and successors): policy gradients with estimated sequence log-probabilities.
- The any-order view connects diffusion to autoregressive models over random orders.
- It's a Markov chain from all-masked to complete text.
Forward process
Each token is independently masked with probability :
Training loss
The network predicts the clean token at each masked position. LLaDA and MDLM minimise
which upper-bounds the negative log-likelihood: . The weight balances lightly and heavily masked examples; with it, the expected number of masked tokens per example is matched to their information content.
Sampling
From to (fewer masks), each masked position is revealed with probability , its token drawn from , independently across positions. The joint distribution of tokens revealed in one step is therefore the product of marginals, not the true conditional joint, which is the source of the errors the widget counts.
The any-order view
Averaging over masking ratios, the loss equals an expected negative log-likelihood under a random generation order :
an autoregressive model trained over every order at once.
Papers
- Simple and Effective Masked Diffusion Language Models (Sahoo et al., 2024): MDLM
- Discrete Diffusion Modeling by Estimating the Ratios of the Data Distribution (Lou et al., 2023): SEDD
- Large Language Diffusion Models (Nie et al., 2025): LLaDA, 8B, low-confidence remasking
- Dream 7B: Diffusion Large Language Models (Ye et al., 2025)
- d1: Scaling Reasoning in Diffusion Large Language Models via Reinforcement Learning (Zhao et al., 2025)
- Fast-dLLM: Training-free Acceleration of Diffusion LLM by Enabling KV Cache and Parallel Decoding (Wu et al., 2025): confidence-threshold parallel decoding
- Any-Order GPT as Masked Diffusion Model (Xue et al., 2025)