Generative Modeling Theory

DDIM sampling

A vanilla diffusion sampler must crawl through hundreds of small stochastic steps, which is slow. DDIM is a way to reach the same kind of samples in a handful of deterministic steps, without retraining the model. The trick is to reinterpret the same trained noise predictor through a different, non-Markovian generative process whose marginals still match training, but whose transitions can be made deterministic and skip many intermediate noise levels.

At each step DDIM first uses the noise prediction to estimate the clean datum directly, then re-noises that estimate to the next, lower noise level along a chosen schedule. A variance parameter interpolates between the fully stochastic DDPM chain at one extreme and a fully deterministic update at the other. In the deterministic limit DDIM is exactly an Euler discretization of the probability flow ODE, which is why it admits large step sizes and gives a meaningful, invertible latent encoding of each generated sample.

Determinism makes DDIM the practical default for editing and inversion: because the noise-to-image map is a fixed function, you can encode a real image to its latent, manipulate it, and decode back, and you can interpolate smoothly between samples by interpolating their latents.

x_{t-1}=\sqrt{\bar\alpha_{t-1}}\,\hat x_0(x_t)+\sqrt{1-\bar\alpha_{t-1}-\sigma_t^2}\,\epsilon_\theta(x_t,t)+\sigma_t z

Setting the noise scale sigma to zero gives the deterministic DDIM update, an ODE step in disguise.

DDIM inversion is only approximate when guidance is on, because guidance changes the effective vector field and breaks the exact reversibility of the unguided ODE.

Also called
denoising diffusion implicit modelsDDIMDDIM 取樣