Search

Search papers and lessons

Progressive Distillation

Level 4 · 11 min read

Progressive distillation makes a diffusion model sample in a few steps by repeatedly training a student to do in one step what its teacher does in two, then making the student the next teacher.

On this page

  • Colour = topic mix
  • Probability
  • Calculus
  • Discrete math
  • Neural network basics
  • Linear algebra
  • Generative models
  • ReadReady to readNot yet

TL;DR

A diffusion model makes a sample by running its denoiser many times, so a good picture can cost hundreds or thousands of network calls. Progressive distillation cuts that cost in rounds. In each round, a student model is trained to reach in one DDIM step the point that its teacher reaches in two. Then the student becomes the new teacher and the process repeats, so the number of steps halves every round.

Builds on: Diffusion Model, DDIM Sampler, Knowledge Distillation · Leads to: Consistency Model, v-Prediction

Where it's used

Interactive image generation. A product that shows a picture while a user waits needs an answer in about a second. A model that takes a thousand steps is too slow for that. A distilled model that takes four or eight steps can meet the budget on one GPU, and the quality gap to the slow teacher is often small enough to accept.

Video generation. A video model denoises a whole clip per step, so each step costs far more than an image step. Cutting the step count is the main lever for making clip generation practical, and distillation is one of the standard ways to do it.

Comparing samplers. Researchers use the same idea to test how many steps a trained model really needs. Distilling a model to fewer and fewer steps and measuring quality at each stage shows where the quality curve starts to fall.

How it works

Take a teacher that samples in NN DDIM steps. The goal is a student that samples in N/2N/2 steps. Here is one training update on one tiny instance, with round numbers chosen for the walkthrough (they are illustrative, not from any model).

  1. Start with a teacher. It is a trained denoiser that, given a noisy point xtx_t and a step tt, predicts the noise. Running it with DDIM takes a point at one noise level to a point at the next level down. Suppose the teacher's DDIM steps move a point from noise level tt to level t−2t-2 in two moves.
  2. Pick a training point. Choose a noise level tt and a noisy point xt=0.6x_t = 0.6. Nothing else about the point matters for this walkthrough.
  3. Ask the teacher for its two-step answer. Run the teacher twice, once from tt to t−1t-1 and once from t−1t-1 to t−2t-2. Suppose the result is z=0.8z = 0.8. Check: the teacher's answer is the target the student has to hit.
  4. Turn that answer into a one-step target. Ask: what clean estimate x^\hat{x}, used in a single DDIM step from xtx_t, lands exactly on zz? The algebra in the next section gives x^=1.0\hat{x} = 1.0. Check: a single step from xt=0.6x_t = 0.6 with x^=1.0\hat{x} = 1.0 does land on 0.80.8.
  5. Let the student predict. The student is a copy of the teacher, initialised to the same weights. Suppose on this point it predicts a clean estimate of 0.90.9. Its one-step output would then be 0.7650.765, not 0.80.8. The squared error on the clean estimate is (1.0−0.9)2=0.01(1.0 - 0.9)^2 = 0.01, and a gradient step pushes the student's prediction toward 1.01.0.
  6. Repeat, then swap roles. After many such updates across many points and noise levels, the student's single step matches the teacher's two steps. The student now has N/2N/2 steps. It becomes the teacher for the next round, which trains a student with N/4N/4 steps, and so on.
flowchart LR
  A["Teacher: N steps"] --> B["Student trained to match 2 teacher steps with 1"]
  B --> C["Student: N/2 steps"]
  C --> D["Becomes teacher"]
  D --> E["Next round: N/4 steps"]

The math

Step 3 in symbols: the teacher's two-step target

Let Φ\Phi denote one deterministic DDIM step of the teacher. Write αˉt\bar\alpha_t for the cumulative noise-retention factor at step tt (from the diffusion model lesson). Starting from xtx_t, the teacher's two-step endpoint is

z=Φ(Φ(xt)),landing at noise level s=t−2.z = \Phi\big(\Phi(x_t)\big), \qquad \text{landing at noise level } s = t-2.

Nothing about zz requires new training. It is a function of the teacher alone.

Step 4 in symbols: the one-step clean-estimate target

A single DDIM step from xtx_t to level ss, using the clean estimate x^\hat{x} and the noise direction implied by it, is

xs=αˉs x^+1−αˉs  xt−αˉt x^1−αˉt.x_s = \sqrt{\bar\alpha_s}\,\hat{x} + \sqrt{1-\bar\alpha_s}\; \frac{x_t - \sqrt{\bar\alpha_t}\,\hat{x}}{\sqrt{1-\bar\alpha_t}}.

