A denoising diffusion implicit model (DDIM) is a diffusion-model formulation that generates data by progressively transforming noise into a structured sample. Its central contribution is a family of sampling procedures that can reuse a conventionally trained diffusion denoiser while allowing deterministic generation and substantially fewer sampling steps. Introduced by Jiaming Song, Chenlin Meng, and Stefano Ermon in a paper released in 2020 and presented at ICLR in 2021, DDIM separates the objective used to train a diffusion model from the particular stochastic process used to generate its outputs.
Background and motivation
A denoising diffusion probabilistic model (DDPM) learns to reverse a process that gradually corrupts data with noise. In its standard formulation, the forward process is a Markov chain: each noisy state depends on the preceding state, rather than on the entire sequence of earlier states. A learned reverse process reconstructs data through a succession of denoising transitions.
Early DDPM implementations commonly used hundreds or thousands of reverse steps. Because each step typically requires evaluating a large neural network, generation could be computationally expensive.
DDIM showed that the same denoising training objective can support a broader family of forward processes, including non-Markovian ones. These processes preserve the distributions of individual noisy states conditioned on the original data, while changing the dependencies between states. Their corresponding generation procedures can be stochastic or deterministic and can operate on a reduced sequence of noise levels.
The practical distinction is between training a denoiser and choosing a sampler. DDIM does not ordinarily require a separately trained network: a compatible DDPM noise predictor can also be used for DDIM sampling.
Mathematical formulation
Noisy-data marginals
Let be a data sample and let denote the noise variance assigned to diffusion step . Define
The conditional distribution of the noisy sample at time is
where denotes a Gaussian distribution and is the identity matrix. Equivalently,
As decreases, the data signal becomes weaker relative to the noise. A suitable terminal noise level makes approximately standard Gaussian.
DDIM preserves these conditional marginals. What changes is the joint distribution over the entire trajectory . Its generalized forward construction can depend on the clean sample , rather than being restricted to the original Markov chain.
Training objective
A common parameterization trains a network to predict the noise added to a clean sample. The simplified loss function is
The DDIM construction relates its variational objectives to weighted versions of this denoising objective. The preservation of the noisy-data marginals explains why an existing noise predictor can be reused across different sampling procedures.
This does not imply that all weighting schemes, network parameterizations, or trained models are interchangeable without qualification. The important practical result is that changing to DDIM sampling normally does not require retraining a compatible DDPM denoiser.
Sampling update
Given a noisy state , the network first produces an estimate of the clean sample:
For a transition from noise level to an earlier, less noisy level , a generalized DDIM update is
where is newly sampled noise. A standard parameterization is
The hyperparameter controls the amount of newly injected noise:
- : no fresh noise is added during sampling. Every update is deterministic once and the network are fixed.
- : the variance matches the corresponding ancestral diffusion transition under the selected schedule. On the complete original schedule, this recovers the standard DDPM posterior-variance choice.
- : sampling interpolates between deterministic DDIM and that stochastic transition.
At the clean endpoint, , so the update returns the predicted clean sample without adding noise.
Deterministic generation
With , a fixed initial noise sample , model, conditioning input, and sampling schedule determine the entire trajectory. This is the defining case most often associated with the name DDIM.
Deterministic sampling does not mean that the model generates only one output. Different initial Gaussian samples generally produce different outputs. Randomness enters through the initial state rather than through every reverse transition.
This construction is called an implicit model because it specifies a mechanism for generating samples rather than directly providing a conveniently evaluated data-density formula. It is not a generative adversarial network and does not require adversarial training. Deterministic DDIM updates also do not automatically yield a tractable exact likelihood.
Reproducibility still depends on implementation details. A fixed seed is insufficient if the schedule, conditioning, numerical precision, model parameters, or nondeterministic computing operations change.
Accelerated sampling
DDIM can sample along a subsequence of the training noise levels,
using transitions from directly to . It therefore need not evaluate the network at every training timestep.
For example, a denoiser trained with a thousand discrete noise levels may be used with a schedule containing only tens of sampling steps. This illustrates the method rather than prescribing a universal setting: the achievable quality depends on the model, data, selected noise levels, conditioning, and number of evaluations.
The main computational saving comes from reducing neural-network inference calls. A rough cost model is
where is the number of denoiser evaluations and is the cost of one evaluation. Actual runtime also includes scheduling, memory movement, decoding, and other processing.
DDIM was an important early demonstration of fast diffusion sampling, but it does not have an exclusive ability to skip timesteps. Respaced stochastic samplers and later numerical solvers can also reduce evaluation counts.
Relationship to differential equations
The deterministic DDIM update has a continuous-time interpretation connected to an ordinary differential equation (ODE).
For , define
The sampling update becomes
This resembles an explicit first-order numerical step in the variable . With a suitable continuous-time noise schedule, it connects deterministic diffusion sampling to the probability-flow ODE associated with score-based diffusion models.
The connection explains both DDIM’s acceleration and its limitations. Taking larger steps reduces computation but introduces numerical approximation error. More accurate solvers may obtain better results for the same number of network evaluations. A finite-step DDIM sampler should not be assumed to reproduce the exact distribution of an ideal continuous-time flow.
Applications
Image generation and conditional sampling
DDIM is widely used as a sampler for image-generating diffusion systems. It can operate directly in pixel space or within a latent diffusion model, where denoising occurs in a compressed latent space and a decoder subsequently produces the image.
Conditioning mechanisms are largely separate from the choice of sampler. For example, classifier-free guidance modifies the denoising prediction using conditional and unconditional network outputs; a DDIM update can then use that modified prediction. Guidance changes the sampling trajectory and can affect quality, diversity, and stability.
Inversion and image editing
Deterministic trajectories motivate DDIM inversion: approximately mapping an existing image toward a noisy representation by applying related updates in the opposite direction. The resulting representation can initialize reconstruction or editing, including generation under changed conditioning.
Ordinary DDIM inversion is not an exact algebraic inverse of a finite-step sampler. The network prediction changes with the state and timestep, and reversing a discrete trajectory introduces approximation errors. Reconstruction may deteriorate with coarse schedules or strong guidance. More elaborate inversion procedures can refine intermediate states or conditioning.
Interpolation and controlled comparisons
A deterministic mapping from initial noise to output makes it possible to explore interpolations between initial states. Such interpolations can produce gradual visual changes, although smooth or meaningful changes are not guaranteed.
Fixed initial noise is also useful for comparing prompts, model variants, or guidance settings. It controls one source of variation without ensuring that all resulting images retain the same composition or semantic content.
Limitations and scope
Speed and quality remain a trade-off. Reducing the step count too far can cause artifacts, loss of detail, or changes in the output distribution. DDIM’s ability to sample quickly does not guarantee high quality at arbitrarily low evaluation counts.
Determinism is not a fidelity guarantee. Removing per-step noise changes sampling behavior; it does not by itself establish better quality, coverage, or diversity than a stochastic sampler.
Sampler settings must match the model. Noise schedules, timestep conventions, output parameterizations, and terminal signal-to-noise assumptions affect the update. Networks that predict the clean sample or a velocity-like quantity require the corresponding conversion rather than unmodified use of the noise-prediction formula.
The method inherits the underlying model’s limitations. DDIM does not independently correct biases, memorization, or failures learned from training data. Its contribution concerns the construction and numerical execution of a generative trajectory, not the reliability or appropriateness of every generated sample.