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

The Gaussian Lab

Three things about the multivariate normal, made draggable: what the covariance actually controls, what a linear map does to it, and why sums of almost anything end up here.

Act I · The bivariate normalΣ is the whole story

Below is N(μ, Σ) in two dimensions: the heatmap is the density, the ellipses are level sets, and the curves on the edges are the two marginals. Only Σ controls the shape — μ just slides it around.

Set ρ = 0 and watch the readout: the joint density becomes exactly the product of the two marginals, and the ellipses straighten to axis-aligned. That is the whole content of “Σ diagonal ⇒ independent coordinates”, and with σ₁ = σ₂ it is the isotropic N(0, I) that diffusion models add as noise.

p(x, y) with 1σ, 2σ contours and both marginals
The contours are the sets where the Mahalanobis distance (x−μ)ᵀΣ⁻¹(x−μ) is constant — always ellipses, with axes along the eigenvectors of Σ and half-lengths proportional to the square roots of its eigenvalues.

Act II · Linear mapsA Gaussian stays a Gaussian

Start from standard normal noise z ∼ N(0, I) — the round cloud — and apply an affine map x = Az + b. The cloud shears and rotates, but it never stops being Gaussian: the new law is exactly N(b, AAᵀ). Drag the entries of A and watch the covariance readout follow.

grey: z ∼ N(0, I) · blue: x = Az + b
The unit circle (grey) maps to the ellipse (blue) — that image is the one-σ contour of the new law. Run this backwards and you get whitening: given any Σ, factor it as LLᵀ and z = L⁻¹(x−μ) is standard normal again.

Act III · The CLTAdd enough of anything

Pick a source distribution — none of them Gaussian — draw n of them, add them up, standardise, and repeat. The histogram is what you get; the curve is the standard normal. Raise n and watch.

standardised sum of n draws, against N(0, 1)
The rate depends on the source: a symmetric one like the uniform is already close at n = 3, while a lopsided one like the exponential, or a two-valued one like a coin flip, takes far longer. The limit is the same regardless — which is what makes it a theorem worth having.

One object, three views. Σ alone fixes the shape of a Gaussian; linear maps move it around inside the same family, with Σ ↦ AΣAᵀ; and sums of independent things drift towards it no matter where they started. That last fact is why a noise model you did not choose still ends up Gaussian — and why this course adds Gaussian noise rather than anything else.