Collect the terms in x^\hat{x}. Define a=αˉsa = \sqrt{\bar\alpha_s}, c=αˉtc = \sqrt{\bar\alpha_t}, and b=1−αˉs /1−αˉtb = \sqrt{1-\bar\alpha_s}\,/\sqrt{1-\bar\alpha_t}. Then xs=(a−bc) x^+b xtx_s = (a - bc)\,\hat{x} + b\,x_t. Setting xs=zx_s = z and solving gives the one-step target

x^⋆=z−b xta−bc.\hat{x}^\star = \frac{z - b\,x_t}{a - bc}.

In the walkthrough, αˉt=0.36\bar\alpha_t = 0.36 and αˉs=0.64\bar\alpha_s = 0.64, so c=0.6c = 0.6, a=0.8a = 0.8, and b=0.6/0.8=0.75b = 0.6 / 0.8 = 0.75. Then a−bc=0.8−0.45=0.35a - bc = 0.8 - 0.45 = 0.35, and with z=0.8z = 0.8, xt=0.6x_t = 0.6:

x^⋆=0.8−0.75×0.60.35=0.350.35=1.0.\hat{x}^\star = \frac{0.8 - 0.75 \times 0.6}{0.35} = \frac{0.35}{0.35} = 1.0.

Step 5 in symbols: the training loss

The student x^θ(xt)\hat{x}_\theta(x_t) is trained to predict the target x^⋆\hat{x}^\star by a squared error, weighted by a function of the noise level wtw_t:

L=wt ∥x^⋆−x^θ(xt)∥2.\mathcal{L} = w_t\, \big\| \hat{x}^\star - \hat{x}_\theta(x_t) \big\|^2.

The paper uses a particular weighting, and the walkthrough sets wt=1w_t = 1 so the arithmetic stays visible. The walkthrough gives (1.0−0.9)2=0.01(1.0 - 0.9)^2 = 0.01. Training averages this over sampled points and noise levels, which is ordinary distillation: the teacher's behaviour is the target, and the loss is the squared gap to it. The mean squared error loss is the same kind of quantity.

Step 6 in symbols: the halving schedule

Let the sampler start with a grid of NN steps. After kk rounds the student uses N/2kN / 2^{k} steps. To reach SS steps from NN, the number of rounds is

k=log⁡2NS.k = \log_2 \frac{N}{S}.

This is exact only when N/SN/S is a power of two. Otherwise the grid is chosen so each round halves it as closely as possible.

Worked examples

Example
1. Check the one-step target by hand

Use the numbers from the walkthrough: xt=0.6x_t = 0.6, αˉt=0.36\bar\alpha_t = 0.36, αˉs=0.64\bar\alpha_s = 0.64, and the teacher's two-step endpoint z=0.8z = 0.8.

  1. Compute c=0.36=0.6c = \sqrt{0.36} = 0.6 and a=0.64=0.8a = \sqrt{0.64} = 0.8.
  2. Compute 1−αˉt=0.64=0.8\sqrt{1-\bar\alpha_t} = \sqrt{0.64} = 0.8 and 1−αˉs=0.36=0.6\sqrt{1-\bar\alpha_s} = \sqrt{0.36} = 0.6.
  3. Compute b=0.6/0.8=0.75b = 0.6 / 0.8 = 0.75.
  4. Compute a−bc=0.8−0.45=0.35a - bc = 0.8 - 0.45 = 0.35.
  5. Compute the numerator z−b xt=0.8−0.45=0.35z - b\,x_t = 0.8 - 0.45 = 0.35.
  6. Divide: x^⋆=0.35/0.35=1.0\hat{x}^\star = 0.35 / 0.35 = 1.0.
  7. Check by running the step forward. The noise direction is (xt−c x^⋆)/1−αˉt=(0.6−0.6)/0.8=0(x_t - c\,\hat{x}^\star)/\sqrt{1-\bar\alpha_t} = (0.6 - 0.6)/0.8 = 0. The new point is a⋅1.0+0=0.8=za \cdot 1.0 + 0 = 0.8 = z. The check passes.

Interpretation: the single step is exact when the student predicts the clean value 1.01.0. A student predicting 0.90.9 misses by 0.0350.035 at the new level, and that gap is what the loss is pushing down.

Example
2. Count the rounds for a standard schedule

A teacher samples in N=1024N = 1024 steps, and the goal is S=8S = 8 steps.

  1. The ratio is N/S=1024/8=128N / S = 1024 / 8 = 128.
  2. Write 128=27128 = 2^7, so k=log⁡2128=7k = \log_2 128 = 7.
  3. Check by halving: 1024→512→256→128→64→32→16→81024 \to 512 \to 256 \to 128 \to 64 \to 32 \to 16 \to 8. That is seven arrows, so seven rounds.

