2D Distribution Step 0 / 50

Noise Schedule

Controls

50
5

What are Diffusion Models?

Diffusion models are generative models that learn to produce data by reversing a gradual noising process. They have achieved state-of-the-art results in image generation (DALL-E 2, Stable Diffusion, Midjourney).

Forward Process

The forward process gradually adds Gaussian noise to data over T timesteps until it becomes pure noise. This destroys all structure in the data.

Reverse Process

The reverse process learns to denoise: starting from pure noise, a neural network predicts and removes noise at each step, gradually recovering the original data distribution.

How to Use

  • Choose a distribution to set the data shape
  • Run Forward to watch noise destroy structure
  • Run Reverse to watch data emerge from noise
  • Use Step to advance one timestep at a time
  • Adjust steps to control the diffusion granularity

Forward Diffusion

At each timestep t, noise is added according to a variance schedule βt:

q(xt | xt-1) = N(xt; √(1 - βt) xt-1, βt I)

Each step mixes the current sample with a small amount of Gaussian noise.

Reverse Denoising

A neural network εθ is trained to predict the noise added at each step:

pθ(xt-1 | xt) = N(xt-1; μθ(xt, t), σt² I)

The model predicts the mean μθ of the denoised distribution.

Training Objective

The model is trained to predict the noise ε that was added:

L = E[ || ε - εθ(√α̅t x0 + √(1 - α̅t) ε, t) ||² ]

Simple MSE loss between actual and predicted noise.

Noise Schedule

βt = linear schedule from β1 to βT
αt = 1 - βt
α̅t = ∏s=1t αs

α̅t (alpha-bar) controls the total noise at step t. It decreases from 1 (clean) to ~0 (pure noise).

Closed-Form Forward

q(xt | x0) = N(xt; √α̅t x0, (1 - α̅t) I)

We can jump to any timestep t directly without iterating.

Evidence Lower Bound (ELBO)

log p(x) ≥ Eq[ log p(x0|x1) - Σt DKL(q(xt-1|xt,x0) || pθ(xt-1|xt)) ]

The training maximizes a variational lower bound on the log-likelihood.

Diffusion Status

Current Step 0
Total Steps 50
Process Forward
Noise Level (α̅t) 1.000
Distribution Swiss Roll
Status Ready