distillation / lessons / 04 · consistency models lesson 4 / 6

Consistency models

Progressive distillation halves the steps one slow round at a time. Consistency models change the target: learn a function that jumps from anywhere on a trajectory straight to its origin — trained in a single run.

The limitation we’re escaping

Progressive distillation (lesson 03) is serial: ~10 dependent training rounds to reach 1–2 steps, and the 1-step result is still soft. The reason is that each round only ever learns to double a stride — it never learns the destination directly. Consistency models (Song et al. 2023) ask for the destination outright, but constrain the problem so that asking is learnable.

The self-consistency idea

Recall the probability-flow ODE (generative lesson 16): every noisy point xt sits on exactly one deterministic trajectory that flows down to a clean sample x0 at t=0. Define a network fθ(xt, t) whose job is to output that endpoint — the origin of whatever trajectory xt is on. Two requirements pin it down:

x₀ (t=0) x_T (noise) every point on the PF-ODE trajectory maps to the same origin x₀ — that constraint is the model

A function satisfying both is a one-step sampler: feed it xT∼N(0,I) and it returns fθ(xT,T) ≈ x0 in a single call.

The loss: adjacent points must agree

You can’t enforce “maps to x0” directly — you don’t know x0 for a given trajectory. But you can enforce that two adjacent points on the trajectory agree, and let the boundary condition anchor the chain. Take a sample, noise it to a step tn+1, take one solver step back to tn, and require the network’s outputs at the two points to match:

LCD = 𝔼   d( fθ(xtn+1, tn+1),   fθ(x̂tn, tn) )

where tn is one ODE step from xtn+1 (using the teacher’s score), d is a distance (L2 or LPIPS), and θ is an EMA copy of the weights — a frozen target that updates slowly, exactly like the target network in deep RL, to stop the “match yourself” objective from collapsing to a trivial constant.

The intuition: a bucket brigade to the origin

You can’t teach everyone the address of the destination directly. So you teach each person only to hand the bucket to the next person down the line and agree on what’s in it. The person standing at the destination (the boundary condition, t=0) knows the truth. Because every adjacent pair agrees, and the chain is anchored at the end that knows, the agreement propagates all the way up: everyone ends up reporting the true destination. Consistency training is that propagation, run by gradient descent over all adjacent pairs at once.

Two ways to get the trajectory: distillation vs. training

Consistency Distillation (CD)Consistency Training (CT / iCT)
where x̂tn comes fromone step of a pretrained teacher’s ODE solveran unbiased one-step estimate using the known forward noise — no teacher at all
needs a teacher?yes (a trained diffusion model)no — trains from scratch
qualityhigher (rides a good teacher)improved CT (iCT, Song & Dhariwal 2023) closed most of the gap

This is the diffusion echo of lesson 02’s WHERE knob: CD is off-policy on the teacher’s trajectories (white-box, needs the teacher); CT generates its own targets from the forward process (no teacher). Same axis, new setting.

One step isn’t free: multistep consistency

A single jump from pure noise asks the network to resolve all the ambiguity at once, and the L2/LPIPS target still pulls toward an average — so 1-step consistency samples are good but not teacher-quality. The fix is cheap: multistep sampling. Jump to x̂₀, re-noise to an intermediate t, jump again. 2–4 alternations of (jump, re-noise) recover most of the quality, which is why “few-step” (not strictly one-step) is the production sweet spot — the same shape as lesson 17’s step-count curve, but starting from a far better one-step point.

LCM and CTM: the variants you’ll meet

Interactive · self-consistency vs. a raw one-step regressor

Two one-step maps from noise to the two-moons data. The consistency map (oracle) sends each noise point down its PF-ODE trajectory to the true origin — the cloud lands on the moons. The naive x̂₀-at-T regressor predicts the conditional mean from pure noise — the L2-optimal but blurry average, which collapses toward the data center. Then add re-noise rounds and watch the consistency sampler sharpen toward the data as 1→2→4 steps.

One-step consistency vs. one-step mean-regression, and the multistep recovery
Green = data. Blue = consistency map (follows the trajectory to the true origin). Red = naive x̂₀-from-noise (blurry conditional mean). Slide the step count: consistency sharpens onto the moons; the naive regressor stays a blob.
consistency spread (std)
naive 1-step spread
data spread
Takeaway
A consistency model is a network forced to map every point on a PF-ODE trajectory to that trajectory’s origin — pinned by a hard boundary condition at t=0 and an EMA-stabilized “adjacent points must agree” loss, so one network call jumps from noise to image. Consistency distillation rides a teacher’s ODE (off-policy, white-box); consistency training needs no teacher. One step is good-not-great because the L2 target still averages, so 2–4 (jump, re-noise) rounds are the real sweet spot. LCM puts all this in SD’s latent space with guidance folded in; CTM generalizes the jump to any-to-any. Next: stop matching trajectories at all — match the distribution.