12.1 The Forward Process
Jump to x_t in one shot. α-bar from 1 to 0. The kernel is not learned.
These notes match the lecture slides. Use (slides) on the course hub for the deck.
A diffusion model learns to denoise. The forward process is not learned. You add Gaussian noise on a schedule until the sample is almost prior noise. Training later asks a net to predict that noise. By the end you should be able to write and , jump to any in one line, and say why that jump is nicer to train than a GAN min-max.
1. What the diffusion forward process is
Diffusion (DDPM) destroys a sample with Gaussian noise on a schedule, then later learns to reverse it. Start from data . A variance schedule (small at first, larger later) defines a Markov chain . At you still have the data. At you have nearly isotropic noise.
The forward kernel is fixed. There is no in . You do not have to simulate every hop. The marginal is a closed-form Gaussian that interpolates from data to noise, so you can jump to any in one shot.
In code that jump is one line: sample and mix it with using . Training (note 12.2) samples a random , draws , forms in one shot, and asks a net to guess . You never need to walk unless you want a picture of the path.
2. Why we use it
GANs fight a min-max. Diffusion trains a denoiser with MSE. The kernel is not learned, so there is no discriminator to race. The training signal at each is a denoising regression against a known .
Coverage is not automatic, but you are not playing an adversarial game. That is the trade this week is for. You still have to pick and . Sampling will be a reverse chain (note 12.2), which is slower than one GAN forward pass.
Likelihood-related bounds exist for this family in a way they do not for a vanilla GAN. You do not need the ELBO on the board today. You need: the forward process is a fixed noising schedule, and that is why the loss can be ordinary regression.
3. Architecture
The architecture of this note is a Markov chain, not a U-Net. (The net arrives in note 12.2.) A variance schedule or, equivalently, falling from near 1 to near 0, defines
The Markov step is . The marginal is closed form, so training never has to unroll the chain.

starts near 1 (the point is still itself) and falls toward 0 (the point is almost ). Linear, cosine, and learned are all ways to spend more steps where structure dies. Too fast a schedule and early is already junk; too slow and you waste capacity on near-copies of .
(often 1000 in image papers) is a discretization. Lab 12 uses a small in 2-D so you can plot the path. Print , , : they should fall.
4. How it works, step by step
The whole point of this note is that you can skip the chain at train time.
- Choose a schedule and precompute and .
- Take a clean sample (Lab 12: a 2-D point).
- Draw a timestep (training will draw it at random) and a noise .
- Form in one shot. Do not loop .
- Hold and for the reverse note: the net will be asked to guess .
If , then . If , then . Mid-range is a mix: more noise than signal once is no longer close to 1. Same arithmetic in Lab 12 with a vector and a vector . The square roots are scalar; they multiply every coordinate.
5. Mathematical formulas
The one-step kernel and the closed-form marginal are
The reparameterization you type in code is
That one-liner is why the loss never walks .
6. Positive points and negative points
Positive.
- The forward kernel is fixed, so the training target is a known rather than a moving adversary.
- You can jump to any with one Gaussian draw, which makes training a single MSE later.
- The schedule is inspectable: print , , and watch them fall.
- The same algebra runs in Lab 12’s 2-D points and in image DDPMs.
Negative.
- The forward process is the easy half. Reverse sampling (note 12.2) is slow: you pay many network calls.
- A too-fast crashes in a few steps and the net never sees a lightly noised .
- A too-slow schedule wastes capacity on near-copies of the data.
- This is not a GAN: you gave up one-pass sampling in exchange for a stable regression.
When not to. If you need a sample in one forward pass and you can live with coverage bugs, that is still a GAN (Week 11).
7. Teaching this note
About 35 minutes at the board, then ~6 minutes of video. First of three Week-12 notes.
- 0–12 min. Markov step vs closed-form marginal. Write and .
- 12–22 min. The one-line reparameterization. Draw mixing with .
- 22–33 min. Worked scalar step. Change from 1 to 0 and watch .
- Then play Umar Jamil 7:35–13:00 (forward/reverse cartoon, then the math of ). Pause on the closed-form .
8. Worked example
Take a 1-D point and a draw . Then
At you already sit at : more noise than signal. At you have thrown away; is just .
Same arithmetic in Lab 12 with a vector and a vector . The square roots are scalar; they multiply every coordinate.
You can jump to any without simulating for . That is why training is a single Gaussian draw, not a loop of length .
Pick a noise level, corrupt , then learn to undo a bit. The closed-form jump is why the loss never walks .
9. Where students get stuck
- Simulating all Markov steps at train time. You sample and use .
- Mixing up , , and . Write the three definitions every time.
- Setting every huge. Then crashes in a few steps and the net never sees a lightly noised .
10. Video
Watch Umar Jamil, How diffusion models work, 7:35–13:00.
Pause on the forward process (no ) and the closed-form jump to . Skip the U-Net coding (after ~16:30) in this class. Note 12.2 continues the same video at the training/sampling chapters.
11. Practice
-
If , what is ? If , what is ?
-
Why can you sample in one line instead of looping steps of ?
-
A classmate sets every . What goes wrong in the first few ?
-
, , . Compute . (, .)
-
, . Compute .