DDIM: Denoising Diffusion Implicit Models
DDIM (Denoising Diffusion Implicit Models), introduced by Song et al. (2020), reformulates the reverse process of diffusion models as a non-Markovian deterministic mapping, enabling high-quality image synthesis with 10–50× fewer function evaluations than DDPM while reusing the same pretrained score network. This breakthrough decouples the generative trajectory length from the number of training timesteps, making diffusion models practically deployable in latency-sensitive applications. Remarkably, DDIM's deterministic sampler defines a bijective encoding that allows exact reconstruction of any real image through inversion — a property that probabilistic DDPM samplers fundamentally cannot achieve.
DDIM's key insight is that the denoising score network trained under DDPM's Markovian objective is not intrinsically tied to a Markovian reverse process — the same network can serve as a velocity field for an entire family of non-Markovian generative processes parameterized by a continuous hyperparameter σ. By setting σ → 0, the stochastic reverse SDE collapses to an ODE whose solution can be accurately integrated with large step sizes, enabling fast deterministic generation. The "aha moment" is recognizing that the forward process only needs to have the same marginals q(xₜ | x₀) as DDPM — the conditional structure q(xₜ | xₜ₋₁) can be anything that produces those marginals, freeing the reverse process from Markovian constraints entirely.
Practitioners routinely assume that DDIM acceleration comes from a better or differently trained model — they attempt to retrain networks specifically for DDIM and are confused when the original DDPM checkpoint already works. The correct mental model is that DDIM is a inference algorithm, not a model: it changes only how you traverse the learned score landscape at test time. A related confusion is believing the DDIM deterministic sampler is equivalent to running an ODE solver on the probability flow ODE from Score-Based Generative Models — while they are deeply connected, DDIM's discrete update rule is derived from a specific first-order integration scheme of that ODE, and higher-order ODE solvers (e.g., DPM-Solver, DEIS) are distinct improvements that build on this connection explicitly.
How It Works
Forward Process and Marginal Preservation
DDPM defines a Markovian forward process where each step adds Gaussian noise with a fixed schedule. DDIM's key observation is that the marginals of this process are sufficient for training — the joint structure is irrelevant. The forward marginal at any timestep t is:
Explanation: Any noisy sample xₜ can be sampled directly from x₀ via a single Gaussian, where ᾱₜ = ∏ₛ₌₁ᵗ αₛ is the cumulative product of noise retention factors and controls the signal-to-noise ratio at step t. Here αₜ = 1 − βₜ for a noise schedule {βₜ}ᵀₜ₌₁, and ᾱₜ decreases monotonically from ≈1 to ≈0 as t → T. This means any xₜ can be written in closed form as:
Explanation: This reparameterization expresses xₜ as a deterministic mixture of the clean signal x₀ and independent Gaussian noise ε, which is exactly what the score network is trained to invert.
Non-Markovian Reverse Process
DDIM constructs a family of inference distributions indexed by a vector σ = (σ₁, …, σ_T) ∈ ℝ₊ᵀ. For any such vector, the joint q_σ(x₁:T | x₀) is defined such that all marginals q_σ(xₜ | x₀) remain exactly Eq. [1]. The reverse conditional takes the form:
Explanation: Given access to x₀ and xₜ, this defines the distribution over xₜ₋₁ as a point mass (when σₜ = 0) plus optional stochastic noise σₜ, where the mean interpolates between the clean prediction and the "direction pointing to xₜ." The mean in Eq. [3] has a clean geometric interpretation: the first term is the predicted clean signal scaled to timestep t−1, and the second term is the residual "direction" vector scaled to maintain the correct noise level, adjusted by σₜ² which absorbs the desired stochasticity. At training time, x₀ is unknown, so it is replaced by the model's prediction x̂₀(xₜ, t) = (xₜ − √(1 − ᾱₜ) ε_θ(xₜ, t)) / √ᾱₜ.
The DDIM Sampling Step
Substituting the neural network's noise prediction into Eq. [3] with the clean image estimated as x̂₀, the practical sampling update is:
Explanation: The sampler decomposes the transition into three geometrically interpretable components: scaling the denoised image estimate to timestep t−1, adding back a controlled amount of the predicted noise direction, and optionally injecting fresh randomness via εₜ ~ 𝒩(0, I). When σₜ = 0 for all t, the process becomes fully deterministic — no fresh noise is injected and the mapping xᵀ ↦ x₀ is a bijection. When σₜ = √((1 − ᾱₜ₋₁)/(1 − ᾱₜ)) · √(1 − ᾱₜ/ᾱₜ₋₁), DDIM exactly recovers the DDPM posterior, completing the unification.
Accelerated Sampling via Subsequences
The defining innovation enabling acceleration is that Eq. [4] can be applied to any subsequence τ = (τ₁ < τ₂ < … < τ_S) ⊂ {1, …, T} with S ≪ T. The effective cumulative noise coefficients ᾱ_τᵢ are directly readable from the pretrained model's schedule. The resulting sampling error scales as O(1/S) for the deterministic sampler — the same asymptotic rate as first-order ODE integration — compared to DDPM's O(1/T) convergence requiring T steps. Formally, Song et al. prove the ELBO objective used to train ε_θ under DDPM is a surrogate lower bound that depends only on marginals, so the pretrained ε_θ remains valid for any subsequence:
Explanation: The training objective is a reweighted sum of denoising score matching losses over all timesteps, where γₜ are positive weights; crucially, each term depends only on the marginal q(xₜ|x₀) and not on the Markovian structure of the forward process, justifying arbitrary subsequence sampling.
Jiaming Song is a PhD student at Stanford University under Stefano Ermon, whose research sits at the intersection of probabilistic generative modeling and scalable inference. He developed the non-Markovian forward process family and deterministic sampler that constitute DDIM (Song, Meng & Ermon, ICLR 2021), which became one of the most-cited papers in generative modeling with direct descendants in nearly every production diffusion pipeline. A surprising fact: Song simultaneously led development of the score-based SDE framework (Song et al., NeurIPS 2020) that provides the continuous-time theoretical unification of DDPM and DDIM, making him central to two of the three foundational theoretical pillars of modern diffusion models within a single graduate school year.
Intuition
Imagine you are navigating from a foggy city (pure noise, xᵀ) back to your home (the clean image, x₀). DDPM is like walking through the fog in tiny steps, randomly bumping against walls at each step — you need thousands of steps because each bump (injected noise) sends you slightly off course and must be corrected. DDIM is like owning a GPS: at every position, you can estimate roughly where home is (the x̂₀ prediction), compute the straight-line bearing toward it, and take a large confident stride. You still re-estimate at each checkpoint because the fog distorts your GPS, but you need far fewer checkpoints because you are not fighting self-induced randomness. The σₜ parameter is the "boldness dial" — set to zero, you take only confident GPS-guided steps and your path is fully reproducible from the same starting fog position; set to the DDPM value, you re-introduce the random bumping and recover exactly DDPM's behavior. The bijective encoding property at σ = 0 is then natural: since every step is deterministic given the network, the reverse journey from x₀ back to xᵀ is equally well-defined, meaning you can "fog up" any real image and unfog it again exactly — a capability that enables powerful editing applications like SDEdit and prompt-to-prompt interpolation.