Deep architectures
Diffusion and Score-Based Generative Architectures
Explain forward noising, reverse denoising, score prediction, conditioning, sampler design, and the quality–latency trade-offs of diffusion models.
By the end you can
- Describe the forward diffusion process and the learned reverse process
- Connect noise prediction, score estimation, and denoising objectives conceptually
- Explain why the neural backbone receives timestep information
- Assess sampler steps, guidance, coverage, and compute as separate design choices
Visual
From data to noise and back again
Training corrupts real data at known noise levels; generation begins from noise and follows a learned reverse trajectory.
The construction is older than the models that made it famous. It was set out at ICML in 2015 by Sohl-Dickstein and three colleagues. Their abstract states it in two sentences: “The essential idea, inspired by non-equilibrium statistical physics, is to systematically and slowly destroy structure in a data distribution through an iterative forward diffusion process. We then learn a reverse diffusion process that restores structure in data, yielding a highly flexible and tractable generative model of the data.”
Every step in the timeline below is one half of that sentence. Destruction is systematic, slow and prescribed. Restoration is the only part that is learned. Five years separate the 2015 paper from the CIFAR-10 numbers in the next section.
Clean sample x₀
A training observation anchors the forward process.
Partially corrupted xₜ
Known noise is added according to a schedule.
Near-noise x_T
The terminal distribution is designed to be simple.
Learned reverse transitions
A neural network predicts information needed to remove noise.
Generated sample
Repeated updates produce a point in data space.
Case
Denoising diffusion reported an FID of 3.17 on unconditional CIFAR-10
The numbers arrived in June 2020, in the paper called Denoising Diffusion Probabilistic Models. On the unconditional CIFAR10 dataset it reports an Inception score of 9.46 and what was then “a state-of-the-art FID score of 3.17”. On 256x256 LSUN it reports “sample quality similar to ProgressiveGAN”. The forward corruption is still prescribed. Only the reverse step is learned.
Hold 3.17 in mind. It is the reference point for the one-step, ten-step and twenty-step results later in this lesson.
Figure
The network learns across many noise levels
Training samples a data point, a timestep, and noise; the model receives the corrupted point and timestep, then predicts noise, a denoised target, velocity, or another equivalent parameterization.
Timestep conditioning is essential because the appropriate denoising operation changes with corruption level. Early reverse steps organize global structure, while later steps often refine detail.
What the network predicts is not a cosmetic choice, and there is a measured case for saying so. In 2021 Nichol and Dhariwal widened the prediction target. The reverse-process variances were learned instead of fixed. They report: “Additionally, we find that learning variances of the reverse diffusion process allows sampling with an order of magnitude fewer forward passes with a negligible difference in sample quality, which is important for the practical deployment of these models.”
An order of magnitude in forward passes, bought by changing what the same network is asked to output.
One denoiser is trained to solve a family of noise-conditioned estimation problems.
Comparison
Prediction targets change optimization and sampling behavior
Several common targets describe related reverse-process information but are not numerically identical.
The fourth of them, score prediction, is not a theoretical aside. It was a working generative method before DDPM existed. In 2019 Song and Ermon trained a single network across many noise levels and report: “Our models produce samples comparable to GANs on MNIST, CelebA and CIFAR-10 datasets, achieving a new state-of-the-art inception score of 8.87 on CIFAR-10.”
That 8.87 is the same benchmark and the same metric as the 9.46 reported in June 2020. Score matching is the fourth card below. It had a published Inception score attached to it a year before the noise-prediction result the field remembers.
Noise prediction
Estimate the random noise used to corrupt the sample.
- Simple training construction
- Common stable baseline
- Weighting varies by timestep
- Conversion needed for clean estimate
Clean-sample prediction
Estimate the underlying uncorrupted observation.
- Direct denoised interpretation
- Can emphasize low-noise detail
- Scaling differs across timesteps
- Needs clipping or parameter care
Velocity prediction
Predict a combination of clean signal and noise.
- Balances signal regimes
- Useful in modern systems
- Requires consistent sampler equations
- Not a separate generative principle
Score prediction
Estimate the gradient of log density at each noise level.
- Connects to score matching
- Supports stochastic differential views
- Scale conventions matter
- Needs careful numerical integration
Example
The reverse model can use several neural backbones
The diffusion principle does not require one specific network family. The substitution has been run as an experiment rather than argued. In 2022 Peebles and Xie described theirs in one line: “We train latent diffusion models of images, replacing the commonly-used U-Net backbone with a transformer that operates on latent patches.”
Removing the U-Net did not cost sample quality. They report a state-of-the-art FID of 2.27 on class-conditional ImageNet 256x256 — the same resolution where classifier-guided diffusion had reported 4.59. The corruption process and the reverse-estimation objective were unchanged. Only the architecture holding them moved.
- U-Net denoiser: multiscale encoder–decoder stages combine broad structure with high-resolution skip features.
- Transformer denoiser: tokenized latents or patches exchange global information through attention — the Peebles and Xie swap, reaching FID 2.27 on class-conditional ImageNet 256x256.
- Graph denoiser: node and edge states evolve while respecting relational structure.
- Audio denoiser: one-dimensional convolutions or sequence blocks process time–frequency or waveform representations.
- Conditional denoiser: cross-attention, adaptive normalization, or concatenation injects labels, text, or measurements.
Steps
Choose a diffusion sampler with matched evidence
Sampler comparisons should hold the trained model and conditioning setup constant wherever possible. Two published results did exactly that, and they are why the ladder below is worth walking.
DDIM changed the sampler and nothing else. Its 2020 abstract says so: “To accelerate sampling, we present denoising diffusion implicit models (DDIMs), a more efficient class of iterative implicit probabilistic models with the same training procedure as DDPMs.” Training untouched, it reports samples of comparable quality 10x to 50x faster in wall-clock time than DDPM. That is the swing available from step 1 alone.
Step 2 is measuring diminishing returns instead of assuming more steps help, and it has published coordinates. DPM-Solver, a fast ODE solver for diffusion sampling, was published in 2022 and measured: “Experimental results show that DPM-Solver can generate high-quality samples in only 10 to 20 function evaluations on various datasets. We achieve 4.70 FID in 10 function evaluations and 2.87 FID in 20 function evaluations on the CIFAR10 dataset”. Doubling the function evaluations moved CIFAR-10 FID from 4.70 to 2.87. The model was not trained further. Those are two points on the curve your own sweep is trying to find.
1. Set a quality target
Define fidelity, diversity, condition accuracy, and unacceptable artifacts.
2. Sweep step counts
Measure diminishing returns rather than assuming more steps always help.
3. Compare stochasticity
Test deterministic and stochastic routes for diversity and reproducibility.
4. Tune guidance separately
Do not confound condition strength with integrator quality.
5. Report end-to-end latency
Include encoder, denoiser steps, decoder, safety checks, and queueing.
Analogy
Restoring a signal through a sequence of calibrated filters
A photograph arrives obscured by known amounts of fog. A specialist trained at many fog densities applies a suitable correction repeatedly, and is told the current visibility level each time.
Fog is removed by a physical law, while diffusion sampling follows a learned probabilistic trajectory. One correction step is still usually insufficient.
The model must know both the corrupted sample and where it sits on the noise schedule.
Key idea
Guidance changes the sampling distribution
Classifier-free guidance strengthens alignment with a condition by combining conditional and unconditional predictions. Larger guidance can improve prompt adherence while reducing diversity or introducing artifacts.
Guidance scale is a product parameter, not a free quality multiplier. Evaluate condition fidelity, sample variety, subgroup behavior, and failure severity across the chosen range.
The trade-off was named before it was made classifier-free. Classifier guidance arrived at NeurIPS in 2021, and Dhariwal and Nichol describe it as “a simple, compute-efficient method for trading off diversity for fidelity using gradients from a classifier”. With it they report an FID of 2.97 on ImageNet 128x128. ImageNet 256x256 gives 4.59. ImageNet 512x512 gives 7.72. They say they match BigGAN-deep “even with as few as 25 forward passes per sample, all while maintaining better coverage of the distribution”. Diversity is the currency in both variants.
Which strategy to use was then settled by an evaluation rather than by argument. In 2021 GLIDE ran CLIP guidance against classifier-free guidance on one 3.5-billion-parameter text-conditional diffusion model. Human evaluators preferred classifier-free guidance on both photorealism and caption similarity. The GLIDE abstract opens on the same trade: “Diffusion models have recently been shown to generate high-quality synthetic images, especially when paired with a guidance technique to trade off diversity for fidelity.” One model, two guidance methods, and people chose.
Stronger conditioning can narrow the generated distribution and amplify model bias.
Iterative refinement is both strength and cost
Multiple denoising steps allow correction across scales. They can yield high sample quality. They also create a longer inference path than one-pass generators.
Distillation, improved solvers, consistency objectives, and latent-space operation can reduce steps. Each changes the fidelity, diversity, or training assumptions, and has to be measured on its own.
The consistency-objective case has a paper and two figures. In 2023 Yang Song and three colleagues collapsed the iterative trajectory to a single step, and write of consistency models: “Through extensive experiments, we demonstrate that they outperform existing distillation techniques for diffusion models in one- and few-step sampling, achieving the new state-of-the-art FID of 3.55 on CIFAR-10 and 6.20 on ImageNet 64x64 for one-step generation.”
Set that 3.55 beside the 3.17 in the case section above. The earlier number came from the full iterative trajectory. The later one comes from one step. The gap between them is what a fast sampler asks a product to accept.
A fast sampler is successful only if it preserves the distribution properties the product needs.
Key takeaways
- Diffusion models learn to reverse a prescribed sequence of noise corruption levels. The construction was published at ICML in 2015, five years before the 3.17 CIFAR-10 FID that made it famous.
- Timestep conditioning lets one network solve different denoising problems across the trajectory.
- Noise, clean-sample, velocity and score prediction are related parameterizations with different scaling behavior. Score prediction reached an Inception score of 8.87 on CIFAR-10 for Song and Ermon in 2019. Adding the reverse-process variances to the target bought Nichol and Dhariwal an order of magnitude fewer forward passes.
- The denoiser backbone should match the geometry of images, audio, graphs, sequences, or other data. Peebles and Xie replaced the U-Net with a transformer on latent patches and reported FID 2.27 on class-conditional ImageNet 256x256.
- Guidance can improve conditional adherence while reducing diversity or introducing artifacts. GLIDE's human evaluators preferred classifier-free guidance to CLIP guidance on both photorealism and caption similarity, on one 3.5-billion-parameter model.
- Sampling steps, solver, stochasticity, guidance and end-to-end latency should be evaluated separately. DDIM changed only the sampler for a 10x to 50x wall-clock difference. DPM-Solver moved CIFAR-10 FID from 4.70 at 10 function evaluations to 2.87 at 20.