01Why it matters
Making something out of nothing
Image generators start every picture from pure static: random noise, different every time. Then, in a few dozen small steps, the static turns into a face or a landscape. Nothing in the noise says "face"; the knowledge is in a network that has learned one narrow skill: looking at something noisy and guessing which noise was added.
This lesson shows the whole idea on the smallest possible example: clouds of 2D points instead of pictures, so you can watch every point move.
02Key parts
The pieces you will see
- forward process
- Adding a little Gaussian noise at each step , until the data is indistinguishable from pure noise.
- noise schedule
- How much noise each step adds, . Its running product is how much of the original signal survives to step .
- denoiser
- A neural network that takes a noisy point and the step and predicts the noise in it.
- reverse process
- Generating: start from fresh noise and repeatedly remove a share of the predicted noise, from down to .
03See it work
Destroy the data, then rebuild it
The forward process needs no learning at all. Because Gaussian noise adds up to Gaussian noise, you can jump straight to any step:
As grows, (the signal) falls towards 0 and (the noise) rises towards 1, so every shape ends as the same blob: a standard normal around the origin.
Training is a guessing game built on that formula: take a data point, pick a random and a random , compute , and ask the network for . The loss is . Our denoiser here is a small network with two hidden layers of 48 units, trained once when the site was built.
04Predict
Your turn: follow a point
Before each step, predict where the cloud or the followed point goes next. In the reverse process, use the dashed arrow.
Make 5 predictions: step forward and answer each question before the next step plays.
0 of 5 made05Try it
Why so many steps?
When the noise is large, the guess is poor: a point that is mostly noise could have come from almost anywhere on the shape, so the best guess is a blurry average of all of them, near the middle. Jumping straight to it would land every point in the same place. Instead, each step moves only a little towards the guess and adds a little fresh noise back; at the next step the point is slightly less noisy and the guess slightly better.
Try it with the controls below:
- Change the seed: the generated points are different every time, yet they always land on the shape. They are new samples, not copies of the training points.
- Watch the arrow on the ring: early on it swings around; near the end it is short and steady.
- Compare the shapes: the thin spiral is the hardest, and a few points end up between its arms.
06Check yourself
Check yourself
Question 1 of 6
What does the denoiser network predict?
Your answer comes back in Review in a few days, so it sticks.
Question 2 of 6
Why can training jump straight to any step t instead of noising one step at a time?
Question 3 of 6
What does the cloud look like after the last forward step, whatever shape it started as?
Question 4 of 6
Why does generating take many small steps rather than one big jump to the predicted clean point?
Question 5 of 6
A diffusion model trained on a spiral generates 80 points. What are they?
Question 6 of 6
The denoiser has made its first guess of the clean point from almost pure noise. What does the sampler do next?
07Explain it back
Say it in your own words
How does a diffusion model turn pure noise into a new sample, and why does it need many steps?
08Recap
What to remember
- The forward process adds noise until data becomes ; the closed form jumps to any step.
- A network is trained to predict the added noise from and .
- Generating runs backwards from fresh noise: remove a share of the predicted noise, add a little fresh noise, repeat.
- Many small steps are needed because the denoiser's guess only sharpens as the noise fades.
- Image models do exactly this to every pixel at once, with a far bigger network that also reads a text prompt.