Table of Contents
Learning Objectives
Prerequisites
Notation
Core Intuition
The Forward Markov Chain
Reparameterization and Notation
Closed-Form Marginal: Proof by Induction
Boundary Cases and Convergence to Noise
Noise Schedules
Signal-to-Noise Ratio
Connection to the Training Objective
Worked Examples
Connection to the Broader Curriculum
Common Pitfalls and Misconceptions
Research Perspective
Summary of Takeaways
Exercises
Learning Objectives
After reading this chapter, you should be able to:
Define the forward diffusion Markov chain q ( x t ∣ x t − 1 ) q(\mathbf{x}_t \mid \mathbf{x}_{t-1}) q ( x t ∣ x t − 1 ) and the joint q ( x 1 : T ∣ x 0 ) q(\mathbf{x}_{1:T} \mid \mathbf{x}_0) q ( x 1 : T ∣ x 0 ) .
Derive the closed-form marginal q ( x t ∣ x 0 ) q(\mathbf{x}_t \mid \mathbf{x}_0) q ( x t ∣ x 0 ) by induction on t t t .
Express sampling as x t = α ˉ t x 0 + 1 − α ˉ t ϵ \mathbf{x}_t = \sqrt{\bar{\alpha}_t}\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_t}\boldsymbol{\epsilon} x t = α ˉ t x 0 + 1 − α ˉ t ϵ .
Compare linear and cosine noise schedules and their effect on α ˉ t \bar{\alpha}_t α ˉ t .
Define and interpret the signal-to-noise ratio SNR ( t ) = α ˉ t / ( 1 − α ˉ t ) \text{SNR}(t) = \bar{\alpha}_t/(1-\bar{\alpha}_t) SNR ( t ) = α ˉ t / ( 1 − α ˉ t ) .
Explain how the closed-form enables efficient ϵ \boldsymbol{\epsilon} ϵ -prediction training.
Prerequisites
Notation
x 0 \mathbf{x}_0 x 0 — Clean data sample
x t \mathbf{x}_t x t — Noised sample at diffusion step t t t
β t , α ˉ t \beta_t, \bar{\alpha}_t β t , α ˉ t — Noise schedule and cumulative signal retention
q ( x t ∣ x t − 1 ) q(\mathbf{x}_t \mid \mathbf{x}_{t-1}) q ( x t ∣ x t − 1 ) — Forward Markov transition
T T T — Total number of diffusion steps
Core Intuition
Generative modeling seeks to sample from q ( x 0 ) q(\mathbf{x}_0) q ( x 0 ) — the data distribution. Diffusion models define a forward process that gradually corrupts data with Gaussian noise over T T T steps until x T ≈ N ( 0 , I ) \mathbf{x}_T \approx \mathcal{N}(\mathbf{0}, \mathbf{I}) x T ≈ N ( 0 , I ) , then learn to reverse this corruption.
The forward process is fixed (not learned). Its mathematical structure — particularly the closed-form marginal q ( x t ∣ x 0 ) q(\mathbf{x}_t \mid \mathbf{x}_0) q ( x t ∣ x 0 ) — makes training tractable: we can sample any noise level t t t 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
Timestep: t = 0.00
Forward (add noise) Reverse (denoise)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 x 0 ∼ q ( x 0 ) \mathbf{x}_0 \sim q(\mathbf{x}_0) x 0 ∼ q ( x 0 ) , define the forward process as a Markov chain:
q ( x t ∣ x t − 1 ) = N ( x t ; 1 − β t x t − 1 , β t I ) , (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} q ( x t ∣ x t − 1 ) = N ( x t ; 1 − β t x t − 1 , β t I ) , ( 1 )
where β t ∈ ( 0 , 1 ) \beta_t \in (0, 1) β t ∈ ( 0 , 1 ) is the variance schedule at step t t t .
Interpretation. Mean 1 − β t x t − 1 \sqrt{1-\beta_t}\,\mathbf{x}_{t-1} 1 − β t x t − 1 shrinks the signal; covariance β t I \beta_t \mathbf{I} β t I adds isotropic noise.
Definition 2 (Joint Distribution).
q ( x 1 : T ∣ x 0 ) = ∏ t = 1 T q ( x t ∣ x t − 1 ) . (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} q ( x 1 : T ∣ x 0 ) = t = 1 ∏ T q ( x t ∣ x t − 1 ) . ( 2 )
Reparameterization and Notation
Lemma 1 (Reparameterization).
x t = 1 − β t x t − 1 + β t ϵ t , ϵ t ∼ N ( 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} x t = 1 − β t x t − 1 + β t ϵ t , ϵ t ∼ N ( 0 , I ) . ( 3 )
Definition 3.
α t = 1 − β t , α ˉ t = ∏ s = 1 t α s . (4) \alpha_t = 1 - \beta_t, \qquad \bar{\alpha}_t = \prod_{s=1}^{t} \alpha_s.
\tag{4} α t = 1 − β t , α ˉ t = s = 1 ∏ t α s . ( 4 )
α ˉ t \bar{\alpha}_t α ˉ t is the cumulative signal retention — monotonically decreasing from α ˉ 0 = 1 \bar{\alpha}_0 = 1 α ˉ 0 = 1 to α ˉ T ≈ 0 \bar{\alpha}_T \approx 0 α ˉ T ≈ 0 .
Single-step form:
x t = α t x t − 1 + 1 − α t ϵ t . (5) \mathbf{x}_t = \sqrt{\alpha_t}\,\mathbf{x}_{t-1} + \sqrt{1-\alpha_t}\,\boldsymbol{\epsilon}_t.
\tag{5} x t = α t x t − 1 + 1 − α t ϵ t . ( 5 )
Theorem 1 (Closed-Form Marginal).
q ( x t ∣ x 0 ) = N ( x t ; α ˉ t x 0 , ( 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} q ( x t ∣ x 0 ) = N ( x t ; α ˉ t x 0 , ( 1 − α ˉ t ) I ) , ( 6 )
equivalently:
x t = α ˉ t x 0 + 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} x t = α ˉ t x 0 + 1 − α ˉ t ϵ , ϵ ∼ N ( 0 , I ) . ( 7 )
Proof by induction on t t t .
Base (t = 1 t=1 t = 1 ): From (5): x 1 = α 1 x 0 + 1 − α 1 ϵ 1 \mathbf{x}_1 = \sqrt{\alpha_1}\mathbf{x}_0 + \sqrt{1-\alpha_1}\boldsymbol{\epsilon}_1 x 1 = α 1 x 0 + 1 − α 1 ϵ 1 . Mean α 1 x 0 \sqrt{\alpha_1}\mathbf{x}_0 α 1 x 0 , variance ( 1 − α 1 ) I (1-\alpha_1)\mathbf{I} ( 1 − α 1 ) I . Since α ˉ 1 = α 1 \bar{\alpha}_1 = \alpha_1 α ˉ 1 = α 1 , matches (6).
Inductive step: Assume (7) for t − 1 t-1 t − 1 :
x t − 1 = α ˉ t − 1 x 0 + 1 − α ˉ t − 1 ϵ ′ . (8) \mathbf{x}_{t-1} = \sqrt{\bar{\alpha}_{t-1}}\,\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_{t-1}}\,\boldsymbol{\epsilon}'.
\tag{8} x t − 1 = α ˉ t − 1 x 0 + 1 − α ˉ t − 1 ϵ ′ . ( 8 )
Substitute into (5):
x t = α t ( α ˉ t − 1 x 0 + 1 − α ˉ t − 1 ϵ ′ ) + 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} x t = α t ( α ˉ t − 1 x 0 + 1 − α ˉ t − 1 ϵ ′ ) + 1 − α t ϵ t ( 9 )
= α ˉ t x 0 + α t ( 1 − α ˉ t − 1 ) ϵ ′ + 1 − α t ϵ t ⏟ combined 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} = α ˉ t x 0 + combined noise α t ( 1 − α ˉ t − 1 ) ϵ ′ + 1 − α t ϵ t . ( 10 )
Mean: α t α ˉ t − 1 = α ˉ t \sqrt{\alpha_t \bar{\alpha}_{t-1}} = \sqrt{\bar{\alpha}_t} α t α ˉ t − 1 = α ˉ t .
Noise variance (independent Gaussians add):
α t ( 1 − α ˉ t − 1 ) + ( 1 − α t ) = 1 − α t α ˉ t − 1 = 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} α t ( 1 − α ˉ t − 1 ) + ( 1 − α t ) = 1 − α t α ˉ t − 1 = 1 − α ˉ t . ( 11 )
Combined noise ≡ 1 − α ˉ t ϵ \equiv \sqrt{1-\bar{\alpha}_t}\,\boldsymbol{\epsilon} ≡ 1 − α ˉ t ϵ . ■ \blacksquare ■
Important equation. Equation (7) enables O ( 1 ) O(1) O ( 1 ) sampling at any timestep — critical for training with random t ∼ U { 1 , … , T } t \sim \mathcal{U}\{1, \ldots, T\} t ∼ U { 1 , … , T } .
Boundary Cases and Convergence to Noise
Proposition 1. At t = 0 t=0 t = 0 : α ˉ 0 = 1 \bar{\alpha}_0 = 1 α ˉ 0 = 1 , so x 0 \mathbf{x}_0 x 0 is recovered exactly.
Proposition 2. With appropriate schedule, α ˉ T ≈ 0 \bar{\alpha}_T \approx 0 α ˉ T ≈ 0 , so x T ≈ ϵ ∼ N ( 0 , I ) \mathbf{x}_T \approx \boldsymbol{\epsilon} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}) x T ≈ ϵ ∼ N ( 0 , I ) — pure noise independent of x 0 \mathbf{x}_0 x 0 .
Noise Schedules
Definition 4 (Linear Schedule).
β t = β 1 + t − 1 T − 1 ( β T − β 1 ) , β 1 = 10 − 4 , β 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} β t = β 1 + T − 1 t − 1 ( β T − β 1 ) , β 1 = 1 0 − 4 , β T = 0.02. ( 12 )
Definition 5 (Cosine Schedule, Nichol & Dhariwal).
α ˉ t = f ( t ) f ( 0 ) , f ( t ) = cos 2 ( t / T + s 1 + 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 = f ( 0 ) f ( t ) , f ( t ) = cos 2 ( 1 + s t / T + s ⋅ 2 π ) , s = 0.008 , ( 13 )
β t = 1 − α ˉ t α ˉ t − 1 . (14) \beta_t = 1 - \frac{\bar{\alpha}_t}{\bar{\alpha}_{t-1}}.
\tag{14} β t = 1 − α ˉ t − 1 α ˉ t . ( 14 )
Cosine schedule preserves structure longer at early timesteps.
Signal-to-Noise Ratio
Definition 6 (SNR).
SNR ( t ) = α ˉ t 1 − α ˉ t . (15) \text{SNR}(t) = \frac{\bar{\alpha}_t}{1 - \bar{\alpha}_t}.
\tag{15} SNR ( t ) = 1 − α ˉ t α ˉ t . ( 15 )
Properties: SNR ( 0 ) = ∞ \text{SNR}(0) = \infty SNR ( 0 ) = ∞ ; SNR ( T ) ≈ 0 \text{SNR}(T) \approx 0 SNR ( T ) ≈ 0 ; monotonically decreasing.
Interpretation. At SNR ( t ) = 1 \text{SNR}(t) = 1 SNR ( t ) = 1 : equal signal and noise power (α ˉ t = 0.5 \bar{\alpha}_t = 0.5 α ˉ t = 0.5 ).
Connection to the Training Objective
Definition 7 (ϵ \boldsymbol{\epsilon} ϵ -Prediction Loss).
L simple = E t , x 0 , ϵ [ ∥ ϵ − ϵ θ ( x t , 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} L simple = E t , x 0 , ϵ [ ∥ ϵ − ϵ θ ( x t , t ) ∥ 2 ] , ( 16 )
where x t = α ˉ t x 0 + 1 − α ˉ t ϵ \mathbf{x}_t = \sqrt{\bar{\alpha}_t}\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_t}\boldsymbol{\epsilon} x t = α ˉ t x 0 + 1 − α ˉ t ϵ from (7).
Proposition 3 (Recovery). Given predicted noise:
x ^ 0 = x t − 1 − α ˉ t ϵ θ ( x t , 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} x ^ 0 = α ˉ t x t − 1 − α ˉ t ϵ θ ( x t , t ) . ( 17 )
Derived fully in Reverse Process via ELBO minimization.
Worked Examples
Example 1: t = 500 t=500 t = 500 , Cosine Schedule
α ˉ 500 ≈ 0.5 \bar{\alpha}_{500} \approx 0.5 α ˉ 500 ≈ 0.5 , SNR ≈ 1 \approx 1 ≈ 1 . Half signal, half noise.
Example 2: Variance Addition
Two independent N ( 0 , σ i 2 ) \mathcal{N}(0, \sigma_i^2) N ( 0 , σ i 2 ) sum to N ( 0 , σ 1 2 + σ 2 2 ) \mathcal{N}(0, \sigma_1^2 + \sigma_2^2) N ( 0 , σ 1 2 + σ 2 2 ) — key step in induction.
Connection to the Broader Curriculum
Common Pitfalls and Misconceptions
Pitfall 1: Confusing α t \alpha_t α t and α ˉ t \bar{\alpha}_t α ˉ t .
Pitfall 2: Iterating t t t steps during training instead of using (7).
Pitfall 3: Forgetting β t \beta_t β t must stay in ( 0 , 1 ) (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 step — q ( x t ∣ x t − 1 ) = N ( 1 − β t x t − 1 , β t I ) q(\mathbf{x}_t \mid \mathbf{x}_{t-1}) = \mathcal{N}(\sqrt{1-\beta_t}\mathbf{x}_{t-1}, \beta_t \mathbf{I}) q ( x t ∣ x t − 1 ) = N ( 1 − β t x t − 1 , β t I )
Closed form — x t = α ˉ t x 0 + 1 − α ˉ t ϵ \mathbf{x}_t = \sqrt{\bar{\alpha}_t}\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_t}\boldsymbol{\epsilon} x t = α ˉ t x 0 + 1 − α ˉ t ϵ
SNR — α ˉ t / ( 1 − α ˉ t ) \bar{\alpha}_t / (1-\bar{\alpha}_t) α ˉ t / ( 1 − α ˉ t )
Training — Predict ϵ \boldsymbol{\epsilon} ϵ from ( x t , t ) (\mathbf{x}_t, t) ( x t , t )
Next: Reverse Process →
Exercises
Exercise 1. Complete the induction proof without skipping (11).
Exercise 2. Derive β t \beta_t β t from cosine α ˉ t \bar{\alpha}_t α ˉ t (14).
Exercise 3. At what t t t is SNR = 1 for linear schedule with T = 1000 T=1000 T = 1000 ?
Exercise 4. Prove α ˉ t \bar{\alpha}_t α ˉ t is monotonically decreasing.
Exercise 5. Derive (17) from (7).
Exercise 6. Why does (7) make random-t t t training efficient?
Exercise 7. Compare forward diffusion to Forward KL in VAEs.
Exercise 8. What happens if β t → 1 \beta_t \to 1 β t → 1 too quickly?