Forward Diffusion Process

Volume III, Chapter 10 — Part I. Rigorous derivation of the forward diffusion Markov chain, closed-form marginal via induction, noise schedules, signal-to-noise ratio, and connection to the ε-prediction training objective.

Intermediate

Table of Contents

  1. Learning Objectives
  2. Prerequisites
  3. Notation
  4. Core Intuition
  5. The Forward Markov Chain
  6. Reparameterization and Notation
  7. Closed-Form Marginal: Proof by Induction
  8. Boundary Cases and Convergence to Noise
  9. Noise Schedules
  10. Signal-to-Noise Ratio
  11. Connection to the Training Objective
  12. Worked Examples
  13. Connection to the Broader Curriculum
  14. Common Pitfalls and Misconceptions
  15. Research Perspective
  16. Summary of Takeaways
  17. Exercises

Learning Objectives

After reading this chapter, you should be able to:

  1. Define the forward diffusion Markov chain q(xtxt1)q(\mathbf{x}_t \mid \mathbf{x}_{t-1}) and the joint q(x1:Tx0)q(\mathbf{x}_{1:T} \mid \mathbf{x}_0).
  2. Derive the closed-form marginal q(xtx0)q(\mathbf{x}_t \mid \mathbf{x}_0) by induction on tt.
  3. Express sampling as xt=αˉtx0+1αˉtϵ\mathbf{x}_t = \sqrt{\bar{\alpha}_t}\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_t}\boldsymbol{\epsilon}.
  4. Compare linear and cosine noise schedules and their effect on αˉt\bar{\alpha}_t.
  5. Define and interpret the signal-to-noise ratio SNR(t)=αˉt/(1αˉt)\text{SNR}(t) = \bar{\alpha}_t/(1-\bar{\alpha}_t).
  6. Explain how the closed-form enables efficient ϵ\boldsymbol{\epsilon}-prediction training.

Prerequisites


Notation

  • x0\mathbf{x}_0 — Clean data sample
  • xt\mathbf{x}_t — Noised sample at diffusion step tt
  • βt,αˉt\beta_t, \bar{\alpha}_t — Noise schedule and cumulative signal retention
  • q(xtxt1)q(\mathbf{x}_t \mid \mathbf{x}_{t-1}) — Forward Markov transition
  • TT — Total number of diffusion steps

Core Intuition

Generative modeling seeks to sample from q(x0)q(\mathbf{x}_0) — the data distribution. Diffusion models define a forward process that gradually corrupts data with Gaussian noise over TT steps until xTN(0,I)\mathbf{x}_T \approx \mathcal{N}(\mathbf{0}, \mathbf{I}), then learn to reverse this corruption.

The forward process is fixed (not learned). Its mathematical structure — particularly the closed-form marginal q(xtx0)q(\mathbf{x}_t \mid \mathbf{x}_0) — makes training tractable: we can sample any noise level tt in one step and train a network to predict the noise.

This chapter develops the forward process completely. Reverse Process derives denoising; Classifier-Free Guidance adds conditioning.

Series context. Volume III, Chapter 10 (Diffusion Models), Part I.

Interactive: Forward Diffusion Process

t = 0 (data)
Clean data — structured clusters visible
Key idea: Forward diffusion gradually destroys structure by adding Gaussian noise: x_t = √ᾱ_t · x₀ + √(1-ᾱ_t) · ε. The reverse process learns to undo this, recovering data from noise.

The Forward Markov Chain

Definition 1 (Forward Transition). Given x0q(x0)\mathbf{x}_0 \sim q(\mathbf{x}_0), define the forward process as a Markov chain:

q(xtxt1)=N(xt;1βtxt1,βtI),(1)q(\mathbf{x}_t \mid \mathbf{x}_{t-1}) = \mathcal{N}(\mathbf{x}_t; \sqrt{1-\beta_t}\,\mathbf{x}_{t-1}, \beta_t \mathbf{I}), \tag{1}

where βt(0,1)\beta_t \in (0, 1) is the variance schedule at step tt.

Interpretation. Mean 1βtxt1\sqrt{1-\beta_t}\,\mathbf{x}_{t-1} shrinks the signal; covariance βtI\beta_t \mathbf{I} adds isotropic noise.

Definition 2 (Joint Distribution).

q(x1:Tx0)=t=1Tq(xtxt1).(2)q(\mathbf{x}_{1:T} \mid \mathbf{x}_0) = \prod_{t=1}^{T} q(\mathbf{x}_t \mid \mathbf{x}_{t-1}). \tag{2}

Reparameterization and Notation

Lemma 1 (Reparameterization).

xt=1βtxt1+βtϵt,ϵtN(0,I).(3)\mathbf{x}_t = \sqrt{1-\beta_t}\,\mathbf{x}_{t-1} + \sqrt{\beta_t}\,\boldsymbol{\epsilon}_t, \quad \boldsymbol{\epsilon}_t \sim \mathcal{N}(\mathbf{0}, \mathbf{I}). \tag{3}