Interpretation: the schedule needs seven separate student trainings. Each one is a full training run, so the total cost is the sum over rounds, not just the last one. A short schedule is therefore cheaper per sample but not free to build.

Example
3. A realistic latency budget

Suppose one network call takes 0.20.2 seconds on a given GPU (an illustrative figure). A teacher with 100100 steps then needs 100×0.2=20100 \times 0.2 = 20 seconds per image. A student distilled to 44 steps needs 4×0.2=0.84 \times 0.2 = 0.8 seconds.

  1. Speedup: 20/0.8=2520 / 0.8 = 25.
  2. A product that must answer in about 11 second is therefore within reach with the distilled model and out of reach with the teacher.
  3. The quality question is separate. The speedup says nothing about how close the 44-step samples are to the 100100-step ones, and that has to be measured on held-out data.

Try it: a 256256-step teacher is distilled down to 22 steps, and each call takes 0.20.2 seconds. How long does the student take, and how many rounds does distillation need? Answer: 2×0.2=0.42 \times 0.2 = 0.4 seconds. The ratio 256/2=128=27256 / 2 = 128 = 2^7, so 77 rounds.

Common mistakes and tradeoffs

It is tempting to think a distilled model is just a faster copy of the teacher that behaves the same; in fact it is a different function trained to match the teacher only at the points the training sees. The student can be wrong on rare noise levels or prompts that the sampling schedule rarely visits, because nothing in the loss pushes it there. Measure quality across the full range of steps you plan to use.

It is tempting to think each round costs little because it only halves the steps; in fact each round is a full training run that must cover all noise levels, and errors compound. A student that is slightly off becomes the next teacher, and its mistakes become the next round's target.

It is tempting to think more rounds always help; in fact the quality curve usually falls off as the step count drops, and past some point the extra rounds give worse samples than the round before. The right stopping point depends on the quality target and the latency budget.

When to use it: you have a good teacher, you need few-step sampling, and you can afford the training runs. When not to use it: you only need a few samples offline, or you cannot afford to train, since the teacher's own sampler is then cheaper overall. Alternatives: training a consistency model directly, which learns to map any noise level to the clean endpoint, and using a better sampler such as DDIM with fewer steps and no training at all.

History

Samplers for diffusion models were slow from the start, because the first working versions walked the reverse chain one step at a time through the Denoising Diffusion Probabilistic Models (DDPM) process. In 2020 Song, Meng and Ermon showed that the same trained network could be sampled along a deterministic path with fewer steps, which made step-skipping practical without retraining. That work is the DDIM sampler this lesson builds on.

Distilling a teacher into a smaller student had been known since Hinton, Vinyals and Dean's 2015 paper, which used soft targets from a large model. Salimans and Ho combined the two ideas in 2022, in work presented at ICLR that year. Their contribution was the round structure: each round halves the step count, and the student of one round is the teacher of the next. It caught on because it needed no change to the trained architecture and produced few-step samplers from models that already existed.

Recap

  • A diffusion sampler is slow because it makes one network call per step.
  • DDIM lets a trained model be sampled along a shorter path, so fewer steps are possible without retraining.
  • Distillation trains a student to match a teacher's output, here the teacher's two steps in one student step.
  • Repeating the halving turns a long schedule into a short one, one round at a time, and the student of each round becomes the next teacher.
  • Read next: Consistency Model for a direct route to few-step sampling, and v-Prediction for the parameterisation used in many distilled models.

Check yourself

QuestionIn one sentence, what does one round of progressive distillation train the student to do?Show answer

The student is trained so that one DDIM step from a noisy point lands where the teacher's two DDIM steps land. Because the student then needs half as many steps, each round halves the sampling schedule.

QuestionA teacher samples in 512512 steps and is distilled to 44 steps by halving. How many rounds are needed?Show answer

The ratio is 512/4=128=27512 / 4 = 128 = 2^7, so 77 rounds are needed. Halving from 512512 goes 256,128,64,32,16,8,4256, 128, 64, 32, 16, 8, 4, which is seven halvings.

QuestionWhy can a distilled student be wrong on noise levels that the sampling schedule rarely visits, even if its loss is low on the levels it was trained on?Show answer

The loss is averaged over the points the training samples, so it only constrains the student where those points fall. Nothing in the objective forces the student to match the teacher at other noise levels, so errors can remain there and show up when those levels are used at sampling time.

QuestionA product must return an image within one second, and one network call takes 0.1 seconds. Is a 40-step teacher fast enough, and would a 4-step student be?Show answer

A 4040-step teacher takes 40×0.1=440 \times 0.1 = 4 seconds, which is too slow. A 44-step student takes 4×0.1=0.44 \times 0.1 = 0.4 seconds, which fits the budget. Whether the student is good enough also depends on its measured quality, not only its speed.

Sources