ID-5-02 (TO) · Mathematical Foundations of Diffusion Models · Lecture 1 demo

Progressively Adding Noise

One point at x = 0. Kick it with a little noise, again and again, and watch how far — and how predictably — it strays.

Act I · One walkerOne kick at a time

Start at x₀ = 0. Each kick adds a small, independent Gaussian nudge:

xk = xk−1 + δ zk,   zk ∼ N(0, 1).

Press Add one kick a few times — each press is one noise step, and time runs downward. No single kick does much, but they never cancel perfectly: the walker drifts away from 0. The dashed envelope marks ±√t and ±2√t — the point diverges like the square root of time.

A single noisy walk · start (top) → time t = 1 (bottom) the walker ±√t, ±2√t
k = 0 · x = 0.00
This walk uses K = 160 kicks of size δ = √(1/160) ≈ 0.079, so the total spread at the bottom is δ√K = 1. Every Reset gives a different path — but the same envelope. That contrast is the whole story.

Act II · Many walkersSame start, every fate — and one shape

Now release many walkers from the same point 0. Individually each path is unpredictable; collectively the cloud spreads with a fixed profile. After k kicks,

xk = δ(z₁ + ⋯ + zk) ∼ N(0, kδ²)  —  sd = δ√k.

The blue strip at the bottom is the live histogram of the walkers' current positions, with the exact Gaussian N(0, t) drawn over it. Switch the kicks to coin flips (±δ, no Gaussian anywhere in the noise) — the histogram still marches to the same bell: the central limit theorem at work.

Walkers from 0 · cross-section below paths ±√t, ±2√t N(0, t)
walkers kicks
Here K = 240 kicks of size δ = √(1/240) ≈ 0.065, so the cross-section at time t = k/K has sd δ√k = √t. Pause mid-flight: at every intermediate time the cross-section is already the right Gaussian — noise accumulation is Gaussian all the way down, not just at the end.

Why diffusion models care. Variances add: after k independent kicks the spread is exactly δ√k, and by the CLT the shape is Gaussian regardless of the kicks' own distribution. So repeatedly noising any data lands somewhere fully known — a Gaussian — which is what makes the forward half of a diffusion model trivial, and the reverse half worth a course.