12.2 The Reverse Process
MSE on the noise you added. T reverse steps. Lab 12 uses the oracle mean.
These notes match the lecture slides. Use (slides) on the course hub for the deck.
Generation walks the forward process backward. You start from and, step by step, remove a bit of noise until you have . By the end you should be able to write the noise-prediction loss, take one reverse-step mean, and say what Lab 12’s oracle is replacing.
1. What the diffusion reverse process is
The reverse is: predict the noise you added, take a step toward , repeat times. A net predicts the from note 12.1. Training is ordinary MSE on that noise. Sampling starts from and denoises.
Ho et al. (DDPM) made noise prediction the default parameterization. Predicting is equivalent (up to scaling) to predicting or the score . Pick one parameterization and stay consistent.
You cannot write the true reverse kernel in closed form for images, because it would need the unknown data density. If you knew , the true posterior is Gaussian with a closed-form mean. Lab 12 uses that oracle mean for a single step so you can see the geometry without training a U-Net. A trained is what replaces the known (and therefore the known ) at sample time.
2. Why we use it
MSE on a known is easier than a GAN min-max. There is no discriminator to race. The forward jump from note 12.1 already gave you in one line, so the loss never unrolls a reverse chain.
The cost sits at sample time. You pay network calls (or fewer with DDIM / distilled samplers). That is the trade: stable regression training, slow ancestral sampling. GANs (Week 11) sample in one forward pass and fight mode collapse instead.
For a project, report the sampler (, DDPM vs DDIM) next to the metric. Changing at test time is part of the method. Classifier-free guidance, which steers the same reverse chain with a text condition, is the next note.
3. Architecture
The network is a denoiser that sees a noisy input and a timestep: a U-Net or a DiT on with a time embedding. The same is a different problem at and at , so is an input, not a footnote.
Lab 12 uses an oracle mean so you see the geometry without training. You are not training a U-Net in that lab. You know , so you can form the true posterior mean and check that one reverse step moved closer.

Sampling is an iterative procedure. Start at , apply the reverse-step mean (plus a little noise except at ), and walk down to . Each step is one network call once exists.
4. How it works, step by step
Training is ordinary regression.
- Sample from the data, uniformly from , and .
- Form with the one-liner from note 12.1.
- Predict . Take MSE against the true . No adversary. No reverse chain inside the loss.
Sampling is the reverse walk.
- Draw .
- For , plug into the reverse-step mean below, and add for .
- Return .
If you knew , Lab 12 skips the net and uses the true posterior mean for a single step. The lab check is versus at : the second should be smaller. If (the net refuses to denoise), the subtracted term vanishes and you mostly rescale , which is not a sample from the data.
5. Mathematical formulas
The training loss is
Given and a noise prediction, a typical mean for is
with for , and from the schedule (often ). At a generic you do not jump all the way to ; you move closer. Forgetting on the way down makes every sample look identical.
6. Positive points and negative points
Positive.
- MSE on is ordinary regression, which is easier to stabilize than a GAN min-max.
- Predicting is enough: it is equivalent (under the usual parameterization) to predicting the posterior mean.
- Lab 12’s oracle mean lets you see one reverse step without training a U-Net.
- You can change (or switch to DDIM) at sample time and treat the sampler as part of the method.
Negative.
- Ancestral sampling costs many network calls; quality versus speed is a real knob.
- Omitting as an input makes the same look like one problem at every noise level.
- Dropping collapses diversity: every run hugs the mean.
- Classifier-free guidance, which steers this chain with text, is extra machinery (next note).
When not to. If you need one-pass samples and can live with collapse, that is still a GAN. If you need text control, do not stop at this unconditional reverse chain.
7. Teaching this note
About 35 minutes at the board, then ~6 minutes of video.
- 0–10 min. MSE on . Same formula as 12.1.
- 10–22 min. Write one reverse-step mean. Circle the term.
- 22–33 min. Worked scalar reverse step, then the Lab 12 oracle story.
- Then play Umar Jamil 13:00–16:36 (training loop, then sampling loop). Pause when he draws one denoising step.
8. Worked example
Reuse , , , so as in note 12.1. Take for a single-step cartoon (so , , ).
Suppose exactly, and drop for the mean:
The reverse mean lands on . That is the oracle: if you predict the true noise, one algebraic step peels it off (here , a first-step special case). At a generic you do not jump all the way to ; you move closer. Lab 12 checks vs at and wants the second smaller.
If (the net refuses to denoise), the subtracted term vanishes and you mostly rescale , which is not a sample from the data.
Sampling is an iterative procedure. You pay network calls (or fewer with DDIM). A GAN still samples in one pass and fights collapse instead.
9. Where students get stuck
- Training a U-Net in Lab 12. The lab uses the true posterior mean because you know .
- Omitting as an input to . The same is a different problem at and at .
- Forgetting on the way down and then wondering why every sample looks identical.
10. Video
Watch Umar Jamil, How diffusion models work, 13:00–16:36.
Pause on the training objective (predict the noise) and on the sampling loop (many reverse steps). Same URL as note 12.1; do not replay 7:35–13:00 unless needed.
11. Practice
-
If exactly, what should happen to relative to , in expectation, for mid-range ?
-
Why add on the way down instead of always taking the mean?
-
You may not train a score network in Lab 12. What replaces for that one reverse step?
-
, , , , no extra noise. Compute the reverse mean. (, , .)
-
Training samples uniformly from and one . Why is that enough, instead of a full reverse chain inside the loss?