# Score-Based Generative Modeling through Stochastic Differential Equations

Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, Ben Poole · arXiv · 2020-11-26

- **Problem** SMLD and DDPM each fix a finite noise schedule, and each comes with its own sampling rule.
- **Method** Describes data corruption as a forward SDE and generation as its reverse-time SDE, driven by estimated scores, then adds predictor-corrector and probability flow ODE samplers.
- **Results** Reached 2.20 FID and 9.89 Inception score on unconditional CIFAR-10 with NCSN++ cont. (deep, VE). Reached 2.99 bits/dim with DDPM++ cont. (deep, sub-VP) on uniformly dequantized CIFAR-10.

## Replacing a finite noise ladder with a continuous process

Score matching with Langevin dynamics (SMLD) and denoising diffusion probabilistic modeling (DDPM) both corrupt training data with noise added in stages, and then learn to undo that corruption. SMLD estimates a score at each of a sequence of noise scales and samples those scales in turn with Langevin dynamics, while DDPM trains a chain of probabilistic models that each reverse one corruption step.

The DDPM objective implicitly computes scores at each noise scale, so the two families are grouped as score-based generative models.

The approach replaces the finite set of noise distributions with a continuum indexed by time, so the corruption becomes a single diffusion process. The forward process is written as \\\[ dx = f(x,t)\\,dt + g(t)\\,dw \\\] Here w is a standard Wiener process, f is the drift and g is a scalar diffusion coefficient that does not depend on x. The SDE has a unique strong solution when its coefficients are globally Lipschitz in state and time.

Generation needs the process run backwards, from prior noise to data. Anderson's result implies that reversing such a diffusion gives another diffusion, run backwards in time. Its drift is the forward drift minus the squared diffusion coefficient times the score of the marginal density, so once the score is known at every time the reverse process can be simulated.

## Forward SDEs that recover SMLD and DDPM

The SMLD perturbation chain adds Gaussian noise whose variance is the difference of successive squared noise scales. As the number of scales goes to infinity, it becomes a process with a time-dependent variance, \\\[ dx = \\sqrt{\\frac{d\[\\sigma^2(t)\]}{dt}}\\,dw \\\] Treating SMLD and DDPM as discretizations of two different SDEs is what lets one framework cover both.

The DDPM chain scales the previous state by the square root of one minus the step size and adds noise of variance equal to the step size. Its continuous limit is \\\[ dx = -\\tfrac{1}{2}\\beta(t)x\\,dt + \\sqrt{\\beta(t)}\\,dw \\\]

Its variance is bounded above by the VP variance at every intermediate time when both start from the same distribution. The authors designed it for better likelihoods.

VE, VP and sub-VP SDEs all have affine drifts, so their perturbation kernels are Gaussian with closed-form mean and variance. This keeps training with the continuous objective efficient.

## Training the score model and running the reverse-time SDE

The score model s\_θ(x,t) is fitted with a continuous generalization of the discrete denoising objectives, \\\[ \\theta^\* = \\arg\\min\_\\theta \\mathbb{E}\_t\\Big\[\\lambda(t)\\,\\mathbb{E}\_{x(0)}\\mathbb{E}\_{x(t)\\mid x(0)}\\big\\\|s\_\\theta(x(t),t) - \\nabla\_{x(t)}\\log p\_{0t}(x(t)\\mid x(0))\\big\\\|\_2^2\\Big\]\\\] Here t is sampled uniformly over the time interval, λ(t) is a positive weight, and x(0) is drawn from the data distribution.

The weight is typically set in inverse proportion to the expected squared norm of the kernel score.

Sliced score matching or finite-difference score matching can replace denoising score matching in this objective. When the transition kernel has no closed form, the SDE can be simulated to draw samples from it, and sliced score matching then avoids computing the kernel's score.