Definition 3.

αt=1βt,αˉt=s=1tαs.(4)\alpha_t = 1 - \beta_t, \qquad \bar{\alpha}_t = \prod_{s=1}^{t} \alpha_s. \tag{4}

αˉt\bar{\alpha}_t is the cumulative signal retention — monotonically decreasing from αˉ0=1\bar{\alpha}_0 = 1 to αˉT0\bar{\alpha}_T \approx 0.

Single-step form:

xt=αtxt1+1αtϵt.(5)\mathbf{x}_t = \sqrt{\alpha_t}\,\mathbf{x}_{t-1} + \sqrt{1-\alpha_t}\,\boldsymbol{\epsilon}_t. \tag{5}

Closed-Form Marginal: Proof by Induction

Theorem 1 (Closed-Form Marginal).

q(xtx0)=N(xt;αˉtx0,(1αˉt)I),(6)q(\mathbf{x}_t \mid \mathbf{x}_0) = \mathcal{N}(\mathbf{x}_t; \sqrt{\bar{\alpha}_t}\,\mathbf{x}_0, (1-\bar{\alpha}_t)\mathbf{I}), \tag{6}

equivalently:

xt=αˉtx0+1αˉtϵ,ϵN(0,I).(7)\mathbf{x}_t = \sqrt{\bar{\alpha}_t}\,\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_t}\,\boldsymbol{\epsilon}, \quad \boldsymbol{\epsilon} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}). \tag{7}

Proof by induction on tt.

Base (t=1t=1): From (5): x1=α1x0+1α1ϵ1\mathbf{x}_1 = \sqrt{\alpha_1}\mathbf{x}_0 + \sqrt{1-\alpha_1}\boldsymbol{\epsilon}_1. Mean α1x0\sqrt{\alpha_1}\mathbf{x}_0, variance (1α1)I(1-\alpha_1)\mathbf{I}. Since αˉ1=α1\bar{\alpha}_1 = \alpha_1, matches (6).

Inductive step: Assume (7) for t1t-1:

xt1=αˉt1x0+1αˉt1ϵ.(8)\mathbf{x}_{t-1} = \sqrt{\bar{\alpha}_{t-1}}\,\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_{t-1}}\,\boldsymbol{\epsilon}'. \tag{8}

Substitute into (5):

xt=αt(αˉt1x0+1αˉt1ϵ)+1αtϵt(9)\mathbf{x}_t = \sqrt{\alpha_t}\left(\sqrt{\bar{\alpha}_{t-1}}\,\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_{t-1}}\,\boldsymbol{\epsilon}'\right) + \sqrt{1-\alpha_t}\,\boldsymbol{\epsilon}_t \tag{9} =αˉtx0+αt(1αˉt1)ϵ+1αtϵtcombined noise.(10)= \sqrt{\bar{\alpha}_t}\,\mathbf{x}_0 + \underbrace{\sqrt{\alpha_t(1-\bar{\alpha}_{t-1})}\,\boldsymbol{\epsilon}' + \sqrt{1-\alpha_t}\,\boldsymbol{\epsilon}_t}_{\text{combined noise}}. \tag{10}

Mean: αtαˉt1=αˉt\sqrt{\alpha_t \bar{\alpha}_{t-1}} = \sqrt{\bar{\alpha}_t}.

Noise variance (independent Gaussians add):

αt(1αˉt1)+(1αt)=1αtαˉt1=1αˉt.(11)\alpha_t(1-\bar{\alpha}_{t-1}) + (1-\alpha_t) = 1 - \alpha_t\bar{\alpha}_{t-1} = 1 - \bar{\alpha}_t. \tag{11}

Combined noise 1αˉtϵ\equiv \sqrt{1-\bar{\alpha}_t}\,\boldsymbol{\epsilon}. \blacksquare

Important equation. Equation (7) enables O(1)O(1) sampling at any timestep — critical for training with random tU{1,,T}t \sim \mathcal{U}\{1, \ldots, T\}.


Boundary Cases and Convergence to Noise

Proposition 1. At t=0t=0: αˉ0=1\bar{\alpha}_0 = 1, so x0\mathbf{x}_0 is recovered exactly.

Proposition 2. With appropriate schedule, αˉT0\bar{\alpha}_T \approx 0, so xTϵN(0,I)\mathbf{x}_T \approx \boldsymbol{\epsilon} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}) — pure noise independent of x0\mathbf{x}_0.


Noise Schedules

Definition 4 (Linear Schedule).

βt=β1+t1T1(βTβ1),β1=104,βT=0.02.(12)\beta_t = \beta_1 + \frac{t-1}{T-1}(\beta_T - \beta_1), \quad \beta_1 = 10^{-4}, \beta_T = 0.02. \tag{12}

