Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Closed-Form Gaussian Forward Diffusion Distribution

Hello again. In the previous lesson, we defined the forward process as a fixed Markov chain that gradually corrupts clean data , and we separated it from the learned reverse chain used for generation. The forward transition was

where

That one-step definition is conceptually clear, but simulating every preceding step just to obtain one noisy training example at timestep would be wasteful. This lesson derives the central shortcut of DDPMs: a closed-form distribution for given the original clean sample . It lets us add the correct total amount of noise in a single operation.


The result we want

Define the cumulative signal retention through timestep as

The bar distinguishes , a product across all earlier timesteps, from , the retention at one particular step.

We will show that the whole sequence of noising steps can be collapsed into:

Equivalently, a sample from this conditional distribution can be written as

This equation has a useful interpretation:

  • is the remaining scaled signal from the clean datum.
  • is the accumulated Gaussian noise.
  • The two coefficients are chosen so that the added noise has covariance .

The result is conditional on a fixed . It is not yet a formula for the marginal distribution , which also averages over the unknown data distribution.


Unrolling two diffusion steps

Begin with the reparameterized form of one forward step:

Consider . First,

Then substitute that expression into the second step:

The clean-data term already has the pattern we want:

The remaining two terms are both independent, zero-mean Gaussian vectors. Their sum is therefore also Gaussian with zero mean. Its covariance is the sum of their covariances:

Since , the combined noise has covariance

Thus we may replace the two separate noise terms with one fresh standard Gaussian vector :

This is equality in distribution: the single need not be literally the same random draw as either earlier noise variable. It produces exactly the same conditional Gaussian distribution.


Lecture Notes in Probabilistic Diffusion Models

Read Section 2.1, “Forward diffusion,” of Lecture Notes in Probabilistic Diffusion Models. It develops the same result from the Gaussian transition kernel and explicitly tracks how the independent noise terms combine.

In Section 2.1, first review the one-step Gaussian kernel in Equation 3. Then read the forward derivation, concentrating on Equations 5 through 10. When the notes combine noise variables between Equations 6 and 7, verify for yourself that variances add after the earlier noise has been scaled by \sqrt{\alpha_t}.


The general derivation by induction

Unrolling the chain is instructive, but there is a shorter proof that makes the general pattern precise.

Suppose that at timestep , the desired formula holds:

The next forward step is

Conditioned on , this is an affine transformation of Gaussian variables, so is Gaussian. We only need its mean and covariance.

Conditional mean

Because has mean zero,

The final equality follows from

Conditional covariance

The covariance of the scaled previous state is

The covariance of the newly injected noise is

The two terms are independent, so their covariances add:

Together, the mean and covariance establish the closed form:

for every timestep .

The base case is , where , so the formula is exactly the original one-step forward transition from .


Reading the formula correctly

The closed form encodes several important properties of Gaussian diffusion.

Signal decays multiplicatively

At each step, the existing image is scaled by . Across many steps, these scalings multiply:

Since each is between zero and one, decreases as increases. The original image’s contribution becomes smaller and smaller.

Noise variance is not a simple sum of

A common first mistake is to expect the total noise variance to be

That would ignore the fact that noise injected at an earlier step is itself scaled down by every later . The correct total variance is

The DDPM choice makes this expression particularly clean and keeps the scale controlled.

Large timesteps approach standard Gaussian noise

When the cumulative product becomes close to zero,

the conditional distribution becomes

The clean image has nearly disappeared from the mean, and the covariance is close to the identity. This is why a diffusion model can use standard Gaussian noise as the starting point for reverse-time generation.

The forward process progressively attenuates the clean image while increasing Gaussian noise until the sample is close to standard normal noise; the derived direct formula describes any intermediate noisy state \(\mathbf{x}_t\) from the original \(\mathbf{x}_0\) without simulating all earlier steps.

A small numerical example

Suppose, purely for illustration, that two timesteps retain

Their cumulative retention at timestep is

Therefore,

The coefficients have complementary squared magnitudes:

At this stage, the conditional mean is still visibly related to the original datum, but each coordinate has acquired variance from noise. Real diffusion schedules use many much smaller steps, but the same multiplicative accounting applies.


Why the closed form matters in practice

During DDPM training, the model typically picks a random timestep for each training example. The closed form permits the following efficient procedure:

  1. Take a clean batch .
  2. Sample a timestep .
  3. Sample from .
  4. Construct directly using and .
  5. Train a neural network to infer the relevant denoising information from and .

No loop through is required. This makes randomly training across noise levels computationally practical.

The following short segment visualizes that “one-shot” construction after the algebraic collapse of the Markov chain.

Denoising Diffusion Probabilistic Models | DDPM Explained

Watch the relevant segment of Denoising Diffusion Probabilistic Models | DDPM Explained from ExplainingAI. It emphasizes why the cumulative product lets training jump directly from a clean image to an arbitrary noise level.

Watch one shot sampling. Follow the distinction between the recursive forward chain, which defines the process, and the direct formula, which is used to efficiently sample \mathbf{x}_t during training.


Key takeaways

The forward diffusion chain has the one-step transition

Because scaled independent Gaussian variables remain Gaussian and their variances add, all earlier noise variables can be collapsed into a single standard Gaussian draw. Defining

gives the fundamental DDPM identity:

Equivalently,

The cumulative product measures retained signal power, while measures accumulated noise variance. In the next lesson, we will turn those two quantities into a more explicit diagnostic: the signal-to-noise ratio at a chosen diffusion timestep.

Can't find a good explanation? Sign up and we'll make it for you

Sign up