Diffusion Large Language Models
Most language models write left to right, one word at a time. Diffusion models start with a blank page of [MASK] tokens and sharpen the whole sentence in a handful of passes. This page walks through how, and why it matters.
Five ideas the rest of the page leans on
A language model never sees raw characters. "The cat sat." is chopped into chunks called tokens first — usually whole words or word-fragments like The, cat, sat, .. Every token is just a row number in a giant lookup table called the vocabulary, which typically holds between 32,000 and 256,000 entries.
So to the model, a sentence is a short list of integers. Generating new text means producing more integers and looking up what strings they happen to map to.
Every modern LLM runs on a network called a Transformer. Picture it as a tall stack of identical layers. Each layer lets every token glance at the others to pull in context — that's attention — and then runs the result through a small feed-forward network. Repeat thirty-something times, and the model can finally tell you what token is most likely to come next at every position.
You don't need the matrix math here. The one thing to internalize: attention is what lets the token at position 5 know what's happening at position 12. Whether that glance is even allowed is decided by an attention mask — and that mask turns out to be the star of Part 2.
GPT, Llama, Claude, and Gemini all share one basic move: pick tokens one at a time, in order. The model sees "The cat sat", picks the most likely next token (say on), tacks it on, then does it again with "The cat sat on", picks the, and so on. That left-to-right habit has a name — autoregressive (AR) generation — and it's the only style most people have ever seen.
Two properties of AR matter later. Once a token is picked, it's locked in for good. And the model can only look at what it's already written; it can't peek to the right. Diffusion ends up pushing back on both of those at once.
When people say the model "predicts" the next word, what it actually hands back is a probability for every token in the vocabulary — a 128,000-long vector that sums to 1. During training the signal is roughly: "out of all those options, the right answer was token #4711. Push that probability up, push the rest down." The math for doing the pushing is cross-entropy loss; the picture is enough.
A trained model is one that puts most of its probability mass on a reasonable next token. Sampling is then just rolling a weighted die against that vector.
Long before anyone said the word "diffusion," BERT (2018) was trained by hiding about 15% of the tokens in a sentence with a [MASK] symbol and asking the model to guess them from context. The same exercise on the back of any language workbook: "The cat sat ___ the mat." BERT got very good at filling blanks but never learned to write whole passages.
Diffusion language models are essentially BERT pushed harder. Instead of always hiding 15%, they hide a random fraction anywhere between 0% and 100%. Then, to generate text, they start with the page entirely blank and fill it in across a few rounds of guessing. That's the core idea you're about to take apart.
Hold onto those five. Every new piece on the page — Markov chains, attention masks, denoising loops, block diffusion — is really just a new arrangement of these five bricks. If something later feels like it appeared out of nowhere, scroll back here.
Foundations
From image diffusion to discrete tokens — and why the bridge is non-trivial.
Two Ways to Write a Sentence
Every generative model is answering one question: given everything I've seen so far, what comes next? Autoregressive language models answer one token at a time, left to right, with each new token conditioned on the exact tokens already written. GPT, Llama, Claude, and Gemini all (mostly) work this way.
Diffusion models answer the same question from a different starting point. Instead of building the sequence token by token, they begin with a completely corrupted tape — every position is [MASK] — and refine it across a handful of steps, deciding all positions in parallel each step. By the final step every mask has been replaced with a real token. The model didn't write the sentence; it uncorrupted it.
"Writing text" sounds like one job, but there are really two ways to arrive at a finished paragraph. One is to write each word the moment it occurs to you and never look back. The other is to rough out the whole thing first, sharpen the parts you're sure of, and circle back to the rest. The first is autoregressive. The second is diffusion. Neither is obviously the winner — they trade speed, parallelism, and the ability to undo mistakes against each other in different ways.
A lot of confusion in this corner of the field comes from mixing up two questions: how the model was trained, and how it has to generate. Diffusion models aren't magically free of constraints; they just have a different set. Part 1 is about putting names to those constraints so the rest of the page reads as engineering rather than alchemy.
Three things make this worth doing, and the rest of the page is mostly about each of them: parallelism (many tokens commit per step, so a long sentence can finish in fewer model calls), bidirectional context (every position sees every other while generating — including the ones to its right), and self-correction (a wrong token committed early can be revisited and replaced later). Autoregressive models can't do any of these natively.
An autoregressive model is like taking dictation: you commit each word the moment you hear it, you can't peek at what comes next, and once a word is on the page, it's there forever. A diffusion model is more like developing a Polaroid: the whole image emerges at once, fuzzy at first, with the sharper features (confident tokens) resolving first and the trickier ones coming into focus later.
The same end result, two profoundly different routes. The route matters — it changes what the model can plan ahead for, how it recovers from mistakes, and how fast it produces output.
Why Diffusion Started in Image Space
Diffusion didn't begin with language. It was invented for images, where it now dominates everything from Stable Diffusion to Midjourney to Sora. The core trick is almost suspiciously simple: take a real image, slowly add Gaussian noise until it dissolves into pure static, then train a neural network to undo the noising one step at a time.
"Gaussian noise" is a fancy name for adding a small random number to each pixel, with the number drawn from the bell curve everyone knows from intro stats — mostly near zero, occasionally larger. A little of it makes the picture slightly grainy. A lot of it turns the picture into TV static. Run it for hundreds of steps and you reach pure noise: every pixel has forgotten what it used to be.
A diffusion model is just a small network trained to undo one of those steps. If it can take a slightly noisy image and predict the slightly cleaner version that came before it, then by stacking that operation hundreds of times you can walk all the way back from pure static to a clean image. That's the entire idea: train a one-step denoiser, run it many times.
The forward Gaussian step is
and the closed-form jump to any timestep is
with $\bar{\alpha}_t = \prod_{s=1}^{t}(1-\beta_s)$. Training reduces to predicting the noise $\varepsilon$ from $\mathbf{x}_t$ — the famous $\mathcal{L}_{\text{simple}} = \|\varepsilon - \varepsilon_\theta(\mathbf{x}_t, t)\|^2$.
Three things are happening. First, each step shrinks the image a hair (that's the $\sqrt{1-\beta_t}$ factor) and adds a small amount of noise with variance $\beta_t$. Second, because every step is independent Gaussian, you can collapse any number of them into a single jump — handy at training time, since you never have to simulate the whole chain. Third, the loss boils down to: given a noisy version, guess the noise. If the network can name the noise, subtracting it gets you back the original. That's what $\mathcal{L}_{\text{simple}}$ is asking for.
This works beautifully on images because they live in a continuous space. Every pixel is a real number, and "image plus a little noise" is still a valid image. Now ask the obvious follow-up: what is "a token plus a little Gaussian noise"?
Why Continuous Diffusion Breaks on Text
Tokens are stubbornly discrete. A token is an integer ID into a vocabulary of, say, 128,000 entries. There is no "Gaussian neighborhood" around the integer 42 — token 42 might be the word "dog," token 43 might be the suffix "##ing," and token 41 might be a Chinese character. Adding 0.5 to a token ID gets you precisely nothing.
A continuous quantity is one you can nudge by an arbitrarily small amount and it still means something — temperature, height, pixel brightness. A discrete quantity comes from a fixed menu with nothing in between: whole numbers, chess squares, the words in a dictionary. The integers 4 and 5 sit next to each other on the number line, but the meanings "four" and "five" are no closer to each other than "four" and "synchrotron." The ordering of words in a vocabulary is an accident of how someone numbered them; underneath, there's no geometry at all.
Diffusion only works when "almost the same" actually means something. For pixels it does. For tokens it doesn't. That one fact is what forces the rest of this part of the page; everything that follows is the workaround the field came up with.
Two responses emerged. The first was embedding-space diffusion: embed each token into ℝd, run Gaussian diffusion on the embeddings, and round back to a token at the end. It works in a technical sense, but the rounding is lossy and most of the model's capacity ends up learning the rounding boundary rather than learning language. By 2024 this line had quietly become a historical branch.
The second response is the one that actually won: discrete diffusion. Throw out the Gaussian forward kernel entirely. Replace it with a categorical Markov chain that lives directly in vocabulary space. The rest of this page is the story of how that one substitution turned diffusion into a serious challenger to autoregressive language modeling.
Discrete Diffusion: A Markov Chain Over Tokens
A Markov chain is a random process where the next state depends only on the current state — not on the full history. The toy example is weather, simplified to "sunny / cloudy / rainy." If today is sunny, there's some probability tomorrow is sunny, some that it's cloudy, some that it's rainy. Stack those three rows of probabilities into a tiny table and you have a transition matrix: row = today, column = tomorrow, cell = probability.
For text the same table is much bigger — one row and one column for every token in the vocabulary, so $K \times K$ with $K$ maybe 128,000. Every cell answers the same kind of question: if this position is token $i$ right now, what's the chance that one corruption step turns it into token $j$? Most cells are zero or essentially zero; the interesting design choice is which non-zero pattern you choose.
In a discrete diffusion model (the family called D3PM, introduced by Austin et al. in 2021), the forward "noising" step is governed by a transition matrix Qt of shape K × K, where K is the vocabulary size. Qt[i, j] is the probability of token i transitioning to token j at step t. Apply Qt repeatedly and you get gradually corrupted token sequences — no Gaussians, no embeddings, just stochastic token replacement.
Three concrete choices of Qt matter for language:
- Uniform. Each step, each token has a small chance of being replaced by a uniformly random token from the vocabulary. Smooth, but introduces noise that has no semantic relationship to the original.
- Absorbing-state (MASK). Add a special
[MASK]symbol to the vocabulary. Each step, each unmasked token is left alone with some probability, or replaced by[MASK]. Once masked, always masked. This is exactly the corruption process used by BERT — and it is the variant that powers every serious diffusion LLM today. - Gaussian-over-tokens. Concentrate Qt near the identity using a token-ordering metric. Useful for ordinal data (like quantized image patches), but irrelevant for language since tokens have no natural ordering.
[MASK] — the model knows which positions are corrupted. Uniform corruption replaces tokens with random other tokens — the model doesn't know which are corrupted, and must figure it out. Almost all modern diffusion LLMs use absorbing-state because of this information advantage.From here on, when we say "diffusion language model" we mean masked (absorbing-state) discrete diffusion. This is the family that includes MD4, MDLM, SEDD, LLaDA, Gemini Diffusion, and Mercury.
Imagine you're proof-reading a page where some words have been replaced. With uniform corruption, swapped words look like every other word — you have to figure out which positions are wrong AND what they should be. With MASK corruption, the corrupted positions are crossed out — you only need to figure out what they should be. The first job is much harder than the second. Models trained with MASK can spend their full capacity on prediction rather than detection.
The Simplification That Made It All Click
For a few years (2021–2023), discrete diffusion was a niche topic — interesting math, but the models trained sluggishly and underperformed BERT. In 2024 two papers (MD4 from Google DeepMind, and MDLM from a separate group) showed that the entire training objective for masked diffusion collapses to something stunningly simple:
— summed over masked positions $M_t$ only, where $t$ is the mask rate and $w(t)$ is a fixed weighting derived from the noise schedule. For the standard "linear" schedule (mask each token with probability $t$), $w(t) = 1/t$.
Read it left to right and ignore any symbol you don't recognize. The thing inside the brackets is the same "did I get the right answer" cross-entropy score from card 04 of the warm-up. The sum runs only over positions that were masked, so the easy ones don't count. The $w(t)$ weights that score based on how aggressively things were corrupted. The integral over $t$ just averages everything across every possible mask rate from 0% to 100%. That's the whole loss.
Read that twice. This is just BERT's masked language modeling loss, but with the mask rate sampled uniformly from [0, 1] instead of fixed at 15%, and with a 1/t weighting. The entire mathematical edifice of "diffusion" — Markov chains, ELBOs, score functions, transition matrices — collapses, in the masked variant, to "weighted MLM with a continuous schedule."
This collapse is the moment diffusion LLMs became viable. Training is now operationally indistinguishable from BERT's MLM — every existing MLM trainer, every distributed-training trick, every optimizer ablation, transfers directly. The "diffusion" content lives entirely in (a) how you choose the schedule, (b) how you weight the loss, and (c) how you sample from the trained model. The model itself is just a Transformer trained on a generalized masked-LM objective.
LLaDA's training loss, published by Renmin University + Ant Group in February 2025, is exactly this — Equation 3 of the LLaDA paper is the linear-schedule special case of MD4's general formula. The simplification turned out to be the same one, found independently.
A masked diffusion language model is trained almost exactly like BERT. Two things change. First, the fraction of tokens hidden isn't fixed at 15% — it's drawn fresh for every example, anywhere from 0% to 100%. Second, the easier examples (small mask rate, lots of context) count for more in the loss than the harder ones. Same Transformer, same cross-entropy, same optimizer; only the way you set up the training examples changes.
If that sounds like "BERT with extra steps," the extra steps are what turn a blanks-filler into a real generator. Parts 3 and 4 are about how.
Feel It: Drag The Mask Rate
Before going further, build a physical feel for what t means. Drag the slider. Every position has a fixed random draw; whichever positions happen to land below t become [MASK]. At t = 0 the model sees a clean sentence; at t = 1 every position is hidden. The training loss samples a random t for each example, so the model has to be competent at every mask rate from near-zero to near-one.
A diffusion LLM at t very small is doing what BERT does — fill in a handful of blanks given lots of context. A diffusion LLM at t very large is doing something like image generation — sculpt a sentence out of nothing but the prompt. The remarkable claim of MDLM is that the same Transformer, trained on a uniform mix of t values, becomes fluent at both — and at every regime in between.
Architecture
What changes in the Transformer when you train it as a diffusion model.
The One Change That Changes Everything: Bidirectional Attention
Inside any attention layer, every position asks the same question: which other positions should I look at? It gets back a similarity score for each candidate and forms a weighted sum from them. Up to that point, every position is fair game.
The attention mask is the rule that bans some of those lookups before they happen. It's a square grid the size of the sequence: cell $(i, j)$ is 1 if position $i$ is allowed to look at position $j$, and 0 otherwise. Different masks turn the same Transformer into very different models. The gap between an AR Transformer and a diffusion Transformer, at the implementation level, really is just two different masks. The figure below lets you flip between three of them.
An autoregressive Transformer (GPT, Llama) uses a causal attention mask: token at position i can attend only to positions 1 through i. This is the structural enforcement of left-to-right generation. A diffusion Transformer (LLaDA, Gemini Diffusion, Mercury) removes that mask. Token at position i can attend to every position — including positions to its right.
Drag the block-size slider above. At block size 1, the mask is fully causal — the model is operationally identical to AR. At block size = sequence length, the mask is fully bidirectional — full MDLM. In between, you get production block diffusion. This single slider is the AR-to-diffusion continuum. Modern systems live around block size 32.
Causal attention is reading with a card sliding down the page — you can only see the line you're on and the lines above. Bidirectional attention is reading with all of your peripheral vision — every word is glimpsed in the context of every other word. When the model decides what to commit at a masked position, it knows the words to its right exist (just doesn't know what they are yet). That is genuinely new information AR can't access.
A concrete example: "The keys to the cabinet ___ on the table." An autoregressive model reading left-to-right sees "cabinet" right before the blank, and might guess "is." But the actual subject is the plural "keys" — so the answer is "are." A bidirectional model sees the whole sentence at once. It knows "on the table" follows, it knows the subject is "keys," and it commits "are" with confidence. Small example, huge structural difference.
An Anatomy of LLaDA-8B
To make this concrete: LLaDA-8B is a Llama-3-class Transformer trained as a diffusion model. Here's what changes and what stays.
In case the names start flying: the embedding layer turns each token ID into a dense vector by looking it up in a table. Self-attention is the layer we just discussed — where positions read each other. The FFN is a small two-layer MLP that runs on each position independently, and most of a Transformer's parameters live in there. RMSNorm / LayerNorm is a normalization step that keeps activations from blowing up or fading to nothing. RoPE is a rotation applied to the queries and keys so the model knows where each token sits in the sequence.
A Transformer "block" is just self-attention plus an FFN. A full model is thirty to eighty of those stacked on top of one another. LLaDA-8B inherits its block design wholesale from Llama-3. The only differences are the attention mask, the loss the model is trained against, a small change to how the attention heads are grouped, and one extra signal — the current mask rate $t$ — fed in through the FFN.
Training
The forward process, the noise schedule, and how to convert an AR checkpoint to a diffusion model.
A Training Step, In Slow Motion
Here's what actually happens for one training example. (A "batch element" is one sentence; on a GPU you process hundreds at a time.)
- Sample t ~ Uniform(0, 1). This is the mask rate for this example — a fresh number every time, anywhere from 0 (don't mask anything) to 1 (mask the whole sentence). Think of $t$ as "how hard am I about to make this one?"
- Corrupt: walk through each position and flip a biased coin. With probability $t$, replace the token with
[MASK]; otherwise leave it alone. A 12-token sentence at $t = 0.3$ ends up with roughly 4 random tokens replaced. - Forward pass: run the bidirectional Transformer on the corrupted sentence and read off the logits at every position. (A logit is just an unnormalized score; softmax turns it into the probability vector from card 04.) Positions that weren't masked still get logits — we just ignore them.
- Cross-entropy on the masked positions, weighted by 1/t. The model is graded only on the slots it couldn't see. Light corruption (small $t$) makes the grade weigh heavily; heavy corruption (large $t$) makes it weigh gently.
- Backprop, optimizer step, next batch. Same neural-net mechanics as anywhere else: the loss tells the gradient which direction to nudge each parameter, and the optimizer takes one small step that way.
After millions of examples across every mask rate, the network is really learning the answer to one big question: given any partially-masked sentence, what's the joint distribution over the missing tokens? When you query it at inference time, you're running the exact same machinery — only starting from "everything masked" instead of "30% masked at random." That symmetry between training and inference is the reason a single training signal is enough.
The Noise Schedule: How Fast The Mask Climbs
A schedule is just a curve. It tells you, at corruption fraction $t$, how many tokens should still be visible. A linear schedule is a straight line: at $t = 0.5$, half the tokens are still there. A cosine schedule bends in the middle, so most of the masking happens in the middle of the trajectory and tapers near each end. A polynomial schedule with a higher exponent pushes the masking later — most positions stay visible until pretty late, then everything goes at once. The plot below shows three of these along with the loss-weight curve each one induces.
The noise schedule α(t) maps a continuous time t ∈ [0, 1] to the fraction of tokens unmasked. At t = 0, α = 1 (no masking). At t = 1, α = 0 (everything masked). The shape of the schedule between those endpoints determines what mask rates the loss emphasizes — and, by symmetry, the step distribution at inference.
AR → Diffusion: The WSD Curriculum
A trained language model is, at the end of the day, just a giant blob of numbers — every weight matrix in the Transformer, all saved together. That blob on disk is what people call a checkpoint. A frontier-scale one costs millions of dollars in GPU time to produce, so teams guard them carefully. Which raises an obvious question once you want to switch paradigms: do I have to throw the old checkpoint out and start from scratch? The good news is no. You can morph an AR checkpoint into a diffusion one for a small fraction of the original training budget — which is what the next section is about.
Training a 100-billion-parameter language model from scratch is an order-of-magnitude commitment of GPU-hours. Nobody wants to throw away an existing pretrained autoregressive checkpoint and start over for the diffusion variant. AR2Diff (DeepMind, 2024) and WSD (Ant Group, 2025) both solve this: take an AR checkpoint, gradually morph it into a diffusion model.
LLaDA2.0's Warmup-Stable-Decay curriculum is the most ambitious instance. It parameterizes the model by a block size L_B that controls how much bidirectional attention is on. At L_B = 1, the model is pure AR. At L_B = sequence length, it is pure full-sequence diffusion. The curriculum walks the model up the continuum, lets it stabilize in pure-diffusion mode, then walks it back down to a small operational block size for inference.
During AR pretraining, the embedding for the [MASK] token never receives gradient (because [MASK] is never seen), so its weight decays to zero. When you switch to diffusion training, every masked position has a near-zero embedding — and at high mask rates the model's predictions collapse into garbage. The LLaDA2.0 paper documents a precise fix: inject independent Gaussian noise into the embedding-layer output for masked tokens during the first iterations. This keeps the L2 norm of the masked-token embedding meaningful without re-initializing weights (which would cause catastrophic forgetting). Small, ugly, essential.
Inference
The denoising loop, block diffusion, parallel decoding, and self-correction.
The Basic Denoising Loop
In training we took a clean sentence and corrupted it. At inference we run the same machine in reverse: start from a fully corrupted sequence — every position is [MASK] — and ask the model to uncorrupt it. The forward pass is identical to the one in training. The only new piece is a sampler: a small policy that, each step, decides which masked positions are confident enough to commit and leaves the rest masked for next round.
At inference time, the model starts with a fully masked sequence — every position is [MASK] — and runs N denoising steps. Each step is one forward pass through the Transformer, which emits a probability distribution over the vocabulary at every position. The sampler then decides which masked positions to commit this step, samples a token at each of those, and leaves the rest masked for the next step.
The Speed-Quality Knob, Made Tangible
Step budget N is the most consequential knob in diffusion inference. Drag it. Press play. Watch the same sentence resolve through 2 steps, 4 steps, 16 steps — and notice how the quality readout responds.
At each step the model assumes masked positions are independent given the current context. That's a lie — they aren't. But the lie is approximately true when the model commits only its highest-confidence positions. The art of diffusion inference is keeping each step's commit set inside the regime where the lie is harmless.
Remasking Strategies: Who Commits This Step?
The sampler's only real job is picking which positions to commit each step. Different policies trade speed (commit a lot per step) against quality (commit only when the model is genuinely confident). The four common ones, roughly from simplest to cleverest:
- Random remasking. Pick a fixed number of positions at random and commit those. Cheap and theoretically clean — it matches the training distribution — but quality is poor, because half the time you're committing in spots where the model isn't sure.
- Low-confidence remasking. Rank the masked positions by the model's top-1 probability and commit the $k$ most confident ones. This is what LLaDA ships with. Plain but very effective: it beats random by roughly 10 points on GSM8K.
- Confidence-threshold commitment. Commit every position whose top-1 probability is above some threshold $\tau$ (say 0.9). Now the number of commits per step isn't fixed: easy steps commit a lot, hard steps commit very few. This is the basis of Fast-dLLM and CAP, which is the next section.
- Margin-based commitment. Commit based on the gap between top-1 and top-2 rather than the top-1 value alone. Holds up better when the model is poorly calibrated — a top-1 of 0.55 with a 0.5 runner-up is a very different bet from a top-1 of 0.55 with a 0.05 runner-up.
Inside The Model's Head: A Confidence Tour
When the diffusion model runs a forward pass, every masked position emits a full probability distribution over the vocabulary. The threshold τ is the rule for which positions are confident enough to commit this step. Hover any token below to peek at its top-3 candidates — the same data the sampler uses to decide.
[MASK] and get re-scored next step with the now-richer context. Watch how lowering τ commits more tokens per pass — at the cost of acting on weaker evidence.A well-calibrated model where "0.95 confidence" really means 95% accurate is a model you can run with τ = 0.95 and trust. A poorly-calibrated model where "0.95 confidence" actually means 70% accurate is a model that will commit early, commit wrong, and have no recourse. This is why LLaDA2.0's confidence loss — selectively sharpening predictions only on tokens the model gets right — was a quietly important contribution.
Block Diffusion: Killing the KV-Cache Problem
Inside every attention layer, each position computes three vectors: a query (Q), a key (K), and a value (V). Attention scores are dot-products of queries against keys, and the output is a weighted sum of values. In an AR model, once you've produced the first 50 tokens, their K and V vectors at every layer are settled — they only depend on what came before. So the engine caches them. When you compute token 51, you only need its own Q/K/V plus the 50 cached entries. That cache is what people mean by the KV cache, and it's a big part of why AR can run at 100 tokens per second on a single GPU.
Bidirectional attention destroys that. Position 1 now attends to position 50, so the moment position 50 changes — which happens every denoising step — position 1's output changes too. Nothing is reusable. Every step recomputes everything from scratch. At sequence length 4,096 that's the practical reason plain full-bidirectional diffusion never made it out of research demos.
Recall from §6: full bidirectional attention destroys the KV cache. Every denoising step re-attends from scratch across the whole sequence. With sequence length 4096 and 32 steps, that's 32 × O(4096²) attention computations per generation. This is what makes vanilla MDLM uncompetitive at production scale.
Block diffusion fixes it. Partition the output into blocks of size B (typically 32). Within a block, attention is bidirectional — the block decodes jointly. Between blocks, attention is causal — block k attends only to blocks 1…k. Once block k is fully decoded, its K/V is frozen and cached. The decoder marches left-to-right at the block level while doing parallel bidirectional refinement at the token level.
Full bidirectional MDLM is reading the whole book at once with peripheral vision on every page — gloriously parallel, infeasible to cache. Block diffusion is reading one paragraph at a time: inside the paragraph you can flick your eyes around freely, but once a paragraph is read you lock it in and move on. The locked-in paragraphs become a KV cache. This is the engineering compromise that made diffusion LLMs deployable.
A Race: AR vs Diffusion Forward Passes
Set a sequence length. Set a diffusion step count. Press play. Both models start with an empty page; AR commits one token per forward pass, diffusion commits ⌈seq_len / N⌉ tokens per pass. Watch the diffusion bar pull ahead.
A vendor showing a "10× faster" claim is usually comparing a diffusion model at aggressive step budget (8 steps over 1024 tokens) against an AR model with no KV cache. Apples to apples on the same hardware, with both engines tuned, the honest number is closer to 2× at parity quality. Still impressive — but the 10× headline number is engineering theatre.
Confidence-Aware Parallel: The Speed Lever
Block diffusion alone costs T_block forward passes per block. The decisive speedup comes from committing many positions per pass. The dominant policy is Confidence-Aware Parallel (CAP): in one forward pass, commit every masked position in the active block whose top-1 probability exceeds threshold τ. Positions below τ stay masked and get re-scored next step.
Confidence only means something if it's calibrated. A well-calibrated model that says "0.95" really should be right about 95% of the time when it says so. Standard neural networks are notoriously overconfident — they'll say 0.95 when their true accuracy is closer to 70%. CAP makes that gap painful: every overconfident prediction becomes a frozen wrong answer. So a serious diffusion stack ships more than just a CAP sampler. It also ships training-time losses that make the confidence numbers honest. LLaDA2.0's confidence loss (next callout) is exactly that.
L(θ) = L_SFT(θ) + λ · L_conf(θ), where L_conf is the entropy of the predicted distribution, computed only on tokens that were correctly predicted. The "correctly predicted" qualifier is critical — minimizing entropy unconditionally would push the model toward confident wrong answers. Minimizing it only on the correct subset selectively sharpens calibration where it's safe.
Self-Correction: T2T Editing and Multi-Block Editing
CAP has a structural weakness: a token committed early on weak evidence is final, and the loop has no mechanism to revisit it. LLaDA2.1's T2T (Token-to-Token) editing fixes this. At each step, the sampler maintains two sets:
- Γ_t — positions that are currently
[MASK]and whose top-1 candidate exceeds threshold τ_mask (the standard unmasking set) - Δ_t — positions that are currently not
[MASK], but whose top-1 candidate differs from the committed token and exceeds threshold τ_edit (the edit set)
Positions in Δ_t get overwritten — a committed token is replaced by the new top-1 candidate. This is how a diffusion model can fix its own early-step mistakes mid-generation.
Multi-Block Editing (MBE) extends this across block boundaries: after block k+1 is decoded, the sampler revisits positions in blocks 1…k whose newly-available right-context changes their top-1 prediction. Architecturally this means breaking the K/V cache for any block where edits trigger and re-running attention — expensive, but only triggered when needed. LLaDA2.1 reports MBE consistently improves benchmarks on reasoning and coding tasks where late evidence invalidates early commitments.
Speed vs. Quality: The Real Tradeoff Curve
Two numbers matter for any serving system: tokens per second (how fast text comes out) and benchmark score (how good it is). Put them on x and y and every configuration shows up as one point. A configuration is strictly better than another only if it wins on both axes; otherwise you're picking a trade-off. The chart below shows where AR baselines and various diffusion configurations land on the same axes, under the same hardware, the same serving stack, and the same sequence length. That last sentence is doing most of the work — almost every marketing chart you'll see in this space is missing one of those controls.
Every diffusion-LLM acceleration trick is a point on a single curve: throughput vs. benchmark score. The marketing-grade "10× faster than autoregressive" numbers come from comparing favorable conditions on one side with unfavorable conditions on the other (small GPU, no continuous batching, etc.). The honest controlled-comparison number is ~2×.
Where Diffusion Wins — And Where It Doesn't
The mechanics are settled. The natural next question is empirical: on which tasks does this paradigm actually outperform autoregressive models, and on which does it not? Click any row to read the why.
Diffusion wins decisively on tasks that are inherently non-sequential — rewriting a function signature changes every call site at once; filling a hole in the middle of code needs left- and right-context simultaneously. Diffusion loses on tasks where each conclusion depends serially on the one before — multi-hop science, knowledge retrieval. The wins and losses are predictable from task structure.
The Coordination Problem, In One Visualization
Here's why diffusion struggles on chained reasoning. When the model commits a block of 5 tokens in parallel, each must be independently plausible without seeing the exact content of the other four. For code, this is fine — structural tokens are strongly predictable. For chained logic, where each step is about the previous one, it's fragile.
The Stacks
Google DeepMind's four-layer stack, and Ant Group's open-source LLaDA lineage.
Google DeepMind: MD4 → AR2Diff → Gemini Diffusion
When a lab ships a model, the model is the tip of an iceberg. Underneath sit the math that defines the training objective, the recipe for turning an existing checkpoint into the new paradigm, the inference engine that runs it fast in production, and the evaluation playbook. A "stack" is the whole iceberg. DeepMind and Ant Group both published every layer of theirs; the next two sections walk through them in the order they were built.
DeepMind's diffusion-LLM work is a four-layer stack, assembled over roughly 24 months. The math layer (MD4) gave the simplification we unpacked in §5. The schedule generalization (GenMD4) made the noise schedule learnable per-token. The transfer recipe (AR2Diff) let an existing AR checkpoint become a diffusion model with a small additional pretraining budget. The serving system (Gemini Diffusion) is the productization — a block-diffusion model demoed at Google I/O 2025.
Ant Group / inclusionAI: The LLaDA Lineage
In a 12-month sprint, Ant Group and Renmin University released five generations of open-source diffusion LLMs — culminating in LLaDA2.0-flash, the first 100B-parameter diffusion model. Every checkpoint is MIT/Apache licensed; every paper ships with code. It's the most aggressive open-source push in the diffusion-LLM space.
In a regular dense Transformer, every parameter takes part in every forward pass — a 100B-parameter model uses all 100B parameters for each token. A Mixture of Experts (MoE) replaces the dense FFN inside each layer with a bank of small "expert" FFNs plus a tiny router that selects a few of them per token. So the model can own 100 billion parameters but only run a small fraction — the "active" ones — for any given token. LLaDA2.0-flash has 100B total parameters and only about 6.1B active per token, which gives it roughly the capacity of a big model at roughly the inference cost of a small one.
The figure below shows the routing concretely: 256 routable experts plus one always-on "shared" expert, with the router picking 8 of the 256 each time. Those numbers aren't just trivia — they're a big part of how a Chinese lab fits a frontier-scale diffusion model onto export-restricted GPUs.
VRPO & EBPO: Reinforcement Learning, When Likelihoods Are Noisy
A freshly pretrained language model is a fluent next-word predictor. What it isn't yet is a model with preferences — it has no opinion on helpful vs rude, or correct math vs confidently-wrong math. The fix is post-training: a second phase where the model is shown pairs of outputs and told "this one is better than that one." The algorithms that turn preference labels into weight updates (DPO, GRPO, PPO) are all flavours of reinforcement learning, and they all need the same quantity: how likely is this output under my current model?
For an AR model that's easy — the probability factors into a product of next-token probabilities you're already computing. For a diffusion model it doesn't factor cleanly; you can only estimate it (with the ELBO from §5), and the estimate is noisy. Section 18·b is about how Ant Group brought that noise down far enough to do RL on a 100B-parameter diffusion model.
Reinforcement learning algorithms — DPO, GRPO, PPO — all depend on one quantity: the log-likelihood that the policy assigns to a sample. For an autoregressive model, this is exact and free (factor the chain rule, sum the log-softmaxes). For a diffusion model, it is intractable. You can only estimate the log-likelihood via the ELBO, and those estimates are noisy. Plug noisy estimates into a policy-gradient algorithm and the gradient becomes noisy too — training oscillates, sometimes diverges, and the learning rate has to be tuned an order of magnitude smaller than for AR. This is the single biggest reason RL on diffusion was a research curiosity until 2025.
Ant Group cracked it twice. VRPO (Variance-Reduced Preference Optimization), shipped with LLaDA 1.5 in May 2025, applied three variance-reduction tricks to DPO. The first two are budget allocation — many timesteps with one mask each, rather than few timesteps with many masks. The third is the trick: antithetic sampling. When you compute the policy's ELBO and the reference model's ELBO, use the same random masks for both. When you take the difference (which is what DPO needs), most of the noise cancels.
Imagine you're measuring two slightly different ocean tides at the same beach. If you measure them on different days, the weather adds noise to each — the difference is dominated by weather, not by the tides. If you measure them on the same day at the same hour, the weather is shared between both measurements, so it cancels in the subtraction. That's antithetic sampling. The "weather" here is the random choice of which tokens to mask when estimating the ELBO.
VRPO got LLaDA 8B to the alignment level needed for instruction following. But it didn't scale: at 100B parameters, even the variance-reduced ELBO was too noisy for the longer sequences needed for serious code RL. So in December 2025 the team shipped EBPO (ELBO-based Block-level Policy Optimization) — the first RL framework operated at 100B scale on a diffusion model.
EBPO's key move is to compute the ELBO block by block rather than over the whole sequence. The 100B model already trains with block size 32; EBPO inherits the same block partition for RL, computing one local ELBO per block and combining them additively. This gives the algorithm two structural advantages: per-block ELBOs have lower variance individually (fewer mask positions per estimate), and the cumulative gradient is more stable. EBPO is what drove LLaDA2.0-flash from a 23 to a 60 on AIME 2025 — a 45% post-training improvement on math reasoning.
dInfer: The Inference Stack That Actually Ships
A model is only as useful as the engine that serves it. When Ant Group released LLaDA2.0 they also released dInfer — a diffusion-native inference engine written specifically to exploit the unique structure of block-diffusion decoding. dInfer is open-source, Apache 2.0, and shipped with a Day-0 integration into SGLang.
Each layer in dInfer's stack is a separately-published optimization. Together they take a 100B model from ~237 TPS (Qwen3-30B AR baseline on the same hardware) to ~1,587 TPS on LLaDA2.1-mini's HumanEval+ benchmark — a 6.7× cumulative improvement, every step of which is independently ablated in the LLaDA2.0 and LLaDA2.1 technical reports.
On LLaDA-MoE (a 7B diffusion model used as the public benchmark for dInfer), serving HumanEval+:
dInfer is roughly 3× faster than vLLM serving a smaller AR model, and 10× faster than NVIDIA's own Fast-dLLM. The headline framing is loaded — different model architectures, different hardware tunings — but the structural point holds: diffusion-specific kernels beat general-purpose ones at this workload by a wide margin.
Diffusion decoding has many more degrees of freedom than AR: block size, threshold τ, edit threshold, remasking strategy, KV reuse policy, FP8 schedule, expert routing batch granularity. An engine that gets all of these defaults right is doing more for end-to-end speed than any single algorithmic improvement to the model itself. This is why Ant Group shipping dInfer mattered: it turned a research model into a deployable one.
The Open-Source Push: inclusionAI
Every model and tool described in this Part is released through Ant Group's inclusionAI organization on GitHub and HuggingFace. Apache 2.0 licenses. Pre-training data is publicly described (though not always publicly downloadable). Training infrastructure (dFactory), inference engine (dInfer), and benchmark suite all open. The lineage:
LLaDA-MoE (7B/1.4B)
LLaDA2.0-mini (16B/1.44B)
LLaDA2.0-flash (100B/6.1B)
LLaDA2.1-flash, -mini
VRPO (DPO + antithetic)
EBPO (block-level PG)
CAP (confidence loss)
T2T / MBE editing
SGLang Day-0 integration
FP8 per-block quantization
Alpha-MoE megakernel
KV cache reuse
For context, this is the most comprehensive open-source release in the diffusion-LLM space. Every other 100B-class diffusion model in 2025–2026 is closed (Mercury, Seed Diffusion, Gemini Diffusion). Every other open model is smaller (DiffuCoder 7B, Stable-DiffCoder 8B). The combination — frontier scale + full open weights + open training and serving toolchain — is what makes Ant Group's bet legible to the broader research community.
"Ant Group's push into alternative model paradigms underscores how China's Big Tech firms are stepping up efforts in algorithm and software optimisation to offset the country's disadvantages in advanced AI chips." (South China Morning Post, Dec 2025). The 5–10× inference speedup that diffusion offers is, in a hardware-constrained environment, equivalent to a generation of new chips. That is the bet.
Playground
Try it yourself. Run a denoising loop. See the reverse curse. Tune the speed/quality knob.
Build Your Own Denoising Loop
Pick a sentence. Pick a block size, a number of steps, a remasking strategy. Watch the model "generate" by uncorrupting a tape of masks. (This is a simulated diffusion process — the predictions are pre-baked from a real LLaDA-style trace, not a live model — but the dynamics are faithful.)
Drag the step budget down to 2 and basically everything commits in one pass — the result is lumpy. Drag it up to 12 and each step commits only the most confident handful, and the sentence resolves cleanly. That one slider is the speed-vs-quality lever every diffusion engine ships with. Production systems pick a point on this curve based on the workload: short factual answers can run at 4 steps, long coding tasks usually want 16 or more.
The Reverse Curse Demo
Train an autoregressive model on the sentence "Tom Cruise's mother is Mary Lee Pfeiffer," and it'll answer "Who is Tom Cruise's mother?" no problem. Flip it around and ask "Who is Mary Lee Pfeiffer's son?" and the same model often whiffs, even though the information is logically the same. The reason is purely structural. During AR training the model only ever read that sentence left to right, so the gradients flowed "Tom Cruise" → "mother" → "Mary Lee Pfeiffer" and never the other way. A bidirectional (diffusion) model treats both halves of every sentence as evidence for each other, so the asymmetry never gets baked in. The demo below shows the same phenomenon on Chinese poems, where the training corpus has plenty of forward citations and almost no reverse ones.
Autoregressive models trained on "A is B" struggle to answer "B is A" at inference. This is the reverse curse, and it is a direct consequence of left-to-right training: the model never sees "A is B" as evidence for "B is A." Bidirectional MLE training (i.e., diffusion training) sees both directions equally. The LLaDA paper documents this concretely on Chinese poem completion: forward 51.8% / reverse 45.6% for LLaDA, vs. forward 82.7% / reverse 34.3% for GPT-4o. GPT-4o is dramatically better forward and dramatically worse backward.
Three Things to Remember
If you take only three things away from this page, take these.
Block size is a continuum, not a binary. A diffusion LLM with block size 1 is AR. With block size = sequence length, it is full MDLM. Production settings live in between. The 2026 reality is one model, one set of weights, with the generation paradigm chosen at inference time per workload.
Going back and fixing mistakes mid-generation isn't a quality boost — it changes what kinds of tasks AI can handle. Code editing, document revision, collaborative writing, any non-sequential workload — these are where diffusion isn't just competitive but decisively ahead.
Every major open-source diffusion LLM in 2025–2026 comes from a Chinese institution: Ant Group's LLaDA family, ByteDance's Stable-DiffCoder, Renmin University's GSAI-ML. US contributions remain closed (Mercury, Gemini Diffusion). The ecosystem dynamics, the tools, the licensing norms — all different from the AR landscape.
Autoregressive generation is like writing an essay in ink, on a scroll that only unrolls forward. You cannot erase. If you realize on page 10 that page 2 needs revision, you have to start over.
Diffusion generation is like writing on a whiteboard. You sketch the rough structure first. Fill in the easy parts. Step back, check the whole thing, and erase-and-rewrite the pieces that don't fit. The final result is polished in a way that a single linear pass could never achieve.
Diffusion LLMs are the whiteboard. They're not better at everything. But for the things they're good at, they're genuinely transformative. And they're just getting started.
Sources and further reading
Everything in this page is grounded in primary sources. Click any link to go to the original.