Few-step generation: progressive distillation, consistency models and adversarial distillation
Before this lesson: lesson 08 (-prediction, error amplification, EDM's and ), lesson 09 (DDIM, the probability-flow ODE, the Gaussian toy, the number of function evaluations NFE), lesson 10 (rectified flow and reflow; not repeated here) and lesson 11 (classifier-free guidance doubles the NFE). Time: about 80 minutes, plus the notebook.
Why this matters #
A diffusion sampler costs (number of network evaluations, NFE) × (cost of one evaluation). A good ODE solver needs 10–50 NFE (lesson 09), and classifier-free guidance doubles that (lesson 11). For one image this is fine. For real-time image generation, for video, or for a weather ensemble with hundreds of members per forecast, it is not.
Few-step methods spend extra training compute to cut sampling compute to 1–4 NFE. Products such as SDXL-Turbo, latent consistency models and InstaFlow are built this way. Each method fails in its own way: blur, a quality ceiling set by the teacher, or lost diversity. In science, lost diversity means an ensemble that is too narrow, with extremes that are too rare. So you must know which failure to test for.
1. Predict first #
2. The picture #
One deterministic map from noise to data #
The probability-flow ODE (PF-ODE) maps each noise sample to one data sample (lesson 09). We use the variance-exploding (VE) form of lesson 08: with and noise level . With the denoiser , the PF-ODE is
A sampler starts at a large and solves this ODE down to . It replaces the true path by many short solver steps. Each step is accurate only locally, because the path bends.
The simplest case: one data point #
If the data is a single point , then for every input. The ODE becomes , whose solutions are straight lines into : . One Euler step from any noise level lands exactly on . Few-step sampling is trivial.
Two data points: the path bends #
Now let the data be or with equal probability. The posterior weights of the two points are proportional to , so the denoiser is
At high noise, is small and : the denoiser cannot tell which point a sample came from, so it predicts the mean. A path first moves toward . When the noise is small enough to decide, it bends toward or . One large Euler step follows the first direction and lands near : an average of the two modes, not a sample.
Change the number of Euler steps and the start value. The magenta curves are exact PF-ODE paths, from noise on the right to the blue data points on the left. The orange polyline is the Euler sampler with equal steps in , from the yellow start. With two data points and , every sample lands near : the share of samples within of a data point is . With it is close to the exact ODE. Switch to one point: the paths are straight lines, and one step is already exact. The denoiser is exact, not learned.
Multimodal data bends paths, and bent paths need many steps. This is the core problem. Real data (images, weather fields) has a huge number of modes, so the bends are everywhere.
Data with equal probability, VE form. One Euler step of the PF-ODE goes from to . Where does it land?
An Euler step from to gives : the step lands on the denoiser output, the posterior mean. At the posterior is almost , so . It is not exactly , because makes slightly more likely. It is far from : one step averages the two modes.
Four ways out #
- Learn a longer step. Train a student whose one step equals two teacher steps. Repeat (progressive distillation).
- Learn the end point. Train a network that maps any point of a path to its end (consistency model).
- Straighten the paths. Re-pair noise and data with the model's own map and retrain (reflow, lesson 10).
- Give up the path. Train a one-step generator whose outputs have the data distribution, with a discriminator or a score-based divergence (adversarial or distribution-matching distillation).
The first three keep (approximately) the PF-ODE map from a noise seed to a sample. So inversion (finding the seed of an image) and editing still work. The fourth only matches the distribution, so a seed no longer gives the teacher's sample.
3. Definitions and main results #
The DDIM step with an -prediction #
Deterministic DDIM (, lesson 09) goes from time to an earlier time . It uses the prediction and the noise it implies, :
In words: keep the predicted clean part and the predicted noise, and mix them with the coefficients of time .
Theorem 1 (the progressive-distillation target) #
Let a teacher take two DDIM steps from and arrive at . The student prediction for which one DDIM step also arrives at is
Proof.
- One DDIM step with prediction gives .
- Move the terms without to the left: .
- The bracket is positive. It equals , and is larger at the less noisy time . Divide by it.
Why this target is easier than . The usual target is random given : many data points could have produced . So the best regression output is their average , which is blurry (lesson 08). The target is a deterministic function of (two deterministic teacher steps). So the student can fit it exactly. Salimans and Ho call this a "sharp" prediction.
The halving procedure (Salimans and Ho 2022, Algorithm 2).
- Train a teacher in the usual way (cosine schedule ), with an output that stays stable at low SNR: , or (see below).
- Copy it: student . The student will take steps on the grid .
- Repeat: draw , and . Set , , . Run two teacher DDIM steps from . Compute (Theorem 1). Minimize .
- The student becomes the teacher (), and . Go to step 2.
Costs: two teacher calls and one student call per example. Salimans and Ho used 50k updates per round (100k for the 2- and 1-step rounds), starting from 8192 (CIFAR-10) or 1024 steps. Reaching 4 steps costs about as much as training the original model, and no synthetic data set is needed. The top time has , so the student sees pure noise, exactly as at test time. Results on CIFAR-10 (FID, lower is better; lesson 14): 2.57 at 8 steps, 3.00 at 4, 4.51 at 2, 9.12 at 1. Quality holds down to 4–8 steps and then degrades.
Choose the number of student steps , from 64 down to 1. Top: the sampler map from the start noise to the output . The magenta band is the 64-step DDIM teacher. The orange dots are the distilled student with steps. Here each round fits its target exactly, so the student reproduces the teacher with halving rounds. The grey dashed curve is plain DDIM with the same steps and no distillation. At it outputs for every start. Bottom: the Wasserstein-1 distance between the output and the data. Plain DDIM gets worse as falls; the ideal student stays at the teacher's value. Look at the readouts: the student's first prediction is not the posterior mean, it is the teacher's end point. The denoiser is exact, not learned. A real student adds a small fitting error in each round.
Why -prediction breaks, and what replaces it #
- Error amplification. From , the clean estimate is , so an -error is multiplied by (lesson 08). Each halving moves the student's inputs toward low SNR. A 1-step student is only evaluated at .
- No information at SNR 0. At the input is . Predicting is then trivial and says nothing about ; is .
- Zero weight where it matters. The -loss equals (lesson 08, Theorem 2). At it puts zero weight on the only step a 1-step model takes.
- Fixes (Salimans and Ho, section 4). Predict directly; or predict and in two output channels and merge them; or predict , which gives and never amplifies errors. Use a loss weight that stays positive at SNR 0: "truncated SNR" , or "SNR + 1" (the -loss). In units the three weights are (), and .
Why can a 1-step progressive-distillation student not use -prediction with the usual -loss?
All targets share one optimum (Tweedie, lesson 08), so the third option is wrong. The problem is at the single noise level a 1-step student sees: . There the -output carries no information about , any error is multiplied by , and the loss ignores . - or -prediction with a positive weight fixes all three.
Consistency models (Song, Dhariwal, Chen and Sutskever 2023) #
Use the VE form with the EDM settings of lesson 08: , , . (Song et al. write for and for .)
- Consistency function. : the end point of the PF-ODE path that passes through at noise level .
- Self-consistency. for any two points of the same path.
- Boundary condition. .
- Parameterization. with
These are EDM's coefficients (lesson 08) shifted by , so that and . The boundary condition then holds for every network , and stays differentiable in .
- Sampling. One step: draw and output . Multistep (their Algorithm 1): for decreasing levels , add noise again, , and apply . Each extra step trades one NFE for quality.
Move the yellow point with the two top sliders. The bold magenta path passes through it. The violet dashed lines show the consistency map: the point and the yellow rings on the same path all map to one end, at . Now change the step . In CD mode the teacher takes one Euler step to and lands at the orange point, slightly off the path; its own end differs, and the squared gap is the CD loss term. Halve : the gap falls by a factor of 4 or more, because the local error of Euler is . Switch to CT mode: there is no teacher, and the partner with the same noise depends on the unknown (the bar shows standard deviation; with two data points, the ring size shows the probability). Its mean equals the Euler point. Bottom: and ; at they are exactly 1 and 0. The paths use the exact denoiser, not a learned one.
In a consistency model, which choice makes hold for every network ?
With and , , whatever outputs. A penalty only makes it hold approximately. EDM's unshifted coefficients give and , so they miss the condition slightly; this is why Song et al. shift them by .
Consistency distillation (CD) #
Take the grid (the Karras grid with of lesson 09; on CIFAR-10) and a pretrained score model .
- Draw from the data, and .
- One teacher solver step back to . With Euler and : (Heun is better).
- Loss: , with a distance (squared , or LPIPS) and .
- is a stop-gradient exponential moving average of (a target network, as in DQN and BYOL): .
The PF-ODE in score form is the same ODE as before: Tweedie gives , so .
Theorem 2 (zero CD loss gives the teacher's consistency function) #
This is Song et al., Theorem 1. Assume is -Lipschitz for every , the teacher's solver has local error with for step size , the weight , the distance satisfies , and the CD loss is zero with . Let be the consistency function of the teacher's PF-ODE and . Then
Why this is true (intuition). The boundary condition fixes the error to at . Zero loss says that each grid level copies the next lower one, through one solver step. So the error at a level is the error one level down plus one local solver error. Adding up local errors of size gives , exactly as for the global error of an ODE solver.
Proof (along one teacher path with exact points )
- Let . The boundary condition gives , because both terms equal .
- Zero loss: the density of is positive everywhere and , so at every point. Hence , where is one solver step from . Self-consistency of gives .
- Subtract the two equations: .
- Lipschitz and local error: the bracket is at most .
- Sum the steps: .
Two consequences. The boundary condition anchors the argument: without it, a constant has zero loss. And CD can at best reproduce the teacher's ODE, so the teacher sets a quality ceiling. Results on CIFAR-10: FID 3.55 at 1 step and 2.93 at 2 steps (progressive distillation: 8.34 and 5.58 in the same comparison).
Consistency training (CT): no teacher #
Replace the teacher score in step 2 by the one-sample estimate . It is unbiased given , because (Tweedie, lesson 08). With , the Euler step becomes
So CT compares two points that share the same noise : .
- Song et al. prove (their Theorem 2) that for an exact teacher score with Euler steps (assuming and are twice continuously differentiable with bounded second derivatives). The CT pair is a noisy estimate of the ODE step: right on average, but with variance.
- Small (large steps) means low variance but high bias; large the opposite. CT therefore grows during training (a curriculum). CIFAR-10: FID 8.70 at 1 step.
- Improved CT (Song and Dhariwal 2023): without the moving average, the pseudo-Huber distance instead of LPIPS, log-normal sampling of noise levels, and doubling on a schedule. CIFAR-10: FID 2.51 at 1 step, better than CD. Without a teacher there is no teacher ceiling.
| CD | CT | |
|---|---|---|
| needs | pretrained diffusion model | data only |
| pair for the loss | ODE step of the teacher | same noise at two levels |
| quality ceiling | the teacher's ODE (Theorem 2) | none from a teacher |
| main difficulty | teacher cost per step | variance of the target, schedule |
What is the main difference between consistency distillation (CD) and consistency training (CT)?
Both use the same parameterization with the boundary condition, and both compare at two adjacent levels. CD needs a teacher score for the ODE step, so it is capped by the teacher. CT replaces the teacher score by the one-sample estimate ; the resulting pair is an unbiased but noisy Euler step. The second option swaps the two methods.
Continuous-time consistency models and flow maps
- Continuous-time CMs (Lu and Song 2024, sCM): let ; the loss then needs the time derivative of along the path, computed with a Jacobian–vector product. With stabilized training they scaled to 1.5B parameters and reached a 2-step FID of 1.88 on ImageNet , within 10% of the best diffusion models of that time.
- Flow maps. A consistency function jumps from to . A flow map jumps from any time to any other time along the ODE. Consistency models, progressive distillation and "mean-flow" models (2025) are special cases or relatives. They can be trained by self-distillation, without a separate teacher (see the Boffi video below).
Adversarial distillation, distribution matching and reflow #
- Adversarial diffusion distillation (ADD, Sauer et al. 2023; SDXL-Turbo). The student starts from the teacher. Its loss is a hinge GAN loss (lesson 05) with a discriminator made of frozen DINOv2 ViT-S features and small trainable heads (R1 penalty), plus a distillation loss. For the distillation loss, add noise to the student's output, let the teacher denoise it, and pull the student's output toward the teacher's result (a form of score distillation). It gives sharp images in 1–4 steps. The authors report lower sample diversity than the teacher.
- Distribution matching distillation (DMD, Yin et al. 2024): a one-step generator whose KL gradient is the difference of two scores (the teacher's, and a score model fitted to the generator's own samples), plus a regression loss.
- Latent consistency models (LCM, Luo et al. 2023): consistency distillation in the latent space of Stable Diffusion (lesson 13), with classifier-free guidance built into the teacher ODE; 2–4 steps.
- Reflow (lesson 10). Simulate the current flow to get noise–data pairs , then retrain flow matching on these pairs. Transport costs do not increase and paths become straighter; then distill into one step. On CIFAR-10, a 1-rectified flow sampled with one Euler step has FID 378; 2-rectified flow plus distillation reaches 4.85. InstaFlow (Liu et al. 2024) applies reflow and distillation to Stable Diffusion: one step, FID 23.3 on MS COCO 2017-5k (progressive distillation: 37.2), for 199 A100 GPU-days.
Comparison (as of 2024).
| method | needs | objective | typical failure |
|---|---|---|---|
| progressive distillation | teacher, rounds | regress onto two teacher steps | blur at 1–2 steps |
| consistency distillation | teacher, target network | self-consistency of adjacent ODE points | capped by the teacher |
| consistency training | data only | same, with a shared-noise pair | sensitive to the schedule and to |
| adversarial distillation | teacher, discriminator | GAN loss + score distillation | lost diversity, GAN instability |
| reflow + distillation | generated pairs | flow matching on the model's coupling | cost of the pairs, accumulated errors |
The general pattern: regression objectives blur at 1–2 steps. They average a multimodal target that the student cannot fit exactly. Distribution-level objectives are sharp but mode-seeking: they lose diversity.
A team replaces a 4-step consistency model by a 1-step adversarially distilled model. Images are sharper. What should they check first, and what has the new model given up?
Distribution-level objectives give sharp samples but tend to drop modes, so recall and spread can fall while sharpness rises. FID mixes fidelity and diversity in one number (lesson 14). The adversarial student also gives up the PF-ODE correspondence: the same seed no longer gives the teacher's sample, so inversion and seed-based editing break.
Answers to section 1. (1) Near : one Euler step from to lands on , the posterior mean, not a data point. (2) rounds. (3) A constant, for example : it is consistent everywhere. The boundary condition , built into and , rules it out.
4. Worked example #
(a) A progressive-distillation target. 1-D data with . The teacher is the exact denoiser (VP, level with coefficients ). Three levels: with , with , with . Start at .
- Teacher at : .
- DDIM to : .
- Teacher at : .
- DDIM to : .
- Target: , so .
- Check: one DDIM step with gives ✓. One step with the teacher's own gives only .
- The exact PF-ODE solution at : in VE coordinates with , the Gaussian-toy paths are (lesson 09). Here goes from to , so . The student copies the teacher's two-step error ( instead of ). This is why distillation starts from a teacher with many steps.
- Note that is larger than the posterior mean : the student's prediction is "sharper" than the average.
(b) Error amplification. At (, ), an -error of becomes an -error of . A -error of becomes an -error of .
(c) A consistency function in closed form. Same Gaussian data, now in the VE form. The PF-ODE is , with solutions . So
- From at : .
- The same path passes at , and : self-consistency ✓.
- Coefficients: , ; , ; , . At high noise the output is almost all network.
- One Euler step of CD from to with the exact score: . The exact ODE point is . A perfect CD fit would map to instead of : the local solver error enters the target, as in Theorem 2. Smaller steps (larger ) or Heun shrink it.
- A CT pair with , : . Given at , , so the expected CT point is . This is exactly the Euler point ✓.
5. In code #
NumPy and SciPy check the worked example: Theorem 1, the consistency function of the Gaussian toy, the CT pair as a noisy Euler step, and why one-step regression blurs. The notebook has these cells and the exercises.
import numpy as np
from scipy.integrate import solve_ivp
# (a) Theorem 1 on the Gaussian toy N(0, 0.5^2), VP levels (a, sigma).
sd = 0.5
teacher = lambda x, a, s: a * sd**2 * x / (a**2 * sd**2 + s**2) # E[x0 | x_t]
ddim = lambda x, x0, a, s, a2, s2: a2 * x0 + s2 * (x - a * x0) / s
(a0, s0), (a1, s1), (a2, s2) = (0.6, 0.8), (0.8, 0.6), (0.96, 0.28) # t, t', t''
xt = 1.0
x_mid = ddim(xt, teacher(xt, a0, s0), a0, s0, a1, s1) # teacher step 1
x_end = ddim(x_mid, teacher(x_mid, a1, s1), a1, s1, a2, s2) # teacher step 2
r = s2 / s0
target = (x_end - r * xt) / (a2 - r * a0) # Theorem 1
print(f"{x_mid:.4f} {x_end:.4f} {target:.4f}") # 0.8219 0.5690 0.2920
print(f"{ddim(xt, target, a0, s0, a2, s2):.4f}") # 0.5690: one student step
print(f"{ddim(xt, teacher(xt, a0, s0), a0, s0, a2, s2):.4f}") # 0.5041: one teacher step
# (c) Consistency function of the Gaussian toy, VE form, and self-consistency.
s_min = 0.002
D = lambda x, s: sd**2 * x / (sd**2 + s**2)
ode = lambda s, x: (x - D(x, s)) / s
f_cf = lambda x, s: x * np.sqrt(sd**2 + s_min**2) / np.sqrt(sd**2 + s**2)
path = solve_ivp(ode, (80.0, s_min), [40.0], t_eval=[80.0, 10.0, 1.0, 0.1], rtol=1e-10, atol=1e-12)
print(np.round([f_cf(x, s) for x, s in zip(path.y[0], path.t)], 6)) # [0.249997 0.249997 0.249997 0.249997]
c_skip = lambda s: sd**2 / ((s - s_min)**2 + sd**2)
c_out = lambda s: sd * (s - s_min) / np.sqrt(sd**2 + s**2)
print(c_skip(s_min), c_out(s_min), f"{c_skip(1.0):.4f} {c_out(1.0):.4f}") # 1.0 0.0 0.2006 0.4463
# CT: given x_t1, the partner x0 + t0 z is random; its mean is the exact-score Euler point.
rng = np.random.default_rng(0)
t1, t0, x_t1 = 1.0, 0.5, 1.0
post_sd = np.sqrt(sd**2 * t1**2 / (sd**2 + t1**2)) # std of x0 | x_t1
x0 = D(x_t1, t1) + post_sd * rng.standard_normal(1_000_000)
z = (x_t1 - x0) / t1
ct = x0 + t0 * z
print(f"{ct.mean():.3f} {x_t1 + (t0 - t1) * ode(t1, x_t1):.3f} {ct.std():.3f}") # 0.600 0.600 0.224
Why one-step regression blurs: data , the exact ODE map (what a consistency model must learn) against the best one-step regression onto (the posterior mean at ):
import numpy as np
from scipy.integrate import solve_ivp
s_min, s_max = 0.002, 80.0
D = lambda x, s: np.tanh(x / s**2) # E[x0 | x] for data -1 or +1
ode = lambda s, x: (x - D(x, s)) / s
rng = np.random.default_rng(0)
x_T = rng.choice([-1.0, 1.0], 2000) + s_max * rng.standard_normal(2000)
f = solve_ivp(ode, (s_max, s_min), x_T, method="LSODA", rtol=1e-8, atol=1e-10).y[:, -1]
reg = D(x_T, s_max)
print(f"ODE map: mean |x| = {np.abs(f).mean():.3f}, share > 0 = {(f > 0).mean():.3f}")
print(f"regression: mean |x| = {np.abs(reg).mean():.3f}, max |x| = {np.abs(reg).max():.3f}")
# ODE map: mean |x| = 1.000, share > 0 = 0.482 -> samples at -1 and +1
# regression: mean |x| = 0.010, max |x| = 0.040 -> every "sample" sits near the data mean 0
6. Where it shows up #
- Text-to-image products. SDXL-Turbo (adversarial diffusion distillation, 1–4 steps), latent consistency models and LCM-LoRA (2–4 steps), InstaFlow (reflow and distillation, 1 step). Many distilled models fold classifier-free guidance into the student (guided distillation, LCM), so each step costs one network call instead of two.
- Ensembles in science. The sampling cost is members × steps × calls per step. Weather ensembles (GenCast samples each member with a diffusion model) and hazard studies that need thousands of realizations per scenario are exactly this case.
- The science failure mode. A sharper, mode-seeking student gives an under-dispersed ensemble: too little spread, extremes too rare. After any distillation, check calibration again with rank histograms, the spread–skill ratio and recall (lesson 14), not only a sample-quality score.
- Inverse problems. Consistency models allow zero-shot inpainting and super-resolution (Song et al., section 3). Guidance methods that need many small steps (lesson 15) fit less well with 1–2 steps.
- Practice. Before you retrain, try a better solver: Heun or DPM-Solver at 10–20 NFE needs no training (lesson 09).
7. Common mistakes #
- Distilling with -prediction and the -loss weight. The weight is zero at SNR 0 and errors are amplified by . Use or with a truncated-SNR or SNR + 1 weight.
- Dropping the boundary condition. Without , , a constant function has zero consistency loss.
- Expecting a distilled student to beat its teacher. Progressive distillation and CD approximate the teacher's sampler or ODE (Theorem 2). Only teacher-free methods (CT) or methods with an extra data signal (adversarial losses on real data) can exceed it.
- Comparing 1-step FIDs without context. Report the teacher, the NFE of every method, and the training distance. LPIPS in training can bias an evaluation with Inception-based features (one reason improved CT replaced it).
- Many rounds of reflow. Each round needs a new generated set of pairs and fits model output, so errors accumulate. Use one or two rounds, then distill.
- Judging a fast model by sharpness alone. Check diversity (recall, ensemble spread). A GAN-type loss can collapse modes.
8. Check yourself #
- VP levels : and : . From the teacher's two
DDIM steps reach . Compute the student target and check it.
Answer
. . Check: ✓. - Why can the student fit sharply, when a network trained on predicts a blurry average?
Answer
Given , the target is random (many data points are consistent with ), so the squared-loss optimum is . The target is a deterministic function of (two deterministic teacher steps), so zero error is possible. - With and , compute and
. Why must ?
Answer
; . With and , for every network . The boundary condition then holds by construction. It rules out the constant solution and anchors the error bound of Theorem 2. - Show that the consistency-training pair is an Euler step of the PF-ODE with a one-sample score estimate.
Answer
With , the estimate is . Euler: . Since is the true score, the CT point equals the exact-score Euler point on average. - A team needs 1,000-member ensembles; today each member costs 25 steps with classifier-free
guidance. What does a 4-step distilled model with guidance folded in save, and what must they check?
Answer
calls against : 12.5 times fewer. They must check that the ensemble is still calibrated (rank histograms, spread–skill ratio), that extremes and spectra match held-out data, and diversity (recall). First they should compare with a training-free solver at 10–20 NFE. - On CIFAR-10, one Euler step of a 1-rectified flow gives FID 378, but 2-rectified flow plus
distillation gives 4.85. Explain.
Answer
With the independent coupling of noise and data, the marginal paths are curved. One Euler step follows the initial velocity, an average direction, and lands near conditional means (blur). Reflow retrains on the model's own deterministic coupling, which makes the paths much straighter (lesson 10), so a one-step distilled student can match the map.
Why do multimodal data distributions need many PF-ODE solver steps?
At high noise the denoiser predicts the mean of the modes, so paths first head to the mean and then bend toward one mode; a large step follows the first direction and lands between the modes.
Data , VE form. Where does one Euler step from to land?
On the denoiser output , the posterior mean (near at high noise).
What is the idea of progressive distillation?
Train a student whose one DDIM step equals two teacher DDIM steps, then make the student the new teacher and repeat, halving the number of steps each round.
Give the progressive-distillation target .
, where is the teacher's two-step result.
Why does a 1-step distilled student need - or -prediction?
At the input is pure noise: is trivial, divides by 0, and the -loss gives weight to .
Define the consistency function of a PF-ODE.
: the end point of the PF-ODE path through at level ; it is the same for every point of one path.
How do consistency models enforce the boundary condition ?
with and (EDM coefficients shifted by ).
What pair of points does consistency training compare, and why does it work?
and with the same noise ; this is an Euler step with the one-sample score estimate, equal to the exact-score step on average.
Name two few-step families that keep the seed-to-sample map.
Progressive distillation and consistency models (also reflow); they follow the PF-ODE map.
What do adversarial and distribution-matching distillation give up?
The seed-to-sample correspondence with the teacher (and so inversion), and often diversity: they are sharp but mode-seeking.
9. Interview angle #
- "How would you make a diffusion model 10× faster at inference?" — First a better solver (training-free, 10–20 NFE). Then distillation: progressive or consistency distillation to 4–8 steps; adversarial or distribution matching for 1–2 steps. Measure quality and diversity at equal NFE.
- "Derive the progressive-distillation target." — Write one DDIM step with prediction , set it equal to the teacher's two-step result, solve (Theorem 1).
- "Why can't you distill an -prediction model to one step?" — At SNR 0 the input is pure noise, is trivial, divides by , and the -loss weight on is SNR = 0.
- "What is a consistency model, and how is the boundary condition enforced?" — A map from any point of a PF-ODE path to its end; , .
- "CD or CT?" — CD needs a teacher and is capped by it; CT needs only data, has a noisier target and needs an curriculum; improved CT beat CD on CIFAR-10.
10. Practice #
The notebook for this lesson has five exercises, each with a check cell and a folded solution:
- Write an Euler sampler for the PF-ODE and show that one step on two-point data lands near , while many steps land on .
- Write the progressive-distillation target and check that one student step equals two teacher DDIM steps on the Gaussian toy.
- Write the closed-form consistency function of the Gaussian toy and check self-consistency and the boundary condition against a numerical ODE solution.
- Consistency training without a teacher: build CT pairs with shared noise and fit a small parametric consistency model, level by level, on two-mode data; sample in one step.
- Plot NFE against error for plain DDIM and for an ideal distilled student on the Gaussian toy.
11. Watch and read #
- Salimans and Ho, Progressive Distillation for Fast Sampling of Diffusion Models (ICLR 2022): section 3 and Algorithm 2 (the procedure), section 4 (parameterizations, truncated-SNR and SNR + 1 weights), Table 1 (ablation), Appendix G (the target).
- Song, Dhariwal, Chen and Sutskever, Consistency Models (ICML 2023): section 3 (definition, Algorithm 1), section 4 (Theorem 1, Algorithm 2), section 5 (Theorem 2, Algorithm 3), Appendix C (the boundary-condition coefficients).
- Song and Dhariwal, Improved Techniques for Training Consistency Models (2023).
- Lu and Song, Simplifying, Stabilizing and Scaling Continuous-Time Consistency Models (2024).
- Sauer, Lorenz, Blattmann and Rombach, Adversarial Diffusion Distillation (2023).
- Yin et al., One-step Diffusion with Distribution Matching Distillation (CVPR 2024).
- Liu et al., InstaFlow: One Step is Enough for High-Quality Diffusion-Based Text-to-Image Generation (ICLR 2024).
- Reference code: openai/consistency_models
(
cm/karras_diffusion.py:get_scalings_for_boundary_condition,consistency_losses,progdist_losses). - Sander Dieleman, The paradox of diffusion distillation (2024): a clear tour of distillation methods and of the question "where does the free lunch come from?".
Runs in your browser with nothing to install. The notebook repeats the key demos and has exercises with checks; solutions are inside, folded.
No Google account needed: Python runs inside your browser. The first start downloads about 40 MB; your changes are saved in this browser only.