DDPM

Also known as: Denoising diffusion probabilistic model

On this page 7

DDPM, short for denoising diffusion probabilistic model, is a generative model that learns to produce data by reversing a fixed process that gradually adds Gaussian noise to training examples. In generative AI, the 2020 DDPM formulation by Ho, Jain and Abbeel is the reference design that made diffusion models competitive with GANs for image synthesis and became the foundation of most modern image and video generators.

A trained DDPM starts from pure random noise and removes a small amount of noise at each of many steps, typically 1,000 steps in the original setup, until a clean sample emerges. Its defining strengths are stable training with a simple loss and high sample diversity; its main weakness is slow sampling.

How DDPM learns to reverse noise

A DDPM consists of two Markov chains: a fixed forward diffusion process and a learned reverse denoising process. The forward process takes a training image x0 and, over T steps, adds small amounts of Gaussian noise controlled by a variance schedule of values beta_t. After enough steps, the image becomes statistically indistinguishable from isotropic Gaussian noise.

A key property makes training efficient: the noisy version at any step can be sampled in closed form directly from x0, without simulating every intermediate step. With alpha_bar_t defined as the cumulative product of 1 - beta_t, the noisy sample equals sqrt(alpha_bar_t) * x0 + sqrt(1 - alpha_bar_t) * epsilon, where epsilon is standard Gaussian noise.

The reverse process is a neural network, usually a U-Net with timestep embeddings, trained to predict the noise epsilon that was added. During training, the model sees a random image, a random timestep and fresh noise, and minimizes the mean squared error between the true and predicted noise. This simplified objective is a reweighted form of the variational lower bound on the data likelihood.

The table below lists the main components and the role each one plays.

ComponentRoleOriginal choice
Forward processAdds Gaussian noise step by stepFixed, not learned
Variance scheduleSets noise added per stepLinear, 0.0001 to 0.02
Number of steps TLength of both chains1,000
Denoising networkPredicts the added noiseU-Net with attention
Training lossMeasures prediction errorMSE on noise
Reverse varianceRandomness in each sampling stepFixed, not learned
Core components of a DDPM

Sampling with a trained DDPM

DDPM sampling is ancestral and stochastic: it begins with a noise tensor and applies the learned denoising step once per timestep, from T down to 1. At each step, the network predicts the noise, the algorithm computes the mean of the less noisy distribution, and it adds a fresh, smaller amount of Gaussian noise before moving on.

Because every step requires one full network evaluation, generating a single image with the original settings takes about 1,000 forward passes. This is the central practical cost of DDPM and the reason that faster samplers, such as DDIM, were developed soon afterward. DDIM reuses a model trained with the DDPM objective but takes deterministic, larger steps, often reaching good quality in 25 to 100 steps.

The following table compares DDPM sampling with common faster alternatives.

SamplerTypical stepsRandomness per stepMain trade-off
DDPM ancestralAbout 1,000StochasticHigh quality, very slow
DDIM25 to 100Deterministic or tunableFaster, slight diversity loss
ODE solvers such as DPM-Solver10 to 25DeterministicFast, needs careful tuning
Distilled or consistency models1 to 4VariesFastest, extra training required
DDPM sampling compared with faster samplers

DDPM compared with other generative models

DDPM differs from earlier generative approaches mainly in its training stability and mode coverage. A GAN trains a generator against a discriminator, which can produce sharp images quickly but suffers from unstable training and mode collapse. A variational autoencoder trains stably but tends to produce blurrier samples. DDPM combines a stable regression-style loss with high sample quality, at the cost of many network evaluations per sample.

Model familyTraining signalSampling speedTypical weakness
DDPMNoise prediction MSESlow, many stepsCompute cost at inference
GANAdversarial gameFast, one passMode collapse, instability
Variational autoencoderEvidence lower boundFast, one passBlurry outputs
Normalizing flowExact likelihoodFast to moderateRestricted architectures
Score-based modelScore matchingSlow, many stepsSimilar cost to DDPM
How DDPM compares with related generative models

DDPM and score-based generative models are closely related: predicting the added noise is equivalent, up to scaling, to estimating the score function, the gradient of the log density. Later work unified both views as discretizations of a stochastic differential equation.

Improvements built on the DDPM formulation

Most production diffusion systems keep the DDPM training objective but change the schedule, the parameterization or the space in which diffusion happens. The cosine noise schedule, introduced in improved DDPM work, destroys information more gradually than the linear schedule and improves quality at lower resolutions. Learned reverse variances allow good samples with fewer steps.

Further extensions moved diffusion into a compressed representation. A latent diffusion model runs the DDPM process in the latent space of an autoencoder, cutting compute dramatically, and this is the approach behind Stable Diffusion. Classifier-free guidance adds conditioning on text or labels, trading diversity for prompt adherence.

  • Cosine schedule: smoother noise growth and better use of late timesteps.
  • v-prediction: predicts a blend of noise and signal for more stable training at high noise levels.
  • Latent diffusion: diffusion in a compressed latent space for higher resolutions.
  • Diffusion transformer: replaces the U-Net with a transformer backbone that scales well.

Limitations and common misconceptions

The most cited limitation of DDPM is inference cost, because sample quality depends on many sequential network evaluations that cannot be fully parallelized. Training is also compute-intensive, since the model must learn to denoise across all noise levels.

MisconceptionReality
DDPM requires 1,000 steps foreverTrained models can use faster samplers
The network predicts the clean imageThe original design predicts the added noise
DDPM is a specific productIt is a modeling framework and training method
Noise is removed all at onceNoise is removed gradually across steps
DDPM works only for imagesIt also applies to audio, video and 3D data
Common misconceptions about DDPM

Another subtle issue is the mismatch between training and sampling: the model is trained on noisy samples derived from real data but must denoise its own imperfect predictions during generation, so small errors can accumulate across steps.

In simple terms

Imagine taking a clear photograph and sprinkling a little static on it, again and again, until it is nothing but gray snow. A DDPM is trained to undo one small sprinkle of static at a time.

Once it has learned that skill on many images, it can start from fresh random snow and clean it up step by step. Because the snow was random, the cleaned-up result is a brand-new image that looks like it belongs to the training collection. The catch is that the cleanup takes many small steps, which makes it slower than some other methods.

A practical example

A research group at a medical imaging lab needs extra synthetic chest X-ray images to balance a rare-condition class when training a diagnostic classifier. Using real patient images would require additional approvals, so the team trains a DDPM on an existing, approved dataset of about 20,000 de-identified scans at 256 by 256 pixels.

Training uses the standard noise-prediction loss with 1,000 timesteps and a cosine schedule on a small GPU cluster for several days. Ancestral sampling at 1,000 steps produces convincing images, but takes too long for thousands of samples, so the team switches to a DDIM sampler with 50 steps, which cuts generation time by about twenty times with little visible quality loss.

Radiologists review a random subset to remove implausible images before use. Adding the filtered synthetic samples improves the classifier’s recall on the rare class in internal validation, while the team keeps a held-out set of real images only for final evaluation.