To sample, the learned score replaces the true score in the reverse-time SDE, and a numerical solver integrates it from prior noise. General-purpose choices include Euler-Maruyama and stochastic Runge-Kutta discretizations.

DDPM's ancestral sampling is one particular discretization of the reverse VP SDE, and deriving the equivalent rule for a new SDE can be non-trivial.

## Predictor-corrector samplers

Because the learned score approximates the gradient of the log density at each time, score-based MCMC can target the marginal at that time directly. Langevin MCMC or HMC can serve as this corrector, while a numerical SDE solver serves as the predictor. The name follows predictor-corrector methods for solving systems of equations.

At each time step, the predictor advances the sample to the next time. The corrector then runs score-based MCMC on the predicted sample so that its marginal moves closer to the target at that time.

The original methods are special cases. SMLD's annealed Langevin dynamics uses an identity predictor with a Langevin corrector, and DDPM's ancestral sampling uses itself as predictor with an identity corrector. The authors also test these samplers on SMLD and DDPM models trained with their original discrete objectives, which shows that the samplers work with a fixed number of noise scales.

## Reverse-time solver comparison on CIFAR-10

The comparison covers the VE SDE (SMLD) and VP SDE (DDPM) models on CIFAR-10. Predictor-only samplers use 1000 or 2000 steps, the corrector-only sampler uses 2000 steps, and PC samplers use 1000 predictor and 1000 corrector steps. Columns with the same number of score function evaluations are shaded, and each entry is the mean and standard deviation over five sampling runs, with FID as the metric.

With the continuous objective and the VE SDE on 256 by 256 LSUN images, PC samplers beat predictor-only samplers at comparable computation when a suitable number of corrector steps is used. This LSUN comparison is qualitative and is shown as a figure in Appendix G, whereas the CIFAR-10 comparison reports FID.

## Probability flow ODE and exact likelihoods

For every diffusion process there is a deterministic process with the same marginal densities as the SDE. It satisfies \\\[ dx = \[f(x,t) - \\tfrac{1}{2}g(t)^2 \\nabla\_x \\log p\_t(x)\]\\,dt \\\] Once the scores are known, this probability flow ODE follows from the SDE. When the score is a neural network, the ODE is an example of a neural ODE.

Because the ODE is a neural ODE, the instantaneous change of variables formula gives the exact likelihood of any input. Encoding integrates the ODE forward to a latent at time T, and decoding integrates the corresponding ODE backwards. Latents can then be manipulated for interpolation and temperature scaling.

The authors argue that the encoding is uniquely identifiable when there is sufficient training data, model capacity and optimization accuracy. That uniqueness rests on the forward SDE having no trainable parameters, so its associated probability flow ODE is fixed by the data distribution.

A black-box ODE solver integrates the probability flow ODE with an explicit error tolerance, so accuracy can be traded for efficiency. A fixed discretization also yields competitive samples, especially when combined with correctors.

The figure shows the adaptive step behaviour across numerical precision levels, the NFE reduction, and interpolation between latents.

## Likelihoods on uniformly dequantized CIFAR-10

Likelihoods are reported as negative log-likelihoods in bits/dim on uniformly dequantized CIFAR-10, and the comparison includes only models evaluated the same way. The DDPM (L) and DDPM (Lsimple) entries are ELBO values, marked with an asterisk, and the authors report them on discrete data.

For the same DDPM model of Ho et al., the table lists 3.28 bits/dim from the exact likelihood, below the ELBO entries of 3.70 and 3.75. Training the same architecture with the continuous objective gives DDPM cont. (VP) at 3.21 and DDPM cont. (sub-VP) at 3.05.

With the improved DDPM++ architecture, the continuous objective gives 3.16 for VP and 3.02 for sub-VP. The deeper models give 3.13 for VP and 2.99 for sub-VP. Across these pairs the sub-VP SDE gives higher likelihoods than the VP SDE.

