The publication AI reads — a remote MCP server, nothing to install.Connect your agent →
Architectures·Updated

What are diffusion models?

They power most modern image generators, by learning to undo noise one step at a time

What is a diffusion model?

A diffusion model is a generative model that learns to turn random noise into data, such as an image. It does this by reversing a gradual noising process. The Denoising Diffusion Probabilistic Models paper (Ho et al., 2020) frames this as a parameterised Markov chain. That chain is a sequence of small steps, trained with variational inference, to produce samples that match the training data.

Training works backwards from a simple idea. Take a real image and progressively add Gaussian noise to it over many steps, until nothing recognisable remains. A neural network then learns to reverse each of those steps, recovering a little structure at a time. Sampling runs that learned reverse chain starting from pure noise.

How does the denoising process work?

Ho et al. (2020) define a forward process that adds Gaussian noise to an image according to a fixed variance schedule, with no learnable parameters. A useful property of this schedule is that it allows sampling the noisy version of an image at any timestep directly. There is no need to simulate every intermediate step.

The reverse process is a Markov chain of learned Gaussian transitions that starts from pure noise and works back toward data. Rather than predicting the mean of each denoising step directly, Ho et al. found it simpler and more effective to train a network to predict the noise added at each step, then subtract an estimate of it. This reframes training as a straightforward noise-prediction task. The paper optimises it with a simplified objective it calls L-simple.

What are score-based models?

A score-based model estimates the gradient of the log probability of the data, called the score, at various noise levels. It uses that gradient to guide samples toward high-probability regions. Song and Ermon's earlier score matching with Langevin dynamics work and Ho et al.'s DDPM turn out to be two versions of the same idea. Both implicitly learn scores at different noise scales.

The paper Score-Based Generative Modeling through Stochastic Differential Equations (Song, Sohl-Dickstein, Kingma, Kumar, Ermon and Poole, 2021) unifies them. It describes noising as a continuous-time stochastic differential equation, or SDE, rather than discrete steps. A matching reverse-time SDE depends only on the score, and reversing it, using a neural network trained to estimate that score, generates samples.

The authors also derive an equivalent ordinary differential equation. It gives the same results while allowing exact likelihood computation and faster sampling. With improved architectures and a predictor-corrector sampler, they reported an Inception score of 9.89 and an FID of 2.20 on CIFAR-10. They also produced the first high-fidelity 1024x1024 images from a score-based model.

What is latent diffusion?

Latent diffusion runs the noising and denoising process in a compressed representation of an image rather than on raw pixels. The High-Resolution Image Synthesis with Latent Diffusion Models paper (Rombach, Blattmann, Lorenz, Esser and Ommer, 2021) first trains an autoencoder to compress images into a smaller latent space that still reconstructs them faithfully. It then trains the diffusion model entirely inside that space.

This matters because pixel-space diffusion is expensive. The authors note that training some of the most powerful pixel-based models took 150 to 1,000 V100 GPU-days. Generating 50,000 samples could take about five days on a single A100. By denoising a much smaller latent grid instead, their latent diffusion models, or LDMs, cut both training and sampling cost sharply, while reaching a new state-of-the-art FID of 5.11 on CelebA-HQ.

The same paper adds cross-attention layers so the UNet backbone can be conditioned on text, semantic layouts or other inputs. This is the mechanism behind text-to-image synthesis.

Why does sampling take so many steps?

Ho et al. (2020) used 1,000 timesteps for all their experiments, matching the number of network evaluations used in earlier score-based work. This way each step only has to remove a small amount of noise. Because each step depends on the output of the last, standard sampling runs the network sequentially that many times. The latent diffusion paper flags this as a key source of expensive inference.

Several of the papers address this directly. Song et al. (2021) show that reverse diffusion and predictor-corrector samplers beat the original ancestral sampling at matched compute. Their probability flow ODE lets a black-box solver cut the number of function evaluations by over 90%, without visibly harming quality. The latent diffusion paper instead reports results using the DDIM sampler at far fewer steps, from 10 up to 250, trading some sample quality for speed.

Where are diffusion models used today?

Across the three papers, diffusion models have been shown to generate images on datasets including CIFAR-10, CelebA-HQ, LSUN churches and bedrooms, FFHQ and ImageNet. Rombach et al. (2021) extended the approach to text-to-image synthesis, trained on the LAION-400M dataset. The same latent diffusion architecture also handled class-conditional generation, layout-to-image synthesis, super-resolution and inpainting.

Song et al. (2021) demonstrated that a single unconditional score-based model can be adapted, without retraining, to class-conditional generation, image inpainting and colorisation. This works by conditioning the reverse-time SDE on extra information. This flexibility, across resolutions and tasks, is a large part of why diffusion models became the dominant approach behind recent image generators.

Key terms

Diffusion model
A generative model that learns to produce data by reversing a gradual process of adding noise.
Forward process
The fixed procedure that gradually adds Gaussian noise to data over many steps until it becomes pure noise.
Reverse process
The learned Markov chain that removes noise step by step, turning pure noise back into data.
Score
The gradient of the log probability density of the data with respect to the input, used to guide samples toward likely regions.
Score-based generative model
A model trained to estimate the score at different noise levels and use it to generate samples, a category that includes both DDPM and SMLD.
Latent diffusion model (LDM)
A diffusion model that runs the noising and denoising process in a compressed latent space produced by a pretrained autoencoder rather than on raw pixels.
DDIM sampler
A sampling method used in the latent diffusion paper that generates images with fewer steps than standard ancestral sampling.
Cross-attention conditioning
A mechanism added to the diffusion model's UNet backbone that lets generation be guided by inputs such as text or semantic layouts.

Written from the documents above by The Neural Net’s automated desk (claude-sonnet-5, theneuralnet/guides@1) without human review, and updated as news on this topic publishes. How this works.