v9.1.1
Menu

Chapter 3: Forward Diffusion Process

Week 3

The forward diffusion process is the foundation of all diffusion models. It defines how clean data is systematically corrupted by adding Gaussian noise over a sequence of timesteps, transforming any data distribution into pure noise. Understanding this process---noise schedules, reparameterization, and the continuous-time formulation---is essential for training and sampling.

Topics
6
Demo
1
Videos
3
Min read
38

Chapter Overview

The forward diffusion process is conceptually simple but mathematically rich. Starting from a clean data sample x0x_0, we progressively add small amounts of Gaussian noise over TT timesteps, producing a sequence x1,x2,…,xTx_1, x_2, \ldots, x_T where xTx_T is nearly indistinguishable from pure Gaussian noise. This defines a fixed (non-learned) Markov chain that gradually destroys structure in the data.

The elegance of diffusion models lies in the fact that this destruction process is easy to define and analyze, while the generative model learns to reverse it. The forward process gives us: (1) a training procedure---we can sample any noisy version xtx_t directly from x0x_0 without simulating the full chain, and (2) a starting point for generation---we begin from pure noise and iteratively denoise.

Two mathematical frameworks describe this process. The discrete-time formulation (DDPM) defines TT discrete steps with a variance schedule β1,…,βT\beta_1, \ldots, \beta_T. The continuous-time formulation (Score SDE) uses stochastic differential equations, treating time as continuous t∈[0,1]t \in [0, 1]. Both frameworks are equivalent in the limit and each offers distinct advantages for analysis and implementation.

This chapter covers:

  • Adding Noise to Data: The transition kernel q(xt∣xt−1)q(x_t | x_{t-1}) and visualization of progressive corruption
  • Noise Schedules: How the variance schedule βt\beta_t controls the rate of noise injection
  • The Forward SDE: Continuous-time formulation with VP-SDE and VE-SDE
  • Reparameterization Trick: Sampling xtx_t directly from x0x_0 in a single step
  • Signal-to-Noise Ratio: Quantifying information content at each timestep
  • Continuous vs Discrete Time: Connecting the two frameworks and practical trade-offs

Chapter Roadmap

Click any topic to jump in

Explainer videoInteractive demo
1
Adding Noise

Gradually corrupting data with Gaussian noise until it becomes pure noise.

The Forward Transition KernelThe Forward Markov ChainVisualizing Progressive Corruption
How to add noise

Schedules and shortcuts

2
Noise Schedules

Linear, cosine, and learned schedules — controlling how fast information is destroyed.

Linear Schedule (DDPM)Cosine Schedule (Improved DDPM)Learned and Adaptive Schedules
3
Reparameterization

Sampling any timestep directly from x₀ — making training efficient.

Deriving the Closed-Form DistributionThe Alpha-Bar DerivationEfficient Training with Reparameterization
Unified perspectives

SNR and SDEs

4
SNR

Signal-to-noise ratio as the unified view of noise schedules.

SNR DefinitionLog-SNR and Its PropertiesMin-SNR Loss Weighting
5
Forward SDE

The continuous-time formulation — Ornstein-Uhlenbeck and Itô calculus.

General Forward SDEVariance Preserving SDE (VP-SDE)Variance Exploding SDE (VE-SDE)VP-SDE vs VE-SDE Comparison
Bridging frameworks
6
Continuous vs Discrete

Connecting DDPM discrete steps to the SDE framework.

Discrete-Time Formulation (DDPM)Continuous-Time Formulation (Score SDE)Connecting Discrete and ContinuousPractical Considerations

Topics

6 topics in this chapter

Generative modeling faces a hard problem: real data lives on a complicated, unknown manifold, and we cannot sample from it directly. Diffusion models sidestep this by destroying structure in a way that is trivial to define, then learning to undo it. But the destruction cannot be arbitrary. If we corrupt a sample too aggressively in one step, the reverse step becomes intractable; if too slowly, we waste thousands of steps. The mathematical-foundations chapter gave us the two tools we need here: the Gaussian distribution and the Markov property. This topic combines them into the forward transition kernel, the single building block of the whole forward process. At each timestep we add a small, calibrated amount of Gaussian noise, shrinking the signal just enough to keep the variance bounded. We first write down the one-step kernel, then chain the steps into a Markov process, and finally visualize how an image dissolves from sharp to structureless as the noise steadily accumulates over hundreds of timesteps.

Definition

The forward process is a fixed, parameter-free Markov chain that, at each timestep tt, rescales the current sample by 1−βt\sqrt{1 - \beta_t} and adds isotropic Gaussian noise of variance βt\beta_t. This variance-preserving transition gradually transforms any data distribution into a standard Gaussian, providing a corruption process that requires no learning and is trivial to define.

In this topic

  1. 1The Forward Transition Kernel
  2. 2The Forward Markov Chain
  3. 3Visualizing Progressive Corruption
1 of 3
The Forward Transition Kernel

q(xt∣xt−1)=N(xt;1−βt xt−1,  βtI)q(x_t | x_{t-1}) = \mathcal{N}(x_t; \sqrt{1 - \beta_t}\, x_{t-1},\; \beta_t \mathbf{I})

