Mathematics for AI and Machine Learning

Foundations for modern AI and machine learning

Fast Diffusion Sampler

Chapter 20 Dynamics & diffusion

Chapter 20: ODE, SDE, and Continuous Limits of Algorithms — DDIM and Fast Diffusion Samplers

From the book

Chapter 20: ODE, SDE, and Continuous Limits of Algorithms. In the chapter mind map this icon labels DDIM and Fast Diffusion Samplers. The discussion below is excerpted and lightly edited from § DDIM and Fast Diffusion Samplers in Mathematics for AI and Machine Learning.

DDIM (Denoising Diffusion Implicit Models)[^ddim] was one of the first methods to demonstrate that diffusion models can be sampled deterministically. DDIM uses the learned denoising function without explicit noise injection, effectively solving a discretized version of the probability flow ODE.

The key insight is that the denoising function learned during training already encodes the score function, so we can use it deterministically during sampling. Concretely, a DDPM-trained model predicts the noise $\boldsymbol\epsilon_\theta(\mathbf{x}_t, t)$ used to construct $\mathbf{x}_t = \sqrt{\alpha_t}\mathbf{x}_0 + \sqrt{1-\alpha_t}\boldsymbol\epsilon$, which is related to the score by:

DDIM first uses $\boldsymbol\epsilon_\theta$ to form an estimate of the clean data,

and then takes a step toward the same noise level implied by $\alpha_{t-1}$:

The variance parameter $\sigma_t$ interpolates between two familiar samplers without retraining the model: $\sigma_t = 0$ removes all injected noise, recovering a deterministic update that is exactly the discretized probability flow ODE (using the score identity above), while a particular choice of $\sigma_t > 0$ recovers the original stochastic DDPM ancestral sampler. Because the $\sigma_t = 0$ trajectory follows a smooth ODE rather than a diffusive SDE path, it needs far fewer steps to stay close to the true trajectory — the same speed/diversity trade-off summarized in the table above, now visible as one tunable parameter in a single update rule.

What this drawing shows

What you see. Dense gray $N$-step chain fixed; a purple few-step fast-sampler path extends in far fewer jumps toward the same endpoint.

In the mind map. Chapter 20 — DDIM and Fast Diffusion Samplers. See From the book above for definitions, figures, and worked examples.

Where to read next

Open Chapter 20 companion →

Read the full definitions, figures, and worked examples in Chapter 20: ODE, SDE, and Continuous Limits of Algorithms — see the mind-map node DDIM and Fast Diffusion Samplers.

PNG Icons

Textless (256×256 px)
PNG 256×256 px Copy PNG URL
Textless (64×64 px)
PNG 64×64 px Copy PNG URL
Textless (32×32 px)
PNG 32×32 px Copy PNG URL

Animated GIFs

Animated GIF (256×256 px)
GIF 256×256 px Copy GIF URL
Animated GIF (128×128 px)
GIF 128×128 px Copy GIF URL
Animated GIF (64×64 px)
GIF 64×64 px Copy GIF URL