Diffusion Models
Turn data into noise one small step at a time, learn to undo each step, and you can turn fresh noise into new data. Watch data fan out into a Gaussian, see why the endpoint of a Riemann sum suddenly matters, drag a set across an empirical distribution, and find out why a perfectly trained model would only copy its training set while a smoothed one creates points between them.
Built from the notes and meetings of the Random Training Points project, which studies Z. Chen, “On the Interpolation Effect of Score Smoothing in Diffusion Models” (ICLR 2026). Background follows J. Ho, A. Jain and P. Abbeel, “Denoising Diffusion Probabilistic Models” (NeurIPS 2020), and Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon and B. Poole, “Score-Based Generative Modeling through Stochastic Differential Equations” (ICLR 2021). The weight-decay result is from P. Savarese, I. Evron, D. Soudry and N. Srebro (COLT 2019). Results from the paper are labelled with its numbering; the questions and examples are written for this page. For how this subject connects to the others, see the roadmap.
From data to noise and back
Sampling a new, realistic image directly is hard; sampling Gaussian noise is easy. A diffusion model connects the two. It adds noise to real data, step by step, until nothing but noise is left, and learns to undo each step. To generate, it draws fresh noise and runs the learned undoing backwards.
The idea
Write
Show the computation
After two steps,
The noise from step 1 has been shrunk once more by step 2. Continuing the same way, each step multiplies everything so far by
The
A mean-zero Gaussian with variance
Each step multiplies the influence of
The factor
Training data. Take a clean image
Explore
Worked example
Constant schedule
After 10 steps, how much of
is left, and how much noise? , so . The two clean values have become two overlapping bumps centred at , each with standard deviation 0.81.After 50 steps?
: . The data contribute a shift of to a unit-variance Gaussian: essentially pure noise.Check that the variance never changed.
for every . The process trades signal for noise without changing the overall scale.
Check your understanding
Which part of a diffusion model is learned?
- The noising process.That is a fixed recipe: shrink and add Gaussian noise.
- The denoiser, trained on pairs of (noisy, clean) examples made by the noising process.
Why multiply by
- It keeps the variance at 1, so the endpoint is the fixed law
rather than noise of ever-growing size. - Without it the result wouldn't be random.It would still be random, just with variance growing with
.
Two different starting noise vectors usually generate two different images. Where does that variety come from?
- From the random starting noise (and any noise added during sampling); the denoiser maps each one to a plausible image.
- From randomness inside the trained network.A trained network is a fixed function.
Practice
Unroll the recursionInduction
Show that
Solution
If it holds for
From steps to an SDEHeuristic limit
Let
Solution
Integrating against noise
An SDE
The idea
Riemann sums, endpoints and all. For an ordinary smooth function,
The sum of squared increments does not vanish: each Split A sum whose mean is Show the computation
Explore
Check your understanding
Why does the endpoint matter for
- The difference is
; for smooth paths . - Brownian motion is discontinuous.Its paths are continuous, just very rough.
The left-endpoint (Itô) sum has mean zero. Why?
is independent of the next increment , which has mean zero.- Because
has mean zero.The right-endpoint sum also uses , and its mean is .
Practice
The telescoping trickWhere ½(W² − t) comes from
Show
Solution
Expand
Empirical distributions and the score
A model never sees the data distribution, only finitely many examples. To say what it is trained on, we need the empirical distribution of those examples, which is easy to understand as a function on sets and awkward as a density. Noise turns it into something smooth, and the denoiser learns its score.
The idea
Why densities are awkward here.
which is exactly the law of
Show the computation
The score is
using
Explore
Worked example
Two training points,
Compute
. . Since , the common factors cancel and .Evaluate the score at
, . , so the score is : a strong push toward .What does the score look like as
? , so the score approaches : pointing to the nearest training point, with a jump of size at the midpoint 0. That jump is the subject of the next module.
Check your understanding
You have 4 samples. Which values can
- Any number in
.It counts samples: only multiples of .
For a single point
but .- They are equal.A continuous law gives each single point probability zero.
Why do diffusion models learn the score
- The sampler only needs the score, and the score doesn't depend on the unknown normalizing constant of
. - The score is always smaller than the density.Not true, and not the reason.
Memorization, and how smoothing creates new points
If a diffusion model learned the empirical score perfectly, it would only ever reproduce its training data. Yet trained models do produce new samples. Chen's paper explains one mechanism in a setting simple enough to solve exactly: the network can't afford the empirical score's sharp jumps, and the smoothed version it learns instead sends some noise to points between the training data.
The idea
The perfect fit is useless. Plug the exact empirical score into the backward flow
Two points. Take
- if
(region A) or (region B), it ends exactly on the training point or ; - if
(region C), it ends at , strictly between them.
How much is new? Only the Gaussian tails that reach region C become new samples. For small starting time this fraction is about
Not early stopping. Stopping the exact flow before
Explore
Worked example
What is region C at
? : the interval .Where do the points
and end up? is in C: it ends at , a new point. is in region B: it ends exactly on the training point .About what fraction of the samples are new?
A sample from
lands in region C when : more than , one standard deviation, to the right of . That has probability (minus a tiny chance of overshooting past ), and the same holds for . The figure\'s stats show the simulated fraction.
Check your understanding
Why does the exact empirical score only reproduce the training points?
- It is the exact score of the noised training set, so running the flow backward exactly undoes the noising of that set.
- Because the network is too small.The exact empirical score is what a perfect fit would give, however large the network.
Why must the smoothing window shrink like
- The noised data live within about
of each training point, so only a window of that size keeps the fitting loss at a fixed level. - To make the curvature finite.Any
makes it finite.
How is smoothing different from simply stopping the exact flow early?
- Early stopping leaves blur around each point in every direction; smoothing puts samples exactly on the segment between the points.
- There is no difference.Compare the supports: a neighbourhood of the points versus the segment joining them.
Practice
The middle regionSolve the ODE
In region C the backward flow is
Solution
Counting the new massGaussian tails
Show that for small
Solution
A sample from