Each step of the forward process is a Gaussian perturbation. The mean is 1−βt xt−1\sqrt{1 - \beta_t}\, x_{t-1}, which slightly shrinks the signal, and the variance is βtI\beta_t \mathbf{I}, which adds isotropic noise. The scaling factor 1−βt\sqrt{1 - \beta_t} ensures that the variance of xtx_t does not explode over time. Together, shrinking the signal and adding noise gradually transforms any data distribution into a standard Gaussian N(0,I)\mathcal{N}(0, \mathbf{I}) as t→Tt \to T.

Mathematical Intuition

The transition kernel q(xt∣xt−1)=N(1−βt xt−1,βtI)q(x_t | x_{t-1}) = \mathcal{N}(\sqrt{1-\beta_t}\, x_{t-1}, \beta_t I) is a contraction mapping in distribution space. The scaling 1−βt\sqrt{1-\beta_t} shrinks the signal variance by a factor 1−βt1-\beta_t, while the additive noise injects exactly βt\beta_t of fresh variance. Together these preserve unit total variance: Var(xt)=(1−βt)Var(xt−1)+βt=1\text{Var}(x_t) = (1-\beta_t)\text{Var}(x_{t-1}) + \beta_t = 1 whenever Var(xt−1)=1\text{Var}(x_{t-1})=1. This variance-preserving property is what makes the process converge to N(0,I)\mathcal{N}(0,I) rather than diverging.

Example:

If βt=0.01\beta_t = 0.01 and xt−1=[3.0,−1.0]x_{t-1} = [3.0, -1.0], what is the distribution of xtx_t?

2 of 3
The Forward Markov Chain

q(x1:T∣x0)=∏t=1Tq(xt∣xt−1)q(x_{1:T} | x_0) = \prod_{t=1}^{T} q(x_t | x_{t-1})

The full forward process is a Markov chain: the joint distribution of every noisy sample x1,…,xTx_1, \ldots, x_T given x0x_0 factorizes into a product of the one-step kernels from the previous concept. The symbol q(x1:T∣x0)q(x_{1:T} \mid x_0) denotes this joint law, and the product runs over all TT transitions. The Markov property means xtx_t is conditionally independent of x0,…,xt−2x_0, \ldots, x_{t-2} once xt−1x_{t-1} is known, so history beyond the immediate past is irrelevant. This is what makes the process tractable: specifying one-step transitions determines the entire chain. Break the Markov assumption and each reverse step would have to condition on the full trajectory, which is intractable.

Mathematical Intuition

The Markov factorization q(x1:T∣x0)=∏tq(xt∣xt−1)q(x_{1:T}|x_0) = \prod_t q(x_t|x_{t-1}) means the entire forward process is determined by its one-step transitions. In information-theoretic terms, the data processing inequality guarantees mutual information I(x0;xt)I(x_0; x_t) is monotonically non-increasing in tt. Each step irreversibly destroys information, and the chain of conditional independence constraints is what makes the reverse process decompose into tractable single-step denoising problems.

Example:

Why is the Markov property important for making the reverse process tractable?

3 of 3
Visualizing Progressive Corruption

xt=1−βt xt−1+βt ϵ,ϵ∼N(0,I)x_t = \sqrt{1 - \beta_t}\, x_{t-1} + \sqrt{\beta_t}\, \epsilon, \quad \epsilon \sim \mathcal{N}(0, \mathbf{I})

Starting from a clean image x0x_0, the forward process generates samples at increasing noise levels. At early timesteps (t≈0t \approx 0), the image is nearly perfect. At intermediate timesteps (t≈T/2t \approx T/2), large-scale structure (shapes, colors) is still visible but details are lost. At late timesteps (t≈Tt \approx T), the sample is indistinguishable from random noise. The rate at which structure is destroyed depends critically on the noise schedule {βt}\{\beta_t\}.

Mathematical Intuition

At timestep tt, the noisy sample is xt=αˉt x0+1−αˉt ϵx_t = \sqrt{\bar{\alpha}_t}\,x_0 + \sqrt{1-\bar{\alpha}_t}\,\epsilon. The signal-to-noise ratio SNR(t)=αˉt/(1−αˉt)\text{SNR}(t) = \bar{\alpha}_t/(1-\bar{\alpha}_t) determines what information survives. High-frequency details (edges, textures) are destroyed first because they occupy a smaller fraction of the total signal energy. Low-frequency structure (overall shape, color) persists until αˉt≪1\bar{\alpha}_t \ll 1. This multi-scale destruction is why diffusion models naturally generate coarse-to-fine.

Example:

For a 256x256 image with T=1000T = 1000 and linear schedule β1=10−4\beta_1 = 10^{-4}, βT=0.02\beta_T = 0.02, at what timestep is roughly half the signal energy destroyed?

Theory Exercise

Problem:

Prove that if q(xt∣xt−1)=N(xt;1−βt xt−1,βtI)q(x_t | x_{t-1}) = \mathcal{N}(x_t; \sqrt{1 - \beta_t}\, x_{t-1}, \beta_t \mathbf{I}) and we start from data with Var(x0)=1\text{Var}(x_0) = 1, then Var(xt)=1\text{Var}(x_t) = 1 for all tt (the variance is preserved at each step).

Hints:
  • Use the law of total variance or compute Var(x_t) directly from the transition
  • Recall that for $x_t = ax_{t-1} + b\epsilon$, we have $\text{Var}(x_t) = a^2 \text{Var}(x_{t-1}) + b^2$
  • Substitute $a = \sqrt{1 - \beta_t}$ and $b = \sqrt{\beta_t}$