Definition 5 (Cosine Schedule, Nichol & Dhariwal).

αˉt=f(t)f(0),f(t)=cos2(t/T+s1+sπ2),s=0.008,(13)\bar{\alpha}_t = \frac{f(t)}{f(0)}, \quad f(t) = \cos^2\left(\frac{t/T + s}{1+s} \cdot \frac{\pi}{2}\right), \quad s = 0.008, \tag{13} βt=1αˉtαˉt1.(14)\beta_t = 1 - \frac{\bar{\alpha}_t}{\bar{\alpha}_{t-1}}. \tag{14}

Cosine schedule preserves structure longer at early timesteps.


Signal-to-Noise Ratio

Definition 6 (SNR).

SNR(t)=αˉt1αˉt.(15)\text{SNR}(t) = \frac{\bar{\alpha}_t}{1 - \bar{\alpha}_t}. \tag{15}

Properties: SNR(0)=\text{SNR}(0) = \infty; SNR(T)0\text{SNR}(T) \approx 0; monotonically decreasing.

Interpretation. At SNR(t)=1\text{SNR}(t) = 1: equal signal and noise power (αˉt=0.5\bar{\alpha}_t = 0.5).


Connection to the Training Objective

Definition 7 (ϵ\boldsymbol{\epsilon}-Prediction Loss).

Lsimple=Et,x0,ϵ[ϵϵθ(xt,t)2],(16)\mathcal{L}_{\text{simple}} = \mathbb{E}_{t, \mathbf{x}_0, \boldsymbol{\epsilon}}\left[\|\boldsymbol{\epsilon} - \boldsymbol{\epsilon}_\theta(\mathbf{x}_t, t)\|^2\right], \tag{16}

where xt=αˉtx0+1αˉtϵ\mathbf{x}_t = \sqrt{\bar{\alpha}_t}\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_t}\boldsymbol{\epsilon} from (7).

Proposition 3 (Recovery). Given predicted noise:

x^0=xt1αˉtϵθ(xt,t)αˉt.(17)\hat{\mathbf{x}}_0 = \frac{\mathbf{x}_t - \sqrt{1-\bar{\alpha}_t}\,\boldsymbol{\epsilon}_\theta(\mathbf{x}_t, t)}{\sqrt{\bar{\alpha}_t}}. \tag{17}

Derived fully in Reverse Process via ELBO minimization.


Worked Examples

Example 1: t=500t=500, Cosine Schedule

αˉ5000.5\bar{\alpha}_{500} \approx 0.5, SNR 1\approx 1. Half signal, half noise.

Example 2: Variance Addition

Two independent N(0,σi2)\mathcal{N}(0, \sigma_i^2) sum to N(0,σ12+σ22)\mathcal{N}(0, \sigma_1^2 + \sigma_2^2) — key step in induction.


Connection to the Broader Curriculum


Common Pitfalls and Misconceptions

Pitfall 1: Confusing αt\alpha_t and αˉt\bar{\alpha}_t.

Pitfall 2: Iterating tt steps during training instead of using (7).

Pitfall 3: Forgetting βt\beta_t must stay in (0,1)(0,1).

Pitfall 4: Assuming forward process is learned — it is fixed.


Research Perspective

DDPM (Ho et al., 2020). Cosine schedule (Nichol & Dhariwal, 2021). Continuous-time SDE formulation (Song et al., 2021). Flow matching as alternative corruption path.


Summary of Takeaways

  • Forward stepq(xtxt1)=N(1βtxt1,βtI)q(\mathbf{x}_t \mid \mathbf{x}_{t-1}) = \mathcal{N}(\sqrt{1-\beta_t}\mathbf{x}_{t-1}, \beta_t \mathbf{I})
  • Closed formxt=αˉtx0+1αˉtϵ\mathbf{x}_t = \sqrt{\bar{\alpha}_t}\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_t}\boldsymbol{\epsilon}
  • SNRαˉt/(1αˉt)\bar{\alpha}_t / (1-\bar{\alpha}_t)
  • Training — Predict ϵ\boldsymbol{\epsilon} from (xt,t)(\mathbf{x}_t, t)

Next: Reverse Process →


Exercises

Exercise 1. Complete the induction proof without skipping (11).

Exercise 2. Derive βt\beta_t from cosine αˉt\bar{\alpha}_t (14).

Exercise 3. At what tt is SNR = 1 for linear schedule with T=1000T=1000?

Exercise 4. Prove αˉt\bar{\alpha}_t is monotonically decreasing.

Exercise 5. Derive (17) from (7).

Exercise 6. Why does (7) make random-tt training efficient?

Exercise 7. Compare forward diffusion to Forward KL in VAEs.

Exercise 8. What happens if βt1\beta_t \to 1 too quickly?