Few-Step Generation
Progressive distillation, consistency models and adversarial distillation.
A diffusion sampler spends tens to hundreds of network evaluations on one image, twice that with guidance. Yet the probability-flow ODE already defines a deterministic map from noise to data, so one evaluation would do if a network could learn that map. Distillation, consistency and adversarial training are three ways to learn it, and each pays in a different currency: training cost, a little quality, or diversity.
What you’ll learn
- Explain why a single coarse ODE step fails and what a one-step generator must learn instead: the flow map of the probability-flow ODE.
- Derive the progressive-distillation target that makes one student DDIM step match two teacher steps, and explain why it needs - or -prediction.
- Define consistency models, prove the error bound for consistency distillation, and explain how consistency training removes the teacher.
- Derive the distribution-matching gradient as a difference of two scores, and compare adversarial and distribution-matching distillation in quality, diversity and cost.
The map a one-step generator must learn
Sampling cost is the number of network evaluations (NFE) times the cost of one evaluation, doubled by classifier-free guidance. The best ODE solvers of The Design Space of Diffusion Models need tens of evaluations, and simply taking fewer, larger steps fails. In EDM's coordinates the ODE is , so a single Euler step from pure noise to returns , the denoiser's answer at maximal noise, which is close to the dataset mean for every starting point. A coarse step averages over all the trajectories it should be choosing between.
The exact probability-flow ODE, though, defines a deterministic flow map that carries a point at noise level along its trajectory to level . Flow maps compose, , and pushes the starting noise forward to the data distribution, up to the teacher's errors. It is a perfectly good one-step generator; it is just not available in closed form. Every method in this lesson is a way to learn it, or to learn a different map with the same output distribution.
The most direct approach is regression. Luhman & Luhman (2021) generated pairs of starting noise and final ODE output with a trained teacher and fitted a student in one step, reaching sample quality comparable to GANs of the time on CIFAR-10 and CelebA without adversarial training. Its costs are the reasons for everything that followed: every training pair needs a full teacher solve, and an intricate map is hard to fit in one shot.
Progressive distillation
Progressive distillation (Salimans & Ho, 2022) splits the problem into easy pieces: teach a student to do in one deterministic DDIM step what the teacher does in two, then make the student the next teacher and repeat, halving the number of steps each round. Here the noisy sample is with data , continuous time and (so in the notation of Diffusion Models), and a DDIM step from to an earlier with clean-image prediction is .
For a student with steps, pick and let the teacher take two DDIM steps, through to :
A single student step from to with prediction lands at . Set it equal to the teacher's and solve for :
Train the student, initialized as a copy of the teacher, with the usual weighted regression but this target in place of the data:
The target is a deterministic function of given the teacher. The original training target, the data , is not: many images could have produced , and the regression returns their blurry average. The student can therefore afford sharp predictions, which is what lets it take larger steps.
Progressive distillation starts from a teacher that samples in 1,024 steps. How many rounds of halving produce a 4-step student?
Show the answer
8
, so 8 rounds. Salimans & Ho trained 50,000 updates per round (100,000 for the 2- and 1-step rounds), and the total cost of distilling down to 4 steps was comparable to or below that of training the original model. On CIFAR-10, starting from 8,192 steps, they reached FID 3.0 with 4 steps.
Parameterization matters. Each round evaluates the student at lower signal-to-noise ratios, and the last rounds start from pure noise, . There noise prediction breaks down: divides by zero, the input says nothing about , and the -loss, which equals , gives that case zero weight. Salimans & Ho therefore predicted directly, or a mix of and , or with (Continuous Flows & Flow Matching shows is a velocity), with weights or on , and they trained so that the last time index has SNR exactly zero.
Results and limits. The distilled models stayed near the teacher's quality down to 4 or 8 steps and degraded faster at 2 and 1, while undistilled DDIM and stochastic samplers degraded sharply below about 128 steps. Guidance distillation (Meng et al., 2023) applies the same idea to classifier-free guidance: first a student that takes the guidance weight as an input learns to output the guided combination in one evaluation, then progressive distillation cuts its steps, giving 1 to 4 steps for latent text-to-image models.
Why can a progressive-distillation student make sharper predictions than the model it was copied from?
- It is a larger network
- Its target is fully determined by through the teacher's deterministic steps, whereas the original target is uncertain given , so the original regression averages over possibilities
- It is trained with an adversarial loss
- It sees the clean data at test time
Show the answer
B. Its target is fully determined by through the teacher's deterministic steps, whereas the original target is uncertain given , so the original regression averages over possibilities
A squared-error regression returns the conditional mean of its target. For the original model that mean averages many clean images; for the student, the target is a single deterministic point, the endpoint of two teacher steps, so the optimum is sharp and larger steps become possible.
Consistency models
Consistency distillation (CD) enforces self-consistency between neighboring noise levels of an EDM-style grid. Draw a data point and noise it to ; take one ODE-solver step with a pretrained teacher's score to get on (nearly) the same trajectory; and minimize for a metric (squared , or LPIPS), where is a stop-gradient copy of , originally an exponential moving average of it. Without the boundary condition, the constant function would be perfectly self-consistent; with it, consistency propagates the identity at up the whole trajectory.
Let along an exact trajectory. Noised data have positive density everywhere, so zero loss forces , and the true is constant along the trajectory:
The solver step lands within its local error of the true point, and is Lipschitz:
The boundary condition makes . Summing the recursion, each term is at most , and the step lengths add up to :
Consistency training (CT) removes the teacher. Its only role was the score in the ODE step, and Tweedie's formula gives an unbiased estimate, . Substituting it, the two points become the same data point noised with the same noise at the two levels, and Song et al. proved that for Euler steps and an exact teacher the distillation loss equals the training loss up to . The grid is refined during training: coarse grids give low-variance but biased targets early, fine grids nearly unbiased ones later.
import torch
import torch.nn.functional as F
sigma_data, sigma_min = 0.5, 0.002
def consistency_fn(net, x, sigma):
s = sigma.view(-1, *[1] * (x.dim() - 1))
c_skip = sigma_data**2 / ((s - sigma_min)**2 + sigma_data**2) # = 1 at sigma_min
c_out = sigma_data * (s - sigma_min) / (sigma_data**2 + s**2).sqrt() # = 0 at sigma_min
c_in = 1 / (sigma_data**2 + s**2).sqrt()
return c_skip * x + c_out * net(c_in * x, sigma)
def ct_loss(net, x0, sigmas): # sigmas: increasing grid, sigmas[0] = sigma_min
n = torch.randint(0, len(sigmas) - 1, (x0.shape[0],))
lo, hi = sigmas[n], sigmas[n + 1]
z = torch.randn_like(x0) # the same noise at both levels
pred = consistency_fn(net, x0 + hi.view(-1, *[1] * (x0.dim() - 1)) * z, hi)
with torch.no_grad(): # target branch: no gradient
target = consistency_fn(net, x0 + lo.view(-1, *[1] * (x0.dim() - 1)) * z, lo)
return F.mse_loss(pred, target)Consistency training with a stop-gradient target, as in the improved recipe. Song & Dhariwal (2024) also replaced squared error by a Pseudo-Huber loss and drew noise levels from a log-normal distribution. A one-step sample of a batch of is consistency_fn(net, sigma_max * torch.randn(B, *dims), torch.full((B,), sigma_max)).
The numbers moved fast. The original paper reached one-step FID 3.55 on CIFAR-10 with distillation (2.93 in two steps) and 6.20 on ImageNet (4.70 in two), but only 8.70 on CIFAR-10 with consistency training. Improved consistency training (Song & Dhariwal, 2024) traced a flaw in the theory to the running-average teacher and removed it, swapped LPIPS for Pseudo-Huber losses, used a log-normal noise distribution and doubled the grid size at set intervals: one-step FID 2.51 on CIFAR-10 and 3.25 on ImageNet (2.24 and 2.77 in two steps), better than distillation, with no teacher at all. Lu & Song (2025) stabilized continuous-time consistency models and scaled them to 1.5 billion parameters on ImageNet , with two-step FID 1.88, within about 10% of the best diffusion models. Latent consistency models (Luo et al., 2023) distill the guided probability-flow ODE of Stable Diffusion in its latent space, giving 2 to 4 step text-to-image generation from 32 A100 GPU-hours of training.
Matching distributions: score differences and discriminators
A one-step generator does not have to reproduce the teacher's map, only the teacher's distribution of outputs. Write for the distribution of , , and for the target. The reverse KL divergence between them has a gradient that needs only scores.
Write the divergence as an expectation over the generator's input:
Differentiating gives two terms: the explicit dependence of the density on , whose expectation vanishes, and the dependence through the sample point:
What remains are the two scores at the generated point, contracted with the generator's Jacobian:
pulls samples toward high data density; spreads them out. Neither clean score is available, and where one distribution has no mass the other's score says nothing. Distribution matching distillation (DMD; Yin et al., 2024) therefore noises the generator's samples to a random level , takes from the frozen teacher and from a second diffusion model trained online on the generator's own samples.
The same two-score gradient had appeared as variational score distillation for text-to-3D generation (Wang et al., 2023), which inspired DMD. Minimizing is mode-seeking: a generator that covers only part of the data pays little. In DMD's own two-mode example, the distribution-matching loss alone recovered only the nearer mode, so DMD added a regression loss toward the teacher's outputs on a fixed set of noise–image pairs. It reached FID 2.62 on ImageNet in one step and 11.49 zero-shot on COCO, generating 20 images per second with half-precision inference. DMD2 (Yin et al., 2024) dropped the expensive regression set, stabilized training by updating the fake-score model more often than the generator, and added a GAN loss against real images, which lets the student surpass its teacher: one-step FID 1.28 on ImageNet .
Adversarial diffusion distillation (ADD; Sauer et al., 2024) initializes the student from a pretrained diffusion model, gives it noisy inputs at a few fixed levels including pure noise, and combines two losses. A discriminator built from a frozen pretrained vision transformer (DINOv2 features worked best) with small trainable heads, conditioned on the text and image embeddings, supplies a hinge adversarial loss. A distillation loss, weighted by 2.5, noises the student's output, lets the teacher denoise it, and pulls the student toward the teacher's denoised estimate. ADD-XL, distilled from SDXL, generates images in a single step, and in the authors' user studies outperformed other few-step methods in one step and matched SDXL in four (Style-Based Generators places this among the uses of GANs today).
| Approach | What the student matches | Teacher | Steps | Main risk |
|---|---|---|---|---|
| Direct or progressive distillation | the teacher's ODE map, in one shot or two steps at a time | yes | 4–8 best; 1–2 degrade | cost of teacher sampling; blur at 1–2 steps |
| Consistency distillation / training | self-consistency along ODE trajectories | CD yes, CT no | 1–2, more by re-noising | training sensitive to grids, metrics and weights |
| Distribution matching (DMD, DMD2) | the output distribution, via a difference of scores | yes, plus an online fake-score model | 1–4 | mode-seeking; needs a regression or GAN term |
| Adversarial (ADD) | the output distribution, via a discriminator, plus teacher denoising | yes | 1–4 | adversarial losses can drop modes |
| Reflow (Continuous Flows & Flow Matching) | a straightened ODE whose Euler steps are nearly exact | the previous flow | 1–few, often then distilled | each round must simulate the previous flow |
Key takeaways
- A coarse ODE step returns the denoiser's average answer; a one-step generator must instead learn the ODE's flow map , or another map with the same output distribution.
- Progressive distillation trains a student whose single DDIM step reproduces two teacher steps, with target , halving the steps each round; it needs - or -prediction because late rounds start from pure noise.
- Consistency models learn with the boundary condition built in; zero distillation loss gives error for a -th order solver, and consistency training replaces the teacher by the same noise at two levels.
- The reverse-KL gradient is , estimated with two diffusion models on noised samples (DMD); it is mode-seeking, so DMD adds regression and DMD2 a GAN loss, while ADD combines a pretrained-feature discriminator with teacher denoising.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
What does the boundary condition of a consistency model rule out?
- Multistep sampling
- Trivial self-consistent solutions such as a constant function, which would satisfy without generating anything
- Lipschitz networks
- Training without a teacher
Show the answer
B. Trivial self-consistent solutions such as a constant function, which would satisfy without generating anything
Self-consistency alone is satisfied by any function that is constant along trajectories, including one constant everywhere. Pinning the function to the identity at forces the shared value along each trajectory to be that trajectory's endpoint.
DMD evaluates both scores on generator samples after adding noise to them. Why?
- To make the generator's samples more diverse at test time
- Because the noise replaces the regression loss
- To make the loss cheaper to compute
- Clean real and generated distributions may not overlap, so a score can be undefined or uninformative where the other has mass; noise makes both full-support, and the teacher only provides scores of noised data anyway
Show the answer
D. Clean real and generated distributions may not overlap, so a score can be undefined or uninformative where the other has mass; noise makes both full-support, and the teacher only provides scores of noised data anyway
The gradient uses at the generated points. Noising both distributions to a level spreads them over the whole space, so both scores exist everywhere, and a diffusion model is exactly an estimator of such noised scores.
You take a single Euler step of the probability-flow ODE from pure noise all the way to . Where do the samples land?
- On exact samples from the data distribution, just less accurately placed
- Nowhere in particular: the step diverges
- On the training images nearest to each starting point
- On the denoiser's estimate at maximal noise, close to the dataset mean, for every starting point
Show the answer
D. On the denoiser's estimate at maximal noise, close to the dataset mean, for every starting point
With , one Euler step to zero returns , which barely depends on the starting point. The step averages over trajectories instead of following one, as the widget's single-step pile shows.
Why did progressive distillation move away from -prediction?
- -prediction is slower to compute
- It cannot be used with DDIM
- Distillation evaluates the model at ever lower SNR, down to pure noise, where blows up and the -loss gives zero weight
- -prediction makes the student copy the teacher exactly
Show the answer
C. Distillation evaluates the model at ever lower SNR, down to pure noise, where blows up and the -loss gives zero weight
At small errors in are amplified by in the implied image, and at predicting the noise from the noise is trivial and uninformative. Predicting , a mix of and , or keeps the implied image stable.
Further reading
- T. Salimans & J. Ho, "Progressive distillation for fast sampling of diffusion models," ICLR (2022).
- Y. Song, P. Dhariwal, M. Chen & I. Sutskever, "Consistency models," ICML (2023).
- Y. Song & P. Dhariwal, "Improved techniques for training consistency models," ICLR (2024).
- T. Yin, M. Gharbi, R. Zhang, E. Shechtman, F. Durand, W. T. Freeman & T. Park, "One-step diffusion with distribution matching distillation," CVPR (2024).
- A. Sauer, D. Lorenz, A. Blattmann & R. Rombach, "Adversarial diffusion distillation," ECCV (2024).