DDPM++ cont. (deep, sub-VP) reaches 2.99 bits/dim, which the authors describe as the highest likelihood reported for uniformly dequantized CIFAR-10 to their knowledge. This value comes from the continuous objective and not from maximum likelihood training.

## Sample quality and architecture changes

The VE-oriented architecture NCSN++ reaches FID 2.45 on CIFAR-10 with PC samplers, and the VP-oriented architecture DDPM++ reaches 2.78. Switching to the continuous objective and increasing network depth improves sample quality for all models.

Table 3 uses the checkpoint with the smallest FID during training, with PC samplers. Table 2 uses the last training checkpoint, with black-box ODE solvers. The FID values in the two tables therefore come from different checkpoint rules and sampler settings.

NCSN++ cont. (deep, VE) reaches FID 2.20 and Inception score 9.89 on unconditional CIFAR-10. The authors report new records for both Inception score and FID on unconditional generation, and say that the FID beats the conditional StyleGAN2-ADA row at 2.42 without using labels.

The authors note that VE typically gives better sample quality than the VP and sub-VP SDEs, but its likelihoods are worse than those of the VP and sub-VP counterparts. The authors suggest that practitioners will likely need to try different SDEs for different domains and architectures.

The authors report the first set of high-fidelity samples from a score-based model at 1024 by 1024 on CelebA-HQ, which the appendix describes.

## Conditioning on observations with the reverse SDE

The conditional reverse-time SDE adds a term to the reverse drift, \\\[ dx = \[f(x,t) - g(t)^2(\\nabla\_x \\log p\_t(x) + \\nabla\_x \\log p\_t(y\\mid x))\]\\,dt + g(t)\\,d\\bar{w} \\\] The extra gradient is that of the forward process likelihood of the observation y. It can come from a separately trained model or from heuristics, and the authors give a method that avoids auxiliary models.

For class-conditional generation, a time-dependent classifier p\_t(y \| x(t)) is trained on pairs made by sampling clean data and then noisy versions from the forward kernel. The classifier is trained with a mixture of cross-entropy losses over time steps. The figure shows class-conditional CIFAR-10 samples at 32 by 32 for automobiles and horses.

Imputation samples from the posterior of the complete data given the observed dimensions, using an unconditional model. Colorization is treated as a coupled version of imputation. The coupled dimensions are decoupled with an orthogonal linear transform, and imputation is run in the transformed space. The right half of the figure shows inpainting and colorization at 256 by 256 on LSUN with unconditional time-dependent models.

In the main text these controllable results appear as sample figures rather than as metric tables.

## Limits on sampling speed and tuning

The proposed sampling approaches remain slower at sampling than GANs on the same datasets. The authors list combining the stable learning of score-based models with the fast sampling of implicit models such as GANs as an open direction.

The breadth of samplers introduces a number of hyper-parameters. Automatic selection and tuning of these hyper-parameters is left to future work.

The FID values in Table 3 and Table 2 follow different checkpoint and sampler rules, so they are not one shared protocol.

Likelihood comparisons are restricted to models evaluated the same way, and the ELBO entries are on discrete data. The controllable generation results are shown as samples in the main text, and the 1024 by 1024 CelebA-HQ samples are described in an appendix.

## Paper info

