Worked examples — Denoising diffusion probabilistic models (DDPM)
This page is a drill. The parent note built the machinery — forward noising, the closed-form jump, the reverse posterior, the noise-prediction loss. Here we run that machinery through every kind of input it can meet: normal cases, the two extreme timesteps ( and ), a schedule pushed to its limit, a real-world word problem, and an exam-style twist.
Before anything, one promise: no symbol appears here that the parent did not define. We reuse exactly these, and nothing more:
Recall The five symbols we lean on
::: the variance schedule — how much fresh noise we inject at step (a small number between 0 and 1). ::: the fraction of the previous signal we keep at step . ::: the cumulative signal that survives from step all the way to step (a product, so it only shrinks). ::: a standard Gaussian noise sample, mean , variance per pixel. ::: the one-line recipe to jump straight from clean data to any noise level.
Recall What does
mean? ::: the forward (noising) distribution — the fixed, hand-designed process that corrupts data. reads "the distribution of the noisy sample given we started from clean data ." It has no learnable parameters; the parent defined it as a Gaussian. (Its learned mirror image is written .)
Figure 1 (below): the two mixing factors across all timesteps. The burnt-orange curve is the signal factor , sliding from down to ; the teal curve is the noise factor , rising the opposite way. The three labelled regions — early (), mid-range, and late () — are exactly the cells our first three examples land on. Keep this picture in mind: every example just reads off where on these two curves the knob sits.

The scenario matrix
Every case DDPM can throw at you falls into one of these cells. Each worked example is tagged with the cell(s) it covers.
| Cell | What makes it special | Covered by |
|---|---|---|
| Z. Zero step () | no noise yet, , | Ex 0 |
| A. Mid-range step | typical , both signal and noise present | Ex 1 |
| B. First step () | , almost pure signal | Ex 2 |
| C. Last step () | , almost pure noise | Ex 3 |
| D. Degenerate schedule () | no noise added — identity limit | Ex 4 |
| E. Reverse posterior mean/var | plug into | Ex 5 |
| F. Noise→mean reparameterization | recover from | Ex 6 |
| G. Recover from a noisy sample | invert the forward recipe | Ex 7 |
| H. Real-world word problem | "how many steps to half-destroy?" | Ex 8 |
| I. Exam twist | prove variance stays under the schedule | Ex 9 |
We use a tiny toy schedule throughout so the arithmetic is checkable by hand: From it: , so
Ex 0 — The zero step, (Cell Z)
Forecast: No noising has happened yet, so the "noised" value should just be the data: predict .
- Note . Why this step? is a product of 's; a product of zero factors is the empty product . This is the natural boundary that makes the whole schedule start from "full signal."
- Signal factor ; noise factor . Why this step? The dimmer is at maximum brightness and the static term is switched off.
- Combine. . Why this step? Substituting into the recipe collapses it to — the identity, confirming the chain begins exactly at the data.
Verify: Output equals the clean input , so is a fixed point of the forward recipe. ✓ This anchors the left end of the spectrum that Ex 1–3 then walk rightward.
Ex 1 — Mid-range step (Cell A)
Forecast: Signal is scaled by , pulling down toward ; but a positive noise draw then pushes back up. Net effect is not obvious — many learners guess "near " by looking only at the signal term. Watch how the noise term overturns that guess.
- Read the surviving-signal factor. . Why this step? The recipe needs this dimmer setting first — it says how bright the original point still is.
- Read the noise factor. . Why this step? Whatever the signal loses, the static gains; keeps the total power fixed.
- Combine. . Why this step? This is literally the closed-form forward jump — no need to pass through .
Verify: Signal alone would give ; adding a positive pushes it up, and . ✓ Magnitude sane: with unit-variance data the typical spread is , and is a plausible draw. ✓
Ex 2 — The very first step (Cell B)
Forecast: Only one tiny noise injection has happened, so should be barely different from .
- Note . Why this step? The cumulative product of one factor is just that factor — this is the boundary case where the "product" has a single term.
- Signal factor ; noise factor . Why this step? At the dimmer is nearly full-bright () — the picture is still almost the data.
- Combine. . Why this step? Substituting both factors into the recipe gives the actual noised value; because the noise factor is small, the signal term dominates and stays near .
Verify: is closer to the clean than was — noise accumulates, so earlier steps stay nearer the data. ✓ Ordering of "closeness to signal-only value" ( vs ) confirms structure erodes monotonically. ✓
Ex 3 — The last step, noise limit (Cell C)
Forecast: Near the end the signal should be gone — mean near , variance near , i.e. pure standard Gaussian.
- Mean . Why this step? The Gaussian is centred on the dimmed signal; with the centre collapses toward .
- Variance . Why this step? As signal vanishes, its variance budget is handed entirely to noise, approaching the target .
- Interpret. . Why this step? Combining the mean and variance just computed into one Gaussian statement lets us read off that the endpoint is indistinguishable from standard noise — the fact the whole reverse process relies on.
Verify: This is exactly why sampling starts from : the forward process guarantees the endpoint is (near-)standard Gaussian regardless of . Mean , var . ✓
Figure 2 (below): the same data point noised at three timesteps. Each bell curve is — orange at (narrow, centred near ), plum at (wider, centred at ), teal at (centred at , width ). Watch the peak march leftward toward and the curve broaden toward the dashed black target . This is Ex 2, Ex 5's data, and Ex 3 shown as distributions rather than single numbers.

