TL;DR
Song and Ermon's 2019 paper makes new images without a GAN and without a model that must be normalised. It corrupts training images with Gaussian noise at ten strengths, trains one network to estimate the score (the direction toward more likely data) at every strength using Score Matching, and then samples with annealed Langevin dynamics: start from noise, walk at the strongest noise level, then step down to weaker levels. On CIFAR-10 the unconditional model reached an inception score of 8.87, which the paper reports as a new state of the art for that setting.
Builds on: Score Matching, Langevin Dynamics, Annealed Langevin Dynamics · Leads to: the 2020 SDE follow-up, Diffusion Model
Why it mattered
For most of 2015 to 2019, high-quality image generation meant either a GAN, which trains a generator against a discriminator and can be unstable, or a likelihood model such as a Variational Autoencoder, autoregressive model or Normalizing Flow, which needs a special architecture or a surrogate loss. This paper showed that a plain network with no adversary and no normalisation constraint could produce samples that look comparable to GAN samples on MNIST, CelebA and CIFAR-10.
Its idea of learning a denoising direction at many noise levels fed directly into the diffusion family. Work from 2020 such as Denoising Diffusion Probabilistic Models (DDPM) trained noise predictors in a closely related way, and the 2020 SDE paper of Song and colleagues wrote the noise levels as a continuous process, placing score-based and diffusion models on one footing. Today's image generators built on diffusion models inherit the vocabulary of this paper: a score, a noise schedule, and a sampler that walks down that schedule.
History
Aapo Hyvärinen introduced score matching in 2005, as a way to fit an unnormalised density without computing its normalising constant. Pascal Vincent showed in 2011 that a denoising version connects the score to a denoising autoencoder. Simulated annealing, a search method that slowly lowers a temperature, dates to the 1980s and inspired the annealing schedule.
Before 2019, score-based sampling with Langevin dynamics was known but did not produce good images, for the three reasons in the problem section. Song and Ermon's combination of many noise levels, one conditional network and annealed sampling made it work on real image datasets. The approach caught on because it avoided the instability of adversarial training and was easy to state. The 2020 SDE follow-up placed the family on a continuous-time footing, and diffusion models then took it up widely.
The problem
Before this paper, the natural route to sampling from a density was to learn its score with score matching and then run Langevin dynamics. The authors identified three reasons this fails on images.
- Manifold hypothesis. Natural images occupy a thin, low-dimensional surface inside the huge space of all pixel grids. Off that surface the density is essentially zero, so the score is either undefined or meaningless. Score matching has nothing sensible to fit there.
- Low-density regions. Where the training data is sparse, score matching sees few examples. Its estimate of the score is poor exactly in the places a sampler wanders through when it starts from noise.
- Slow mixing. If the density has two separated peaks, a Langevin walk started on one peak tends to stay there. The relative weights of the peaks come out wrong. The paper's toy experiment uses a mixture of two well-separated Gaussians (a Mixture Model) and shows standard Langevin dynamics getting the weights wrong.
The fix is to add noise on purpose. Noise fills in the empty regions and connects the peaks, and it makes the score defined everywhere in pixel space.
How it works
The pipeline runs in four stages: choose noise levels, train one network on all of them, sample by walking down the levels, and output an image.
flowchart LR A[Clean training images] --> B[Add noise at 10 levels] B --> C[Train one score network] C --> D[Start from uniform noise] D --> E[Langevin walk at the largest noise] E --> F[Langevin walk at each smaller noise] F --> G[Walk at the smallest noise] G --> H[New image]
We follow one tiny case in one dimension, so that every step is a number you can check. The clean data point is .
- Choose the noise levels. The paper uses ten levels from down to , each about 0.6 times the one before. Check: .
- Corrupt the clean point. Pick and a standard normal draw (a number from a random generator). The noisy point is . Check: the noisy point sits below the clean one, as the draw was negative.
- Compute the target direction. The best direction to move from back toward is . Check: the target is positive, so it points up, toward the clean value.
- Train the network to output that direction. Let the network output . The per-point loss is . Check: if the output were exactly 2.0, the loss would be zero.
- Take one sampling step. Start at with step size . Let the network output and draw noise . The update gives . Check: the drift term pushes the point up by 0.02, and the noise term adds a random kick of 0.07. Here the kick is larger than the drift, so single steps look noisy.
- Anneal. Repeat step 5 at each noise level, from largest to smallest, shrinking the step size as the noise shrinks. The paper sets , where is a small constant (the paper uses ) and is the smallest noise level, . Check: at the step is , and at it is .
The figure below shows the score for two noise levels around a data point at zero. The steeper curve belongs to the smaller noise. Near the data, the score pulls harder when the noise is small.
- σ = 1
- σ = 0.5
The math
Let be the true image distribution. Adding Gaussian noise of scale gives the perturbed distribution
The network is trained to match for every in the list.
Step 3 in symbols
The noise kernel is . Its log is plus a constant, so its gradient with respect to is
This is the target in step 3 of the walkthrough.
Step 4 in symbols
The denoising score matching loss for one level is
The levels are combined into one objective with a weight :
The paper chooses . The reason is that the trained network has roughly , so without the weight the small-noise terms would dominate the loss, because the score they must fit is about times larger there. With the weight,
Here is a standard normal vector whose size does not depend on , and neither does . Each level therefore contributes a loss of the same order.
Step 6 in symbols
The annealed Langevin update at level is
with step size , where is the constant step scale and is the smallest noise level. Since the score is about , the drift term scales like , and the noise term also scales like . The ratio of drift to noise is therefore the same at every level, which is why one step-size rule works across the whole schedule.
Worked examples
Clean value , noise level , noisy value .
- Gap between noisy and clean: .
- Divide by : .
- Negate to get the target: .
- Interpretation: the ideal score at is , which points up toward the clean value .
Current point , noise level , step size , network output , noise draw . Check first that , which matches the rule for this schedule.
- Drift term: .
- Noise scale: .
- Noise term: .
- New point: , about .
- Interpretation: the drift moves the point up by toward higher density, and the random kick adds . Here the kick is larger than the drift, which is why many short steps are needed.
CIFAR-10 images are pixels with three colour channels, so one image has numbers, and the score network outputs numbers at each query. The paper samples with levels and steps per level.
- Count the network calls per image: .
- Step size at the largest noise: gives .
- Noise level at index 5: the ratio between levels is , so .
- Step size there: .
- Step size at the smallest noise: .
- Interpretation: the late steps are about ten thousand times smaller than the first, so the final walk makes only fine-grained changes to the image.
Try it: with the same and , what is the step size at ?
Answer: .
Results
The paper evaluates on three datasets: MNIST, CelebA cropped to and resized to , and CIFAR-10. All pixel values are scaled to the range from 0 to 1. The model uses levels with and , and sampling uses and .
| Result | Value | What it means |
|---|---|---|
| CIFAR-10 inception score (unconditional) | 8.87 | Higher is better; the paper reports this as state of the art for an unconditional model |
| CIFAR-10 FID | 25.32 | Lower is better; comparable to strong GAN models such as SNGAN |
| Samples on MNIST, CelebA, CIFAR-10 | Qualitative | Quality described as higher than or comparable to likelihood models and GANs |
| Inpainting on CelebA and CIFAR-10 | Qualitative | The same sampler fills occluded regions, including arbitrary shapes |
The limits are as important as the numbers. The paper does not report scores for MNIST or CelebA, because those numbers are not widely reported and preprocessing differs. The FID and inception numbers depend on the evaluation setup and are not a full measure of sample diversity. The sampler is slow. The authors report that results are robust to the number of steps and to between and ; the noise range from 1 down to 0.01 is their fixed choice. The inpainting results are shown as examples, not measured.
Common mistakes and tradeoffs
It is tempting to think the network outputs an image. In fact it outputs a direction, one number per pixel, that says which way to move. Images come from repeatedly applying that direction with noise.
It is tempting to think a single small amount of noise is enough. In fact the paper's baseline that uses only fails to produce reasonable images, because at that scale the score carries no information about low-density regions and the walk mixes poorly. The large levels are what make the sampler work.
It is tempting to read "annealed" as "lower learning rate during training". In fact annealing happens during sampling: the noise level falls and the step size shrinks, while the network is trained once on all levels.
It is tempting to treat the training loss as a likelihood. In fact it is a score-error measure. The paper notes that with and the levels fixed it can compare two networks, but it is not a probability of the data.
When to use this approach: when you want a generator without adversarial training or a normalised model, and when you can afford many network calls per sample. When not: when sampling must be fast, since the paper's sampler calls the network 1000 times per image. Alternatives include GANs, which need a single network pass, and later diffusion samplers, which reduce the number of steps.
Reading guide
Read the paper in this order, with the lessons that cover what each section needs.
- Section 1, Introduction. Compares likelihood models and GANs. Needs Generative Model and Generative Adversarial Network.
- Section 2, Score-based generative modeling. Defines the score, score matching and Langevin sampling. Needs Score Function, Score Matching and Langevin Dynamics.
- Section 3, Challenges. The manifold hypothesis, low-density regions and slow mixing. Needs Mixture Model and Markov Chain Monte Carlo.
- Section 4, Noise Conditional Score Networks. The core method: noise levels, the weighted loss and annealed sampling. Needs Noise-Conditional Score Network, Annealed Langevin Dynamics and Gradient Descent.
- Section 5, Experiments. Samples, scores and inpainting. Needs Generative Adversarial Network for the comparison baseline.
- Appendix A, Architectures. The network is a RefineNet, which the paper calls a modern variant of U-Net, with dilated convolutions and conditional Instance Normalization. Read it after U-Net and Dilated Convolution.
Check yourself
QuestionWhat does the trained network s_θ(x, σ) estimate?Show answer
It estimates the score of the σ-perturbed data distribution, the gradient of the log of q_σ with respect to x. It is one network for all noise levels, given σ as input, and it outputs a vector the same size as the image.
QuestionA clean value is x = 3.0 with noise level σ = 0.2, and the noisy value is x̃ = 3.1. What is the denoising target −(x̃ − x)/σ²?Show answer
The gap is 3.1 − 3.0 = 0.1. The variance is σ² = 0.04. So the target is −0.1 / 0.04 = −2.5. The negative sign means the point should move down toward the clean value 3.0.
QuestionWhy does annealed sampling start at the largest noise level instead of the smallest?Show answer
At large noise the perturbed density has no isolated modes and its low-density gaps are filled, so the score is well defined and Langevin walks mix quickly. The samples from that level are then good starting points for the next, smaller level. Starting at the smallest level would begin the walk in a poor region with no way out.
QuestionA team trains the network with only σ = 0.01 on 64 by 64 images and gets noisy, incoherent samples. What is the likely cause, and what is the fix?Show answer
One small noise level gives no score information in low-density regions, and the walk mixes poorly, which is the baseline failure in the paper. The fix is to train one conditional network on a geometric range of levels, from a large value such as 1 down to a small value such as 0.01, and then anneal the sampler through those levels from largest to smallest.