- **Authors**: Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, Ben Poole
- **Venue**: arXiv · Preprint
- **First published**: 2020-11-26
- **Added**: 2026-10-20
- **Updated**: 2021-2-10
- **Version**: v2
- **arXiv**: 2011.13456
- **Category**: cs.LG · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/2011.13456v2) · [PDF ↗](https://arxiv.org/pdf/2011.13456v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, Ben Poole (2020). Score-Based Generative Modeling through Stochastic Differential Equations. arXiv:2011.13456v2. https://arxiv.org/abs/2011.13456v2

**BibTeX**

```
@misc{song2020score,
  title = {{Score-Based Generative Modeling through Stochastic Differential Equations}},
  author = {Yang Song and Jascha Sohl-Dickstein and Diederik P. Kingma and Abhishek Kumar and Stefano Ermon and Ben Poole},
  year = {2020},
  eprint = {2011.13456},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.13456v2}
}
```

## Other paper commentary

- [Denoising Diffusion Probabilistic Models](https://refivu.com/en/papers/3a1faf88-ed3a-4c3a-bf1e-1afc6e7184fa-denoising-diffusion-probabilistic-models.md)
- [High-Resolution Image Synthesis with Latent Diffusion Models](https://refivu.com/en/papers/33bd1500-c829-47e5-9545-ad078523241e-high-resolution-image-synthesis-with-latent-diffusion-models.md)
- [Generative Adversarial Networks](https://refivu.com/en/papers/b0edf89c-f6c4-4cce-9c25-eccaea8dcfc9-generative-adversarial-networks.md)
- [Auto-Encoding Variational Bayes](https://refivu.com/en/papers/90411040-94ff-4aca-9d04-a1a99cad3eb4-auto-encoding-variational-bayes.md)
- [Absorbing Quantization Error by Deformable Noise Scheduler for Diffusion Models](https://refivu.com/en/papers/10a7b7b0-1927-4b83-a47b-a8a00da5f0c5-absorbing-quantization-error-by-deformable-noise-scheduler.md)
- [Adversarial Vulnerability from Interference Between Features in Superposition](https://refivu.com/en/papers/cd94add6-68c0-4643-bc21-5a8a999fe6db-adversarial-vulnerability-from-interference-between-features.md)
- [Chain-of-Thought Prompting Elicits Reasoning in Large Language Models](https://refivu.com/en/papers/453dc85c-e794-4846-bb89-b8b678635169-chain-of-thought-prompting-elicits-reasoning-in-large.md)
- [Llama 2: Open Foundation and Fine-Tuned Chat Models](https://refivu.com/en/papers/5c1523c3-cd1c-48ba-8289-86de02d688dd-llama-2-open-foundation-and-fine-tuned-chat.md)
- [Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model](https://refivu.com/en/papers/b99bbef4-e405-4227-881f-01ef69bed080-mastering-atari-go-chess-and-shogi-by-planning.md)
- [Mixtral of Experts](https://refivu.com/en/papers/5e1d3fc2-10c6-4121-ba03-4ef4430aadca-mixtral-of-experts.md)
- [PaLM: Scaling Language Modeling with Pathways](https://refivu.com/en/papers/31a94910-97f3-470b-a240-6c8b698de722-palm-scaling-language-modeling-with-pathways.md)
- [Mistral 7B](https://refivu.com/en/papers/9993f1cb-8618-4aeb-9dc5-d4a5aa598381-mistral-7b.md)

## Terms in this paper

- [CIFAR-10](https://refivu.com/en/terms/19035a518d0a-cifar-10)
- [FID](https://refivu.com/en/terms/e110afe65f86-fid)
- [inception score](https://refivu.com/en/terms/25dbfbd4fd96-inception-score)
- [CelebA-HQ](https://refivu.com/en/terms/55be90c6f5a7-celeba-hq)
- [LSUN](https://refivu.com/en/terms/8199283e30fb-lsun)
- [image inpainting](https://refivu.com/en/terms/94f118f6d0c1-image-inpainting)
- [ancestral sampling](https://refivu.com/en/terms/bff41f4f1f7f-ancestral-sampling)
- [class-conditional generation](https://refivu.com/en/terms/2d289bcf028a-class-conditional-generation)
- [colorization](https://refivu.com/en/terms/9d13e24c3993-colorization)
- [probability flow ODE](https://refivu.com/en/terms/5d0910537280-probability-flow-ode)
- [neural ODE](https://refivu.com/en/terms/651dc406d45a-neural-ode)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/11d114a6-a425-47ea-9133-db43e9c355d2-score-based-generative-modeling-through-stochastic)