Ex 4 — Degenerate schedule, no noise (Cell D)
Forecast: If nothing is added, the "noised" image must equal the original. Predict .
- . Why this step? Keeping of the previous signal every step means the cumulative survivor is .
- Signal factor ; noise factor . Why this step? The recipe's noise term is multiplied by — it disappears.
- Combine. . Why this step? Substituting the two factors into the recipe leaves only the signal term, so the forward map is the identity — proof that a schedule does literally nothing.
Verify: Output equals input — the forward process degenerates to the identity, as it must when no noise is scheduled. This is the boundary that shows is required for anything to happen. ✓
Ex 5 — The reverse posterior numbers (Cell E)
Forecast: Reverse variance should be smaller than because conditioning on tells us extra information, sharpening the guess.
- Recall (from the parent). Here . Why this step? This is the closed form for the known reverse step when is given.
- Plug in : Why this step? Direct substitution — every quantity is precomputed above.
- Mean coefficients for : Why this step? The parent's formula is a weighted average of the clean data and the noisy ; computing these two weights tells us how much the reverse step trusts each — needed before we can denoise numerically.
Verify: — conditioning sharpens the estimate, as forecast. ✓ Also the coefficients are both positive and , so is a sensible weighted blend of and . ✓
Ex 6 — Noise-to-mean reparameterization (Cell F)
Forecast: The network should push back toward the clean value , so predict a little below .
- Recall the reparameterization (parent): Why this step? Predicting noise is the stable target; this formula converts that prediction into the denoising-step mean.
- Gather pieces for : , , . Why this step? Same knobs as before — the reverse step reuses the forward schedule.
- Compute the correction term. . Why this step? This is the "amount of noise to subtract": the network's estimated scaled by , exactly the bracketed correction in the formula.
- Combine. . Why this step? Subtracting the correction removes the predicted noise, and dividing by rescales back to the previous step's brightness — giving the denoised mean.
Verify: sits between and the true — the network has undone part of the noise, exactly a denoising step. ✓
Ex 7 — Invert the forward recipe: recover (Cell G)
Forecast: If we know the exact noise, inversion is exact — we should recover .
- Rearrange for : Why this step? It's one line of algebra; it also shows why predicting is equivalent to predicting .
- Plug in : numerator . Why this step? Subtracting the exact noise contribution strips the static back out, leaving only the dimmed signal in the numerator.
- Divide by : . Why this step? Dividing by the signal factor undoes the dimming, restoring the original brightness — this is the inverse of the dimmer knob.
Verify: Recovered — matches the true value (tiny rounding). ✓ This is the ceiling of denoising: a network whose reconstructs perfectly. ✓
Ex 8 — Real-world word problem (Cell H)
Forecast: With per step, halving is a slow geometric decay — guess "a bit over ten steps."
- Constant schedule . Why this step? The cumulative product of equal factors is a plain power.
- Set and take logs: . Why this step? Logs turn "how many multiplications" into a solvable linear equation.
- Evaluate. . Since must be an integer step, is the first step with . Why this step? The equation gives a fractional crossover; because steps are whole numbers, we round up to the first integer that actually meets the condition.
Verify: and . ✓ So step is the crossover — matching the "just over ten" intuition. ✓
Ex 9 — Exam twist: variance stays 1 (Cell I)
Forecast: The scaling was designed to conserve variance, so we expect exactly .
- Write the step , with . Why this step? Independence lets variances add without a covariance term.
- Apply variance rules. . Why this step? , and independent sums add variances.
- Substitute : Why this step? The and exactly refill each other — the design intent.
- Toy check : . Why this step? Plugging a concrete into the just-proved identity confirms the general algebra numerically — a guard against a sign or arithmetic slip.
Verify: Variance is conserved at for any , which is precisely why the endpoint lands on (Ex 3). The whole schedule design is this one identity in disguise. ✓
Recall Quick self-test
At with the toy schedule, is closer to than is? ::: Yes — noise accumulates, so earlier steps stay nearer the clean data (Ex 1 vs Ex 2). Why is ? ::: Conditioning the reverse step on adds information, sharpening (shrinking) the posterior variance (Ex 5). What happens to under ? ::: It stays ; the forward process becomes the identity, adding no noise (Ex 4). What is and why? ::: — the empty product; it makes the chain start exactly at the clean data (Ex 0).
See also: the parent note, the analogous latent-variable objective in Variational Autoencoders (VAE), sampling intuition from Markov Chain Monte Carlo, the denoiser network in U-Net architecture, steering with Classifier-free guidance, and scaling via Latent diffusion models.