4.5.11 · D1Generative Models

Foundations — Denoising diffusion probabilistic models (DDPM)

2,833 words13 min readBack to topic

This page assumes you have seen the parent DDPM note and want every symbol in it explained from the ground up. We build the alphabet before we read the sentence. By the end, none of the parent's notation should look like hieroglyphics.


1. What is "data" here — the symbol

Picture a single pixel as a dot whose brightness is a number between (black) and (white). A whole image is just many such numbers side by side. Writing them bold, , lets us talk about the entire image with one letter instead of letters.

Figure s01 (below): what "image = vector" means. The left panel shows a tiny image; each cell holds one brightness number (printed on it). The magenta arrow shows us flattening it row by row into the single long list on the right. That list is the object every DDPM formula operates on.

Figure — Denoising diffusion probabilistic models (DDPM)

The subscript on is a clock reading, not a pixel index:

  • = the original clean image (time zero), normalized to unit variance.
  • = the same image after steps of noise added.
  • = fully noised, being the last step (e.g. ).

So is one image getting progressively destroyed.


2. Randomness — the symbol and the bell curve

The "static" we add is not any old randomness; it is Gaussian (bell-curve) noise. We must earn that symbol.

Figure s02 (below): the shape of . Two bell curves are drawn. The magenta one is narrow (); the orange one is wide (). The violet dashed line marks the shared centre . Notice both peak at the centre and fade symmetrically outward — "drawing a random number" means throwing a dart under a hill, landing near the peak most of the time. The width of the hill is controlled entirely by .

Figure — Denoising diffusion probabilistic models (DDPM)

Why Gaussian and not, say, uniform noise? Two reasons the topic needs it:

  1. Adding two Gaussians gives another Gaussian (they combine cleanly) — this is the property that lets the parent note jump from to any in one shot.
  2. A neural net can describe a Gaussian with just two outputs (centre + spread), so each tiny denoising step is easy to model.

The bold version:

When is a whole image (many numbers), the centre is also a whole image (bold), and the spread becomes a matrix . In DDPM the spread is always :

The semicolon in just reads: "the bell curve, evaluated at , that is centred at with spread ."


3. The dials — , ,

We now earn the three scheduling symbols before we use them in the reparameterized noising formula.

Figure s03 (below): the variance budget over time. The magenta curve is the signal fraction ; the orange curve is the noise fraction ; together they always fill the box up to the violet dashed line at height . Read left to right: at the image is pure signal; by it is pure noise; and at every intermediate step the two shaded areas stack to exactly — the total spread never changes. That constant- line is the whole point of normalizing (Section 1).

Figure — Denoising diffusion probabilistic models (DDPM)

(multiply all) versus (capital sigma, "add them all") — the parent uses both; appears in the training loss where we add up errors over steps (Section 6).


4. The noise-adder — and the reparameterization trick

Now that exists, the parent's headline formula is legible.

The magic move the parent uses everywhere:

Read left to right: shrink the clean image by , then add static scaled by .

Cover the limits:

  • At : , so — untouched image. ✓
  • As : , so — pure static. ✓
  • In between: a smooth blend, signal fading, static rising, total spread constant at .

5. Probability grammar — , , , and the bar


6. The measuring sticks — , ,


7. Where the pieces live in the bigger picture

The network that eats a noisy image and predicts its static is a U-Net. The whole "corrupt-then-learn-to-reverse" philosophy is the same latent-variable idea as Variational Autoencoders (VAE), and the variational lower bound is inherited from it. Steering generation toward a prompt is Classifier-free guidance; running the whole diffusion inside a compressed space is Latent diffusion models. Prefer the Hindi-English walkthrough? See 4.5.11 Denoising diffusion probabilistic models (DDPM) (Hinglish).

The map below reads top to bottom as a dependency chart: each arrow means "you need this before that." Follow it as a study order.

  • The three inputs on the left — the vector (Section 1), the Gaussian (Section 2), and the schedule (Section 3) — all feed the forward process .
  • The Markov property (one-step memory) also feeds and is what makes the reverse posterior usable.
  • The forward process gives us the reparameterized jump to any , which feeds the reverse posterior, which — together with the expectation/norm and KL measuring sticks (Section 6, KL borrowed from the VAE bound) — collapses into the simple "predict " loss.
  • That loss, plus the U-Net playing the role of , is what DDPM training and sampling run on.

Vector x - image as numbers

Forward process q

Gaussian N mu sigma2

Variance schedule beta alpha alphabar

Reparameterization xt from x0

Reverse posterior needs x0

Markov chain - one step memory

Expectation and squared norm

Simple loss predict epsilon

KL divergence

VAE variational bound

DDPM training and sampling

U-Net epsilon-theta


Equipment checklist

Test yourself — reveal only after you have answered aloud.

What does bold mean, and what does the subscript track?
The clean image written as one flat list of pixel numbers; the subscript is a clock (step count), not a pixel index.
Why must be normalized to unit variance?
So the noising process keeps total variance pinned at exactly ; otherwise the "signal fraction + noise fraction = 1" budget breaks.
In , which symbol is the centre and which is the spread?
is the centre, (variance) is the spread; is its square root.
Why do we track variance rather than in the formulas?
Variances of independent randomness simply add; plain standard deviations do not.
What is and where does it come from?
A fresh sample of standard static from , one value per pixel.
State the reparameterized forward equation.
.
What are , , ?
= noise variance added at step ; = signal fraction kept per step; = signal fraction surviving after steps.
Why do the scale factors carry square roots?
So the squared (variance) contributions sum to , keeping total spread constant.
What does the bar in mean?
"Given / conditioned on" — the right side is known and fixed.
Difference between and ?
= fixed forward noising; = learned reverse denoising with weights .
Why is intractable but easy?
The former secretly needs the whole data distribution; conditioning on makes it a plain Gaussian.
What does compute and how do we estimate it?
The average over randomness; estimated by averaging over a mini-batch of samples.
What does measure?
Total squared, pixel-by-pixel error between true and predicted noise.
What does measure and why does it collapse to a squared distance here?
Mismatch between two distributions; for equal-variance Gaussians it reduces to squared distance between their means.