DDIM Sampler
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. Three deterministic DDIM denoising paths grow from noise to data; a faint dashed SDE path stays for contrast with non-Markovian sampling.
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
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.