4.5.10 · D5Generative Models

Question bank — Diffusion models forward - reverse process

2,169 words10 min readBack to topic

Warm-up: three facts every trap below leans on

Before the traps, three results appear again and again. Read them once so no symbol below is a surprise.

1. Why the variance stays put: the update

One forward step is , where is standard Gaussian noise (so ) and is independent of . Variance of a scaled-plus-independent-noise sum adds the squared scales:

WHY it matters: the shrink factor pulls the old variance down by exactly as much as the new noise pushes it up. If , then — a perfect fixed point. That is why the signal never explodes.

The figure below makes this a race: the teal curve (with the shrink factor) hugs the value forever, while the orange curve (naively adding noise with no shrink) climbs without bound. The dotted plum line marks the fixed point at that the teal curve is pinned to.

2. Why the closed form is

Apply the single step twice. Writing :

The two noise terms and (each with ) are independent Gaussians, and independent Gaussians combine into one Gaussian whose variance is the sum of theirs:

So after two steps the surviving signal is and the noise is . Repeating down to turns the product into :

WHY this is beautiful: every intermediate noise collapses into one effective standard-Gaussian noise , because Gaussians-on-Gaussians never make anything but a Gaussian. The signal fraction and noise fraction always satisfy .

The figure draws this as a point sliding down a quarter circle: the horizontal axis is the surviving signal , the vertical axis is the noise . At (plum dot, far right) the point is "all signal"; by (plum dot, top) it is "all noise"; the orange dot at is a mid-journey mix. Because the two fractions always square-sum to , the teal path can only travel along the dotted unit circle.

3. Why the reverse step is — and what mean

The parent note shows the true reverse conditional (when is known) is a Gaussian . To sample from a Gaussian with mean and variance you draw a fresh standard Gaussian and form — the is the randomness, scales it to the right width. Two pieces:

WHERE comes from: run Bayes' rule on the two known Gaussians and . Multiplying two Gaussians in gives another Gaussian whose inverse-variance is the sum of the two inverse-variances; simplifying that sum yields exactly .

WHY that specific form: the factor is at most 1 (for a schedule where decreases), so the reverse step is no wider than the raw forward noise . Knowing pins down more tightly than a blind step would — the leftover uncertainty is only what failed to reveal. At , makes the numerator , so : the final step is deterministic, exactly as it must be to land on a clean .

The figure compares the two schedules: the orange curve is the forward noise , the teal curve is the reverse width sitting on or below it. The plum dot at sits on zero — the last reverse step adds no noise at all.


True or false — justify

The forward process needs a trained neural network.
False. The forward process is a fixed recipe — it just adds Gaussian noise on a schedule . Only the reverse process is learned; nothing is trained going forward.
At the sample still secretly contains the original image.
Practically false. Since , we have , pure noise. A trace remains in theory, but it is below any usable signal, which is exactly why generation can start from noise.
Because skips intermediate steps, the forward process is not really a Markov chain.
False. It is a Markov chain (each depends only on ). The closed-form jump is a mathematical consequence of Gaussians composing (Warm-up 2), not a violation of the Markov structure. See the Markov chains note for why memorylessness still holds.
The variance schedule increases over time so that early steps damage the image gently.
True. Small keeps early almost identical to (easy to learn near clean data); larger late finishes the job of reaching noise. The ordering matters for training stability.
The reverse process is deterministic — you plug in and get .
False (for the standard sampler). Each reverse step samples with fresh (see Warm-up 3 for , and ). The stochasticity is what produces different images from the same starting noise. (DDIM sampling makes it deterministic instead.)
Training minimizes the distance between generated images and real images.
False. The simple loss compares predicted noise to true noise — never images to images. There is no image-space comparison during training at all.
Every training step simulates the full chain from to .
False. Thanks to the direct-sampling formula (Warm-up 2), we jump to any in one shot. This is the whole point of deriving — training a single random costs one noising, not steps.
Predicting the noise and predicting the clean image are fundamentally different training targets.
False in content, true in practice. They are algebraically equivalent (you can convert one to the other via ). But empirically predicting trains better (see the "Why questions" for the gradient-scale reason).
Diffusion is basically a many-step VAE with a fixed encoder.
True — a useful analogy. The forward process is a non-learned "encoder" to noise; the reverse is a learned "decoder." The full training objective is even derived as a variational bound, just like the VAE ELBO.

