Handbooks  /  Diffusion LLMs
Handbook~13 min readInferenceworked math + runnable code
Handbook

Diffusion
LLMs.

Every chatbot you've used writes the same way: one token, then the next, then the next — a strictly sequential crawl where the length of the answer is the latency. Diffusion language models break that rule. They start from a blank, masked block and refine the whole thing at once over a handful of steps, deciding dozens of tokens per pass. That's where the 1,000-plus-tokens-per-second headlines come from — and it's a genuinely different way to generate text, not a faster version of the old one.

01

The autoregressive wall

Autoregressive (AR) models — GPT, Claude, Llama — generate token t+1 conditioned on tokens 1..t. That conditioning is the whole trick, and also the whole bottleneck: you cannot start token t+1 until token t exists. Generating N tokens means N sequential forward passes, so latency grows linearly with output length.

autoregressive: N tokens = N sequential passes  →  latency ∝ N (one token per pass)

Batching and speculative decoding soften this, but the fundamental shape — one token per step — stays. Diffusion changes the shape.

02

Block diffusion: decide many tokens at once

A diffusion LLM takes a block of B positions, starts them all masked, and runs K refinement (denoising) steps. Each step looks at the whole partially-filled block and commits more tokens, until after K steps the block is clean. The key number: it emits B/K tokens per pass instead of one.

Autoregressive crawl vs block denoise
AR
■□□□□□□□ → ■■□□□□□□ → …
N passes for N tokens
vs
Diffusion
████████ → ▓▓▓▓▓▓▓▓ → ■■■■■■■■
whole block in K passes
diffusion passes = ⌈N/B⌉·K  ·  speedup vs AR = B/K per block

With a 64-token block refined in 8 steps, that's 8 tokens per pass — an 8× drop in pass count versus AR. Push K down and throughput climbs; the runnable below counts the passes for any B and K.

03

Text diffusion is not image diffusion

This shares a name with the image diffusion that powers Stable Diffusion and friends — but the mechanism underneath is different in a way that matters. Image diffusion adds and removes continuous Gaussian noise from pixel or latent values; "a little noise" is a real-valued perturbation of a real-valued signal.

Text is discrete. You can't add 0.3 of Gaussian noise to the token "cat" — there's no halfway between "cat" and "cot" in token space. So text diffusion uses a discrete corruption process: instead of noising values, it masks tokens and learns to un-mask them. The "noise level" is which positions are hidden, and denoising is progressive un-masking.

Image diffusionText diffusion
Datacontinuous (pixels/latents)discrete (tokens)
"Noise"Gaussian perturbationmasking positions
Denoise steppredict & subtract noiseun-mask / re-predict tokens
Covered inDiffusion Modelsthis handbook

Same big idea — learn to reverse a corruption process, then run it from pure noise to generate — but "corruption" means something categorically different for tokens than for pixels.

04

The speed–quality knob

The number of steps K is a dial, and it trades throughput against coherence. Fewer steps means more tokens committed simultaneously per pass — faster, but riskier: tokens chosen in the same step can't fully condition on one another, so they can come out mutually inconsistent (the classic diffusion failure where a sentence is locally fine but globally muddled). More steps restores that conditioning and the coherence with it, at the cost of speed.

K → 1 (few steps): max throughput, more parallel-commitment error
K → B (many steps): approaches autoregressive quality, loses the speed win

The honest picture: diffusion LLMs win big where raw speed beats the last few quality points — high-throughput drafting, latency-critical UX, cheap bulk generation — while autoregressive still tends to lead on the hardest, most sequential reasoning, where every token really does depend on the one before it. It's a new point on the speed-quality frontier, not a strict upgrade.

05

Where it fits

Reported production text-diffusion systems have posted throughput figures well past a thousand tokens per second — an order of magnitude beyond typical autoregressive serving — which is exactly what you'd predict from emitting a block per handful of passes. That makes them compelling for interactive coding assistants, autocomplete at scale, and any workload where a human is watching the text stream in.

For an engineer the takeaway is a new axis to reach for: when latency dominates and the task tolerates a small quality trade, a diffusion decoder can be a step-change, not a tweak. Pair it with the image-diffusion foundations for the shared math, and with speculative decoding for the autoregressive world's answer to the same latency problem.

Read next

The continuous cousin: Diffusion Models. The AR speedup: Speculative Decoding. Serving throughput: LLM Serving.

RUN IT YOURSELF

Count the passes: autoregressive vs block diffusion

The whole speed story is a pass count. Autoregressive decoding needs one forward pass per token, so N tokens cost N passes. Block diffusion refines a block of B tokens in K steps and emits B/K tokens per pass — so its total is ⌈N/B⌉·K. Watch the speedup equal B/K, watch it vanish when K rises to B (denoising every token separately is just autoregression), and change the block size and step count.

CPython · WebAssembly
Frequently asked

Quick answers

What is a diffusion LLM?

A model that generates text by iterative denoising of a masked block instead of one token at a time — filling many positions in parallel over a few refinement steps, which unlocks far higher tokens-per-second than autoregressive decoding.

How does it differ from image diffusion?

Image diffusion perturbs continuous pixel/latent values with Gaussian noise. Text is discrete, so text diffusion masks tokens and learns to un-mask them — the "noise" is which positions are hidden, not a real-valued perturbation.

Why is it faster?

Autoregressive decoding needs N sequential passes for N tokens. Block diffusion decides B tokens in K steps, emitting B/K tokens per pass — so when K ≪ B the pass count drops sharply.

What's the trade-off?

Fewer steps = faster but more parallel-commitment error (tokens chosen together can't fully condition on each other). More steps recovers coherence at the cost of speed. Diffusion wins where speed beats the last few quality points.

The Diffusion LLMs Handbook · Vibe Engines · 2026 · reported throughput from public sources · more handbooks →
Finished this one? 0 / 160 Handbooks done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.