4.5.10 · D1Generative Models

Foundations — Diffusion models forward - reverse process

2,622 words12 min readBack to topic

This page is the toolbox. Before you touch the parent note's equations, you need to own every symbol in them. We build each one from a picture, in an order where nothing appears before it is earned.


1. What is a "sample" and a "distribution"? (, )

Everything starts with data. Call one real image — the subscript just means "step zero, before we ruin anything".

Now imagine plotting every real image as a dot. Real images clump together (faces near faces, digits near digits). That cloud of dots is the data distribution, written .

Figure — Diffusion models forward - reverse process

Why the topic needs it: generation means producing a fresh dot that lands inside the thick fog — a new image that looks real. Diffusion's whole trick is a clever route to that fog. (This is exactly the goal that Variational autoencoders also chase, by a different road.)


2. The Gaussian — the shape of "random noise" (, mean, variance, )

The single most-used symbol in the parent note is .

Two words to lock in, because the parent uses them constantly:

  • Mean (Greek "mu") = the centre / average / balance point of the hill.
  • Variance (Greek "sigma" squared) = the spread. Its square root is the typical distance from centre. Small variance = tight spike; large variance = flat spread.
Figure — Diffusion models forward - reverse process

Why "" keeps appearing: if a number has variance , its typical size is . So in the parent is literally "the typical strength of the noise added at step ".

What is that ?

An image is many numbers, not one. So the noise is a bell curve in many dimensions at once. We write where (capital sigma) is now a table saying how each dimension varies and co-varies.

Why the topic needs it: diffusion adds independent noise to every pixel with the same strength, which is exactly what encodes — cheap to write, cheap to sample.


3. The reparameterization idea (, "", vs sampling)

The parent writes both and . These say the same thing two ways.

Here's the picture-based trick the whole topic leans on:

Why we bother: this turns "sample from a distribution" (mysterious) into "do arithmetic on one fixed noise draw " (a network can differentiate through it). (Greek "epsilon") is the exact quantity the reverse network is asked to predict, so it deserves a picture. This same trick powers Variational autoencoders.

One fact we will lean on: adding two independent Gaussians


4. A chain of steps: , , and the Markov property

The subscript counts noise steps: (clean) (pure static). is the total, typically .

Why is it called a Markov chain? Because each new frame depends only on the frame just before it, not the whole history.

Figure — Diffusion models forward - reverse process

Why the topic needs it: memorylessness is what lets us write the forward process as one simple rule repeated, and lets the reverse be a matching chain . If you want this idea rigorously, see Markov chains.

Conditional probability bar ""

reads "the distribution of given that is already fixed". The bar means given / assuming we already know. Picture freezing the previous frame, then asking where the next frame can land.


5. The schedule: , ,

These three control how fast the image dissolves. Get them straight and half the parent note's algebra evaporates.

Figure — Diffusion models forward - reverse process

Where the closed-form shortcut comes from

The parent quotes as if by magic. Let us earn it, using only the one-step rule and the "Gaussians add" fact from §3.

One step, written in reparameterized form (recall ): WHAT this says: keep a fraction of the previous frame, add a fresh independent shake of spread .

Now substitute the same rule for (this is legal because the chain is memoryless): Multiply the signal term through:

WHY we now use the "Gaussians add" fact: the two noise terms are independent, so by §3 they merge into a single Gaussian. Their variances are and ; adding them: So the merged noise has spread and:

WHAT IT LOOKS LIKE: exactly the same shape as one step, but with the signal factor now the product . Repeat this collapse all the way down to : every extra step multiplies one more onto the signal factor, and the noise variance stays " minus that product". After collapses the product is precisely .

Why the topic needs it: is the shortcut that lets you jump straight to any noise level from with no loop — the engine of efficient training. Different choices of the dial also underpin faster samplers like DDIM sampling.


6. The reverse chain: , , ,

The forward chain destroys; the reverse chain rebuilds. It is written .

How does the network compute that centre? It does not guess directly — it guesses the noise and plugs it into a formula.

Why the topic needs it: the reverse chain is the generator. Sampling from it repeatedly, , is how a fresh image is born. Steering that guess is what Classifier-free guidance does.


7. The training goal: expectation and norm

Why the topic needs it: this single mean-squared-error is the entire objective. Everything else — the reverse mean , the sampling loop — is bookkeeping around "predict the noise". The link to (a score) connects this to Langevin dynamics.


Prerequisite map

Sample x0 and distribution q

Forward process q of xt given xt-1

Gaussian N with mean and variance

Identity covariance I

Reparameterization x equals mu plus sigma epsilon

Independent Gaussians add variances

Schedule beta alpha alphabar closed form

Timestep t and horizon T

Markov property memoryless

Reverse process p_theta xt-1 given xt

Network params theta and noise pred epsilon_theta

Expectation E over uniform t and squared norm

Loss L simple

Diffusion model 4.5.10


Equipment checklist

Cover the right side and answer aloud; reveal to check.

What does the subscript in mean?
The clean, original data before any noise is added — step zero.
What is picturing?
The data distribution — a fog thick where real images are common, thin where they are rare.
What do the two arguments of stand for?
Mean (centre of the bell) and variance (its spread).
Why does keep wrapping the variance?
Because typical size is , not the variance itself.
What does do in ?
Makes every pixel get independent noise of the same variance .
Rewrite "" as arithmetic on standard noise.
with .
When you add two independent zero-mean Gaussians, what happens to the variance?
The variances add: .
What is and why does the network predict it?
The standard noise that was added; predicting it is an easier, data-independent target.
State the Markov property in three words.
Memoryless — depends only on the previous frame.
Read the bar in .
"Given that is already fixed."
Difference between and ?
is one step's survival; is the total survival of so far.
What does mean?
Multiply the whole list together.
Which two facts collapse the step-by-step chain into ?
The memoryless one-step rule, plus "independent Gaussians add their variances".
What is , and what shape does it have?
The learned reverse distribution — a Gaussian with centre and spread that guesses the cleaner frame.
What does a subscript signal?
The quantity is produced by / depends on the neural network (learned), not a fixed rule.
Over what distribution is drawn inside ?
Uniformly over — every timestep equally likely.
What does average over?
Random timestep (uniform), random data , and random noise .
In plain words, what is asking for?
Make the network's guessed noise match the true added noise, on average, everywhere.