A DDPM takes a clean picture and, in many tiny steps, sprinkles random static onto it until it is pure noise — then it trains a neural network to run that process backwards , removing a little static at a time. If the network can reliably undo one small step, then starting from pure static and repeating the undo-step many times conjures a brand-new picture out of nothing .
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.
x — a data point as a list of numbers
A bold x means "a whole picture written as one long list of numbers." A grayscale 28 × 28 image is 784 numbers; each number is one pixel's brightness. We stack them into a single arrow (a vector ).
Picture a single pixel as a dot whose brightness is a number between − 1 (black) and + 1 (white). A whole image is just many such numbers side by side. Writing them bold, x , lets us talk about the entire image with one letter instead of 784 letters.
Figure s01 (below): what "image = vector" means. The left panel shows a tiny 4 × 4 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 x = [ 0.9 , 0.2 , 0.6 , 0.1 , 0.3 , … ] on the right. That list is the object every DDPM formula operates on.
Intuition Why a vector and not a grid?
Every operation the parent note does — add noise, scale by a number, subtract a prediction — is done to each pixel independently and identically . So the grid shape is irrelevant to the math; a flat list is cleaner. We only reshape back to a grid to look at it.
Definition Normalized data — we assume
x 0 has zero mean and unit variance
Before anything else, we rescale each image so its pixel values are centred near 0 and have variance 1 (in practice, pixels are mapped into [ − 1 , 1 ] and treated as roughly unit-variance). This normalization is a precondition of the whole DDPM math: it is what lets the noising process keep the total variance pinned at exactly 1 (Section 4). Without it, the tidy "signal fraction + noise fraction = 1" budget would not hold.
The subscript on x is a clock reading , not a pixel index:
x 0 = the original clean image (time zero), normalized to unit variance.
x t = the same image after t steps of noise added.
x T = fully noised, T being the last step (e.g. T = 1000 ).
So x 0 → x 1 → ⋯ → x T is one image getting progressively destroyed.
The "static" we add is not any old randomness; it is Gaussian (bell-curve) noise. We must earn that symbol.
N ( μ , σ 2 ) — the bell curve
N names the Normal (Gaussian) distribution : a recipe for random numbers that clump around a centre and thin out symmetrically on both sides. It takes two settings:
μ (mu) — the centre the numbers cluster around.
σ 2 (sigma-squared) — the variance , how spread out they are. Big σ 2 = wide fuzzy cloud; tiny σ 2 = tight spike.
Figure s02 (below): the shape of N . Two bell curves are drawn. The magenta one is narrow (σ = 1 ); the orange one is wide (σ = 2 ). The violet dashed line marks the shared centre μ = 0 . 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 σ .
σ vs σ 2 — spread vs spread-squared
σ (standard deviation ) is the typical distance from the centre, measured in the same units as the data. σ 2 (variance ) is that distance squared. We track σ 2 in formulas because variances of independent randomness simply add — squared distances stack neatly, plain distances do not.
Why Gaussian and not, say, uniform noise? Two reasons the topic needs it:
Adding two Gaussians gives another Gaussian (they combine cleanly ) — this is the property that lets the parent note jump from x 0 to any x t in one shot.
A neural net can describe a Gaussian with just two outputs (centre + spread), so each tiny denoising step is easy to model.
When x 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 β I :
I and β I — "same independent noise on every pixel"
I is the identity matrix : a diagonal of 1 s, zeros elsewhere. Multiplying by β I means "give every pixel its own bell-curve noise of variance β , with no pixel's noise linked to another's." Picture 784 separate dart-throws, one per pixel, all using the same-width hill.
The semicolon in N ( x ; μ , Σ ) just reads: "the bell curve, evaluated at x , that is centred at μ with spread Σ ."
We now earn the three scheduling symbols before we use them in the reparameterized noising formula.
β t — how much static to add at step t
β t (beta) is a small positive number, 0 < β t < 1 , chosen by us for each step. It is the variance of the fresh noise injected at step t . Small β t = gentle step; larger β t = harsher step. The whole list β 1 , … , β T is the variance schedule , e.g. linearly rising from 0.0001 to 0.02 .
α t = 1 − β t — how much of the signal survives one step
If β t is the fraction of "new noise," then α t = 1 − β t is the fraction of the "old signal" kept. Close to 1 early on (barely touched), smaller later (mostly noise).
α ˉ t = ∏ s = 1 t α s — signal surviving after all t steps
The bar means "accumulated." ∏ (capital pi) means multiply them all together : α ˉ t = α 1 × α 2 × ⋯ × α t . Because each step keeps only fraction α s of the signal, after t steps the surviving signal fraction is the product. This is why we can leap straight from x 0 to x t .
Figure s03 (below): the variance budget over time. The magenta curve is the signal fraction α ˉ t ; the orange curve is the noise fraction 1 − α ˉ t ; together they always fill the box up to the violet dashed line at height 1 . Read left to right: at t = 0 the image is pure signal; by t = T it is pure noise; and at every intermediate step the two shaded areas stack to exactly 1 — the total spread never changes. That constant-1 line is the whole point of normalizing x 0 (Section 1).
∏ (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).
Now that α ˉ t exists, the parent's headline formula is legible.
ϵ — a fresh scoop of standard static
ϵ (epsilon) is a sample from N ( 0 , I ) : pure standard static, centred at zero, unit spread, one value per pixel. It is the raw randomness we will scale and shift.
The magic move the parent uses everywhere:
x t = α ˉ t x 0 + 1 − α ˉ t ϵ
Read left to right: shrink the clean image by α ˉ t , then add static scaled by 1 − α ˉ t .
Intuition Reparameterization trick — why write it this way
Saying "x t is a random draw from a bell curve centred at α ˉ t x 0 " and saying "x t = α ˉ t x 0 + 1 − α ˉ t ϵ " are the same statement . But the second form pulls the randomness out into one explicit knob ϵ . That lets us train through the randomness: the network's job becomes literally "guess the ϵ that was used."
Cover the limits:
At t = 0 : α ˉ 0 = 1 , so x t = x 0 — untouched image. ✓
As t → T : α ˉ t → 0 , so x t → ϵ — pure static. ✓
In between: a smooth blend, signal fading, static rising, total spread constant at 1 .
∼ — "is a random draw from"
x 0 ∼ q ( x 0 ) reads "x 0 is sampled from the distribution q ." The tilde means "randomly drawn according to."
∣ — "given / conditioned on"
q ( x t ∣ x t − 1 ) reads "the distribution of x t given that we already know x t − 1 ." Everything after the bar is treated as fixed and known.
q ( ⋅ ) — the fixed forward (noising) story
q is the forward process: the known, hand-designed rule that adds Gaussian noise. It has no learnable parts. The one-step forward rule is q ( x t ∣ x t − 1 ) = N ( x t ; α t x t − 1 , β t I ) .
p θ ( x t − 1 ∣ x t ) — the learned reverse (denoising) story
p θ is the reverse process: a neural network that, given the noisier image x t and the step number t , predicts a Gaussian for the slightly-cleaner image x t − 1 :
p θ ( x t − 1 ∣ x t ) = N ( x t − 1 ; μ θ ( x t , t ) , Σ θ ( x t , t ) ) .
Read the arguments: x t − 1 is what we are describing; the bar's right side x t is the noisy input; μ θ ( x t , t ) is the network's predicted centre for the cleaner image; Σ θ its predicted spread. The subscript θ (theta) is shorthand for all the tunable weights of that network . Training = adjusting θ so p θ 's reverse Gaussian matches q 's true reverse.
Definition Markov chain — memory of just one step
The forward process is a Markov chain : to make x t you need only x t − 1 , not the whole history. Picture a line of dominoes — each one only feels its immediate neighbour. This is what makes the reverse learnable step-by-step, and it links to Markov Chain Monte Carlo sampling ideas.
q ( x t − 1 ∣ x t ) is NOT free
Going forward is easy (add noise). Going backward , q ( x t − 1 ∣ x t ) , secretly needs to know every possible clean image — it is intractable . The parent's trick: condition also on x 0 , i.e. q ( x t − 1 ∣ x t , x 0 ) , which is a clean Gaussian. The network p θ then learns to fake the x 0 knowledge.
E [ ⋅ ] — the average over randomness
E (blackboard E) is expectation : "average value if you repeated the random draw forever." E t , x 0 , ϵ [ … ] means "average over random step t , random image x 0 , and random noise ϵ ." In practice we estimate it by averaging over a mini-batch.
∥ a ∥ 2 — squared length / total squared error
Double bars are length of a vector ; squared, it is the sum of the squares of every entry: ∥ a ∥ 2 = a 1 2 + a 2 2 + … . In ∥ ϵ − ϵ θ ∥ 2 it measures, pixel by pixel, how far the network's guessed noise is from the true noise — one number summarising the total mistake.
D K L ( q ∥ p ) — distance between two distributions
KL divergence answers: "if I believe distribution p but reality is q , how surprised will I be on average?" Zero when they match, growing as they differ. It is the ruler that says "your learned reverse-Gaussian p θ is close to the true reverse-Gaussian." For two Gaussians of equal spread, this ruler collapses to a plain squared distance between their centres — which is why the fearsome D K L sum in the parent's loss simplifies to the tidy ∥ ϵ − ϵ θ ∥ 2 .
Intuition Why this all reduces to "predict the noise"
The full training bound is a stack of KL divergences. Because every piece is Gaussian with matched variance, each KL is just "how far off is the predicted centre?" And after the reparameterization algebra, the predicted centre is fully determined by a predicted noise ϵ θ . So the entire elaborate objective compresses into: guess the static that was added. That is the whole DDPM training loop.
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 x (Section 1), the Gaussian N (Section 2), and the schedule β , α , α ˉ (Section 3) — all feed the forward process q .
The Markov property (one-step memory) also feeds q and is what makes the reverse posterior q ( x t − 1 ∣ x t , x 0 ) usable.
The forward process gives us the reparameterized jump to any x t , 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
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
DDPM training and sampling
Test yourself — reveal only after you have answered aloud.
What does bold x 0 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 x 0 be normalized to unit variance? So the noising process keeps total variance pinned at exactly 1 ; otherwise the "signal fraction + noise fraction = 1" budget breaks.
In N ( μ , σ 2 ) , which symbol is the centre and which is the spread? μ is the centre, σ 2 (variance) is the spread; σ is its square root.
Why do we track variance σ 2 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 N ( 0 , I ) , one value per pixel.
State the reparameterized forward equation. What are β t , α t , α ˉ t ? β t = noise variance added at step t ; α t = 1 − β t = signal fraction kept per step; α ˉ t = ∏ s ≤ t α s = signal fraction surviving after t steps.
Why do the scale factors carry square roots? So the squared (variance) contributions α ˉ t + ( 1 − α ˉ t ) sum to 1 , keeping total spread constant.
What does the bar in q ( x t ∣ x t − 1 ) mean? "Given / conditioned on" — the right side is known and fixed.
Difference between q and p θ ? q = fixed forward noising; p θ ( x t − 1 ∣ x t ) = N ( x t − 1 ; μ θ ( x t , t ) , Σ θ ( x t , t )) = learned reverse denoising with weights θ .
Why is q ( x t − 1 ∣ x t ) intractable but q ( x t − 1 ∣ x t , x 0 ) easy? The former secretly needs the whole data distribution; conditioning on x 0 makes it a plain Gaussian.
What does E [ ⋅ ] compute and how do we estimate it? The average over randomness; estimated by averaging over a mini-batch of samples.
What does ∥ ϵ − ϵ θ ∥ 2 measure? Total squared, pixel-by-pixel error between true and predicted noise.
What does D K L 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.