Spot the error

"Since Gaussian noise is added each step, grows without bound, so we clip it."
Error: the shrink factor is ignored. By Warm-up 1, ; the shrink cancels the injected , so variance sits near . No clipping is needed.
"The reverse mean is ."
Error: wrong denominator. It is , not (compare Warm-up 3). The correction subtracts the noise fraction , which is what remains to be removed — swapping it changes the removed amount dramatically.
"We add noise back at every reverse step, including the very last one into ."
Error: the last step is noise-free. At , (numerator ), so we output the mean directly with no term; adding noise there would corrupt the final clean sample.
" is a sum of the up to ."
Error: it is a product. . Signal survival is multiplicative — each step keeps a fraction of what remained, so surviving fractions multiply, not add.
"To reverse a step exactly we just use from the forward process."
Error: is intractable without . The tractable reverse is , which needs the clean image. Since is unknown at generation, we approximate it via the network's noise prediction.
"A larger predicted noise always means the model thinks the image is closer to done."
Error: it means the opposite. A large says "most of is noise," so more must be subtracted — the estimated image is less clean, not more.

Why questions

Why do we predict noise instead of directly predicting ?
Because the noise target is always unit Gaussian regardless of or dataset, so its gradient magnitude stays roughly constant across all noise levels; predicting would give targets whose scale drifts with , making some timesteps dominate the loss.
Why does predicting (not ) give better-conditioned gradients across ?
The target has fixed variance at every timestep, so early (near-clean) and late (near-noise) steps contribute comparably to ; predicting instead would multiply errors by a -dependent factor , blowing up late-step gradients and starving early ones — a badly conditioned objective.
Why must be small for the reverse conditional to be Gaussian?
Only for tiny steps is well-approximated by a Gaussian; large jumps make the true reverse distribution multi-modal, which a single Gaussian mean/variance cannot represent.
Why does adding stochastic noise during reverse sampling improve generation?
The reverse conditional is genuinely a distribution of width , not a point — sampling from it explores the many plausible slightly-less-noisy images, giving sample diversity instead of collapsing to one blurry average.
Why is predicting noise connected to score matching?
The noise prediction is (up to a scale ) the score — the direction toward higher data density. Reverse sampling is then a discretized Langevin walk up that gradient.
Why sample a random timestep each training iteration instead of looping to in order?
Random gives an unbiased estimate of the loss averaged over all noise levels, so one network learns to denoise every level uniformly without over-training on early or late steps.
Why can Classifier-free guidance steer samples without a separate classifier?
It trains one network on both conditioned and unconditioned noise predictions, then at sampling time extrapolates in the direction that increases conditioning strength — no external gradient of a classifier is required.

Edge cases

What is when ?
Then exactly and no noise is present — this is the degenerate case where the forward process has done nothing yet.
What happens to the reverse mean formula when (very early, nearly clean)?
The correction coefficient can blow up because ; in practice near-clean steps barely change the image and the tiny keeps things numerically stable.
If were set to for some step, what would that step do?
Nothing — with , , so with no noise added and no signal shrink. That step is a wasted identity map in both directions.
If for a step, what happens to the signal?
The signal is fully destroyed in one step: , so becomes pure noise regardless of . This makes that step irreversible in practice — the model cannot recover information that is completely gone.
What does the reverse process output at specifically?
It returns the mean with no added stochastic term (since ), producing the final clean sample . This is the one deterministic reverse step by design.
What if is chosen too small (say )?
Then is not close to , so is not real noise; starting generation from pure noise no longer matches the training distribution, and samples degrade. Large (or a good schedule) is needed to reach true noise.
Recall Self-check: the two things students most often invert

Which quantity is a product, and which sampler step skips the added noise? is a product of the ; the == (final)== reverse step omits the stochastic term because .