Skip to main content

Probability & Statistics: The Language of Noise

Diffusion models don't just "generate" images; they learn the underlying probability distribution of data. To understand how we can turn white noise into a masterpiece, we first need to master the mathematics of uncertainty.


1. Variance (σ2\sigma^2) and Covariance (Σ\Sigma)

In the context of Diffusion, Variance is our measure of "destruction."

  • Low Variance: The data points are tightly clustered. In an image, this means pixels are predictable and structured.
  • High Variance: The data points are scattered. As we add noise to an image, we are effectively increasing its variance until the original structure is lost in a cloud of entropy.

Covariance tells us how pixel AA changes in relation to pixel BB. Natural images have high covariance (neighboring pixels are usually similar). Pure noise has zero covariance—each pixel is a "lone wolf."


2. The Gaussian Distribution (The "Bell Curve")

Diffusion models rely almost exclusively on the Multivariate Gaussian Distribution. Why? Because of the Central Limit Theorem: when you add up many independent random effects (like noise), the result converges to a Gaussian.

The probability density function (PDF) is defined as:

N(x;μ,σ2I)=1(2π)dσ2Iexp(12(xμ)T(σ2I)1(xμ))\mathcal{N}(x; \mu, \sigma^2 I) = \frac{1}{\sqrt{(2\pi)^d |\sigma^2 I|}} \exp\left( -\frac{1}{2} (x-\mu)^T (\sigma^2 I)^{-1} (x-\mu) \right)

In simple terms:

  • μ\mu (Mean): The "center" of our data (e.g., the original image).
  • σ2\sigma^2 (Variance): The "spread" of the noise we've added.

3. The Reparameterization Trick

This is the "Secret Sauce" that makes training possible.

If we want to sample xx from a distribution N(μ,σ2)\mathcal{N}(\mu, \sigma^2), we usually can't backpropagate through a random sampling operation.

The Solution: Express the random variable xx as a deterministic function of a "standard" noise variable ϵN(0,I)\epsilon \sim \mathcal{N}(0, I):

x=μ+σϵx = \mu + \sigma \cdot \epsilon

Now, the randomness is isolated in ϵ\epsilon, and we can compute gradients with respect to μ\mu and σ\sigma perfectly!


4. Sum of Gaussians (The "Nice" Property)

Diffusion models involve adding noise over thousands of steps. Do we need to simulate every single step to get to step TT? No.

Because the sum of two Gaussians is also a Gaussian, we can jump from the original image x0x_0 to any noisy state xtx_t in a single calculation:

q(xtx0)=N(xt;αˉtx0,(1αˉt)I)q(x_t | x_0) = \mathcal{N}(x_t; \sqrt{\bar{\alpha}_t} x_0, (1 - \bar{\alpha}_t) I)

The Golden Rule: This property allows us to train on any arbitrary timestep tt without having to run the simulation linearly. It's what makes Diffusion training efficient.


Summary Checklist

ConceptRole in Diffusion
VarianceControls the "noise level" at each step.
Gaussian PDFDefines the transition between clean and noisy states.
ReparameterizationAllows the neural network to learn via Backpropagation.
LinearityEnables "jumping" to any timestep tt during training.