TL;DR
Song and colleagues show that the two main ways of generating images by adding and removing noise, score matching with Langevin dynamics and denoising diffusion, are discrete versions of one idea: a continuous stochastic differential equation (SDE) that slowly turns data into noise. Generation runs that SDE in reverse, using a neural network that estimates the score, meaning the gradient of the log density at each noise level. The same framework gives new samplers, exact likelihoods, and conditional generation, and it reached record CIFAR-10 sample quality and likelihood for its time.
Where you'll see it: the theory behind modern image, audio and video diffusion models. Its SDE and probability-flow ODE views are the standard way later work describes diffusion models.
The problem
By 2020 there were two strong families of generative models built on noise. Score matching with Langevin dynamics (SMLD) trained a score network at a few fixed noise levels and sampled by running Langevin steps at each level, from the most noisy to the least. Denoising diffusion probabilistic models (DDPM) trained a Markov chain that adds a little Gaussian noise per step and learned to reverse each step.
Both worked, but they were separate methods. Each used a fixed, finite list of noise levels, and each had its own sampler. Changing one part, such as the noise schedule or the sampler, meant rederiving the method from scratch. DDPM also had recently pulled ahead on sample quality, and the paper's authors wanted to know whether the score-based side could catch up with better architectures and better samplers, rather than by adding more noise levels.
Key idea
Replace the finite list of noise levels with a continuum. Define one forward SDE that gradually diffuses a data point into noise, with no trainable parameters:
Anderson's 1982 result says the time-reversed process is also a diffusion, and it depends on the forward SDE and on the score of the marginal density at each time. So if a network learns the score for every , the reverse SDE can turn noise back into data. The SMLD and DDPM noise schedules turn out to be two particular discretisations of two particular SDEs, and the framework lets you design others.
flowchart LR D[data x0] -->|forward SDE, no parameters| N[noise x_T] N -->|reverse SDE with learned score| S[sample x0] SC[score network s_theta of x and t] -.->|estimates the score| S SC -.->|trained by denoising score matching| D
The method
The forward SDE
The paper works with an Itô SDE
where is a standard Wiener process (Brownian motion; see Stochastic Differential Equation), is the drift, and is a scalar diffusion coefficient. Time runs over . The data sit at , and the process should end at a simple prior, such as a Gaussian with fixed mean and variance, at .
Three SDEs cover the main cases:
- VE (variance exploding). . The variance grows without bound as grows. This is the SMLD limit.
- VP (variance preserving). . Starting from unit variance, the variance stays at one. This is the DDPM limit.
- sub-VP. The same drift as VP, with a diffusion term . Its variance is always below the VP variance at each time. The paper found it does well on likelihoods.
Reversing the SDE
The reverse-time SDE, run from back to , is
where is a Wiener process running backward in time. The only unknown term is the score of the marginal density . The forward SDE, the prior and the score are enough to sample.
Training the score
The score network is trained with a continuous version of denoising score matching (see Score Matching):
Here is sampled uniformly on , is a positive weight, and is the transition kernel of the forward SDE. For affine drifts (VE, VP, sub-VP), is Gaussian with a closed-form mean and variance, so each training pair is cheap to create. This is why the paper's VE, VP and sub-VP SDEs train efficiently.
Take the VP SDE with constant , a data point , and time .
- Integrate the rate: .
- Mean of the kernel: .
- Variance of the kernel: .
- Sample from this Gaussian.
- The score of the kernel at that point is .
- The network is trained to output at input and time .
Interpretation: the regression target is the score of a known Gaussian, so it needs no sampling of the full data distribution. That is the reason the closed-form kernel matters.
Solving the reverse SDE
Any general-purpose SDE solver can integrate the reverse SDE. The paper gives three options.
- Reverse diffusion sampler. Discretise the reverse SDE in the same way as the forward SDE. It is simple to derive for a new SDE, and the paper reports it does slightly better than DDPM's ancestral sampling.
- Predictor-corrector (PC) sampler. Take a step with a numerical SDE solver (the predictor), then take one or more steps of score-based Langevin MCMC at the same time (the corrector). This corrects the sample toward the marginal at that time.
- Probability flow ODE. Every diffusion has a deterministic process with the same marginals at every time:
Because it is an ODE, a black-box adaptive solver can integrate it, and the number of score evaluations can be traded against accuracy. The paper reports that a looser error tolerance cut the number of evaluations by over 90 percent without visibly hurting samples.
The paper's Table 1 labels a run "PC1000" for 1000 predictor steps and 1000 corrector steps.
- Each predictor step needs one score evaluation, so 1000 evaluations.
- Each corrector step needs one more score evaluation, so another 1000.
- Total: score-network calls for one sample.
Interpretation: when the table compares samplers at equal computation, it means equal score evaluations, and a corrector step costs as much as a predictor step.
Exact likelihoods and latent codes
The probability flow ODE is a neural ODE (see Neural Ordinary Differential Equation). The instantaneous change-of-variables formula then gives the exact log-likelihood of any input, under the dequantised data model used in the paper. Because the forward SDE has no trainable parameters, the map from data to latent code is determined by the data distribution, and the paper uses that to interpolate between images and to edit latents.
Controllable generation
The reverse SDE for a conditional distribution adds one term, , to the unconditional score. The unconditional model is not retrained. The paper uses this for class-conditional sampling, inpainting and colourisation. The extra term has to be estimated, for example with a time-dependent classifier, which the paper trains on noisy versions of labelled data.
Results
The main numbers are on CIFAR-10 (32 by 32 pixels, unconditional generation) and on likelihood. Lower FID and higher Inception score (IS) are better. The numbers below are the paper's own, quoted from its text. The FIDs are the lowest value over the course of training, following the convention of earlier work, so they are best-checkpoint numbers. The paper's Table 2 (likelihood and ODE-sampled FID) instead uses the last checkpoint, so the two kinds of figure are not directly comparable. All FIDs use 50,000 samples and a 1000-step sampler with reverse diffusion as the predictor. VE models add one Langevin corrector step per predictor step. VP models skip the corrector, because it "only gives slightly better results but requires double computation".
| Model | Setting | Result |
|---|---|---|
| NCSN++ (VE) | Basic architecture | FID 2.45 |
| DDPM++ (VP) | Basic architecture | FID 2.78 |
| DDPM++ cont. (VP) | Continuous objective | FID 2.55 |
| DDPM++ cont. (sub-VP) | Continuous objective | FID 2.61 |
| NCSN++ cont. (deep, VE) | Best sample quality | IS 9.89, FID 2.20 |
| DDPM++ cont. (deep, sub-VP) | Best likelihood | 2.99 bits/dim |
The results support three claims.
- The score-based side caught up. With better architectures and the new samplers, SMLD-style VE models matched or beat the DDPM results that had recently led on sample quality. The deep VE model set new records for IS and FID on unconditional CIFAR-10. The paper also notes it beat the previous best conditional model on FID while using no labels.
- Architecture and objective matter. Switching from the discrete training objective to the continuous one, and increasing depth, improved FID for all three SDEs. The continuous objective improved the VP model from 2.78 to 2.55.
- Likelihood. The sub-VP model reached 2.99 bits per dimension on uniformly dequantised CIFAR-10, which the paper reports as the best known value for that evaluation at the time. It also notes that VE SDEs typically give better sample quality but worse likelihoods than VP and sub-VP SDEs, and that sub-VP always beat VP on likelihood, so the best SDE depends on the goal.
The paper also reports the first high-fidelity 1024 by 1024 samples from a score-based model, on CelebA-HQ.
Two caveats matter. Sampling is slow: the paper concedes that these samplers remain slower than GANs on the same datasets. And the breadth of samplers brings many hyperparameters, such as the corrector's signal-to-noise ratio, which the conclusion flags as needing better automatic tuning.
Why it mattered
The paper turned a set of separate methods into a single mathematical object. After it, diffusion models could be designed by choosing an SDE and a sampler, rather than by inventing a new noise schedule. The reverse-SDE view, the probability flow ODE and the conditional-sampling recipe became standard tools in later work on image, audio and video generation.
The probability flow ODE mattered for practice as well as theory. It made diffusion models into invertible maps with exact likelihoods, and it opened a route to fast deterministic samplers that later work built on, including ODE-based samplers with far fewer steps than the original 1000.
Reading guide
Read the paper in this order, and use the listed lessons for the prerequisites each section needs:
- Section 1, Introduction. Needs Diffusion Model for the idea of learning to reverse a noising process, and Denoising Diffusion Probabilistic Models (DDPM) for the discrete version the paper generalises.
- Section 2, Background. Needs Gaussian (Normal) Distribution for the perturbation kernels, Score Matching for the score objective, Langevin Dynamics for the SMLD sampler, and Markov Chain for the DDPM chain.
- Section 3.1 and 3.2, the forward and reverse SDEs. Needs Stochastic Differential Equation for the Itô SDE and the Wiener process, and Langevin Dynamics for the score-based MCMC idea.
- Section 3.3, score estimation. Needs Score Matching again for the continuous objective.
- Section 3.4, the VE, VP and sub-VP examples. Needs Gaussian (Normal) Distribution for the closed-form kernels.
- Section 4, solvers and probability flow. Needs Monte Carlo Method for the MCMC corrector and Neural Ordinary Differential Equation for the probability flow ODE and the likelihood calculation.
- Section 4.4 and Appendix H, architectures. Needs U-Net for the encoder-decoder backbone the architectures build on.
- Section 5, controllable generation. Uses the reverse SDE from Section 3.2 and the score from Section 3.3, so read those first.
Check yourself
QuestionRecall: what is the difference between the VE and VP SDEs in terms of variance?Show answer
The VE SDE has a variance that grows without bound as time increases, which corresponds to the SMLD noise schedule. The VP SDE keeps the variance at one when it starts from unit variance, which corresponds to the DDPM noise schedule. The paper names them by this property.
QuestionComputation: with the VP SDE and constant , what is the variance of the transition kernel at , and what does the score target look like for a point ?Show answer
The integral of from 0 to 2 is 2, so the kernel variance is . The score target at a point is , where scales the data point. The target is negative when lies above the kernel mean, pointing back toward it.
QuestionWhy: why does the paper call the probability flow ODE useful even though the SDE already samples from the model?Show answer
The ODE has the same marginal distributions at every time as the SDE, but it is deterministic. A deterministic process can be integrated with a black-box adaptive ODE solver, so the step count can be traded against accuracy. It also gives an invertible map from data to a latent code, which makes exact likelihood computation and latent interpolation possible. The SDE sampler does not offer these.
QuestionApplied: you have a trained score model and want to generate images of one class from an unconditional model, without retraining. What term do you add to the reverse SDE, and what do you need?Show answer
Add to the unconditional score inside the reverse drift, where is the class label. You need a time-dependent estimate of , which the paper gets from a classifier trained on noisy versions of labelled data. The score model itself is left as it is. The cost is that the classifier must work at every noise level, not just on clean images.
Sources
- Song et al. (2020), Score-Based Generative Modeling through Stochastic Differential Equations: arxiv.org/abs/2011.13456
- Ho et al. (2020), Denoising Diffusion Probabilistic Models: arxiv.org/abs/2006.11239
- Anderson (1982), Reverse-time diffusion equation models, Stochastic Processes and their Applications.