Diffusion Language Models

Michael BrenndoerferNovember 17, 20263 min read
Language AI HandbookAll chapters
Part 19 of 67Alternative Sequence and Generative Architectures
Chapter 136Diffusion Language Models
Reading section 1 of 13 · Diffusion Language Models · 3 minSection 1 of 13 · 3 min

Section 1 of 13 · 3 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

In a basic left-to-right sampler, each next-token probability is conditioned on the committed prefix. Speculative verification can check several candidates in one target model pass while preserving that factorization. Masked diffusion uses a different conditional. It can infer several missing positions from visible tokens on either side.

The chain rule writes a string’s joint probability as a product of next-token probabilities conditioned on its prefixes. For a string of length LL over a vocabulary of KK tokens, a parameter-shared causal model computes LL categorical factors, one per position. Teacher forcing supplies the observed prefixes, and a causal mask lets one forward pass score all positions during training. Unrestricted conditional tables still have KL−1K^L-1 independent parameters, just like the full joint distribution. Left-to-right sampling commits to the position order chosen by the model.

In the absorbing-mask formulation used here, generation begins with a sequence of [MASK] tokens. At each step the model sees the partial sequence and predicts a distribution over the original token at each masked position. The sampler can reveal several positions together and choose their order. Samplers that allow remasking can also reconsider an earlier reveal.

Several positions can be proposed in a single model call. A TT-round sampler uses fewer sequential calls than a basic LL-call autoregressive sampler when T<LT<L, though each full-sequence call evaluates every position. Visible text on either side of a gap can guide an infill. A sampler that explicitly remasks previous predictions can also revise them. The application and implementation determine how these choices affect quality and elapsed time.

Discrete diffusion has been used for text at character and token resolution. D3PM includes character-level experiments. In LLaDA’s same-data scaling study, the smaller models match in architecture dimensions, while the larger diffusion and autoregressive models have 8.02B and 6.83B total parameters, respectively. The published comparison against an external Llama 3 8B uses different training data. D3PM. LLaDA, §3.1 and Appendix B.2

The trade-offs are real, and you should understand them before proceeding:

  • Likelihood evaluation. The reverse chain defines a normalized distribution. Evaluating its exact likelihood can require summing many latent paths. Training commonly optimizes a variational bound, and benchmark reports should label an exact value, a bound, or an estimate of that bound.
  • Sampling work. This full-sequence implementation evaluates all LL positions in each of TT denoising rounds. Bidirectional computation over changing tokens lacks the unchanged-prefix cache used by ordinary causal decoding.
  • Sampling policy. The schedule and order determine which intermediate inputs the denoiser sees. Confidence ordering or token revision may implement a different sampler from the fixed reverse transitions used to derive the objective.

A likelihood bound and a measured runtime answer different questions. Report the estimator and normalization for likelihood. For speed, measure the complete request under a fixed hardware, precision, sequence-length, and batch protocol. The number of serialized model calls and the positions evaluated per call help explain those measurements.

The worked example distinguishes three quantities: the per-position predictions, the joint posterior they approximate, and the likelihood bounded by the objective. We define the corruption process and training objective, verify the calculation by enumerating a two-token example, then train and sample from a small model.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy