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 () and Covariance ()
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 changes in relation to pixel . 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:
In simple terms:
- (Mean): The "center" of our data (e.g., the original image).
- (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 from a distribution , we usually can't backpropagate through a random sampling operation.
The Solution: Express the random variable as a deterministic function of a "standard" noise variable :
Now, the randomness is isolated in , and we can compute gradients with respect to and 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 ? No.
Because the sum of two Gaussians is also a Gaussian, we can jump from the original image to any noisy state in a single calculation:
The Golden Rule: This property allows us to train on any arbitrary timestep without having to run the simulation linearly. It's what makes Diffusion training efficient.
Summary Checklist
| Concept | Role in Diffusion |
|---|---|
| Variance | Controls the "noise level" at each step. |
| Gaussian PDF | Defines the transition between clean and noisy states. |
| Reparameterization | Allows the neural network to learn via Backpropagation. |
| Linearity | Enables "jumping" to any timestep during training. |