Course contentsShow
← Machine Learning and Deep Learning
Lesson 1527 of 3,53834. Diffusion ModelsFree lesson

Forward Process Closed Form

Derive the closed-form expression for sampling any timestep directly without iterating through all steps.

Forward Process Closed Form

What you'll learn: How to sample any noisy timestep directly in a diffusion model without stepping through all previous noise additions.

The Problem with Iterative Noise Addition

In the forward diffusion process, you've learned that we gradually add noise to an image over T timesteps using a Markov chain. To get the noisy version at timestep t=500, you'd naively need to apply 500 noise addition steps sequentially. This is computationally expensive and unnecessary.

The Closed-Form Solution

Here's the insight: because each noise addition step follows a Gaussian distribution and the variance schedule is predetermined, we can derive a single mathematical formula that jumps directly to any timestep t.

Given:

  • Original data x₀
  • Noise schedule parameters βₜ (variance at each step)
  • Define αₜ = 1 - βₜ and ᾱₜ = ∏(α₁ × α₂ × ... × αₜ) (cumulative product)

The closed-form expression is:

xₜ = √ᾱₜ · x₀ + √(1 - ᾱₜ) · ε

where ε ~ N(0, I) is pure Gaussian noise.

Why This Works

This formula elegantly captures all the accumulated noise from t steps in one shot. The term √ᾱₜ controls how much of the original signal remains, while √(1 - ᾱₜ) controls how much noise has been added. As t increases, ᾱₜ decreases toward zero, meaning more noise and less original signal.

Think of it like a photo fading over time—you don't need to watch every second of fading; you can calculate what it looks like after exactly 10 minutes.

Key Takeaway: The forward process closed form lets you sample any noisy timestep directly using a single equation, making diffusion model training dramatically more efficient by avoiding sequential noise addition.