Diffusion Language Models › From Continuous Diffusion to Discrete Tokens

Michael BrenndoerferNovember 17, 20264 min read
Language AI HandbookAll chapters
Part 19 of 67Alternative Sequence and Generative Architectures
Chapter 136Diffusion Language Models › From Continuous Diffusion to Discrete Tokens
Reading section 2 of 13 · From Continuous Diffusion to Discrete Tokens · 4 minSection 2 of 13 · 4 min

Section 2 of 13 · 4 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

The diffusion recipe in continuous space has three parts. A forward process gradually adds Gaussian noise to a data point x0∈Rdx_0 \in \mathbb{R}^d: q(xt∣xt−1)=N(1−βt xt−1,βtI)q(x_t \mid x_{t-1}) = \mathcal{N}(\sqrt{1-\beta_t}\,x_{t-1}, \beta_t I), where βt∈(0,1)\beta_t \in (0,1) is the per-step noise variance and II is the identity matrix. A network is trained to reverse it, usually by predicting the noise or, equivalently, the clean signal x^0\hat x_0. Sampling starts from pure noise and iteratively denoises.

A finite Gaussian chain with 0<βt<10<\beta_t<1 reduces the signal coefficient at each step. While that coefficient stays positive, q(xt∣x0)q(x_t\mid x_0) still depends on x0x_0. A sufficiently small terminal coefficient motivates using a noise prior. The forward posterior q(xt−1∣xt,x0)q(x_{t-1}\mid x_t,x_0) is Gaussian at intermediate noise steps when conditioned on the clean input. Integrating over the unknown clean input generally gives a mixture. A learned Gaussian reverse transition, as in DDPM, approximates the reverse process using only xtx_t and the step. Ho et al. (2020), §2

Diffusion-LM applies Gaussian diffusion to continuous word-vector representations. The paper demonstrated gradient-based control for selected syntactic and semantic attributes using trained attribute classifiers with a fixed base language model. The gradient steers the denoising trajectory. The results measure the tested controls and models. Li et al. (2022)

The continuous model still needs a map back to discrete words. Diffusion-LM includes a learned word distribution and examines clamping predicted clean representations to word embeddings during sampling. A decoding rule can affect the discrete output even when the continuous denoising trajectory is unchanged.

Discrete diffusion

Replace the Gaussian corruption with a corruption defined directly on the token alphabet. The state is always a well-formed sequence of tokens (possibly including a mask symbol), rounding is unnecessary, and the likelihood is a genuine categorical likelihood over sequences. The forward process becomes a Markov chain over a finite state space, and the model in this chapter uses a product of categorical distributions across positions for each reverse step.

This reframing is the central move. Once the state space is the set of token sequences rather than the set of embedding vectors, every operation is well defined on the object we actually care about. There is no nearest-neighbor projection, no rounding loss, no gap between what the model generates and what it can represent. The price is that the clean Gaussian algebra of the continuous case is replaced by finite-state combinatorics, but, as we will see, the absorbing variant makes that combinatorics almost trivially simple.

Two examples of discrete corruption are uniform replacement and absorbing masking.

Uniform corruption is one option in D3PM (Austin et al., 2021). Its doubly stochastic transition is Qt=(1−βt)I+βt1K11⊤Q_t = (1-\beta_t)I + \beta_t \frac{1}{K}\mathbf{1}\mathbf{1}^\top. With enough noise, visible tokens may be wrong. The reverse transitions must allow a visible token to change into another token.

Absorbing corruption maps a token to a dedicated [MASK] symbol that is outside the clean vocabulary. A masked position stays masked through the remaining forward steps. LLaDA is one example that uses absorbing masks. The reverse process reveals tokens, and the absorbing formulation is the one developed below.

Absorbing noise keeps visible tokens unchanged. This simplifies what each denoising step must predict.

  1. Visible tokens are preserved in forward corruption. Uniform noise can replace a lexical token with another one. Absorbing noise removes the token and records that its value is hidden.
  2. Masked states provide a focused prediction task. D3PM Table 2 reports lower LM1B perplexity with its absorbing kernel than with its uniform kernel at the tested 1,000 steps. That comparison measures the systems and training settings used there. D3PM
  3. The clean-conditioned reverse posterior has small support. If a position is masked and its clean token vv is given, the posterior at the preceding step has support in {m,v}\{m,v\}. The first reverse update back to the clean time must recover vv. A learned reveal distribution spreads mass across the model's candidate lexical tokens when the clean answer is unknown. Uniform corruption can involve a vocabulary-wide KL sum, but its identity-plus-rank-one kernel can be applied without materializing a dense transition matrix. D3PM

BERT selects 15 percent of input positions for prediction and replaces 80 percent of those selected positions with its mask symbol. A masked prediction objective alone does not specify a reverse chain or a sequence likelihood. Here the corruption and reverse transitions define both. BERT, §3.1

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