NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Variational Perspective on Diffusion-Based Generative Models and Score Matching

Chin-Wei Huang, Jae Hyun Lim, Aaron Courville

Discrete-time diffusion-based generative models and score matching methods have shown incredible promise in modeling high-dimensional image data. Recently, researchers have demonstrated that diffusion processes—which transform data into pure noise—can be reversed by learning the "score function" (the gradient of the log-density of the perturbed data). By plugging this learned score function into an inverse Stochastic Differential Equation (SDE), one can define a powerful generative diffusion process.

Despite the state-of-the-art empirical success of this "plug-in reverse SDE" approach, a rigorous theoretical underpinning has been missing. Specifically, it was unclear why minimizing a score-matching loss should result in a generative model that accurately captures the true data distribution in terms of likelihood. This paper bridges that major theoretical gap by proving that training continuous-time diffusion models via score matching is mathematically equivalent to maximizing a variational lower bound on the model's likelihood.

Bridging the Theoretical Gap

To tackle this problem, the authors build a continuous-time variational framework using advanced stochastic calculus:

  • Feynman-Kac Formula: This theorem is used to express the marginal probability density of the generative SDE as an expectation over random paths.
  • Girsanov Theorem: Because calculating that expectation requires integrating over all possible paths of Brownian motion (which is computationally intractable), the authors use the Girsanov theorem to perform a "change of measure." This effectively treats the Brownian motion as an infinite-dimensional latent variable, enabling variational inference.
  • Continuous-Time ELBO (CT-ELBO): By combining these theorems, the paper derives a tractable Evidence Lower Bound (ELBO) for continuous-time SDEs.
  • Reparameterization: Finally, by reparameterizing the generative and inference SDEs, the authors show that the implicit score-matching loss naturally emerges as the core component of this CT-ELBO.

Key Insights: VAEs, ODEs, and Score Matching

The most significant breakthrough of this paper is the mathematical proof that minimizing the score-matching loss is strictly equivalent to maximizing the CT-ELBO of the plug-in reverse SDE. This grounds diffusion models firmly in the tradition of likelihood-based generative modeling.

Theoretical bounds showing the relationship between ELBO and likelihood.

Furthermore, the paper formalizes a long-held intuition: diffusion models are infinite-depth Variational Autoencoders (VAEs). The authors demonstrate that as a discrete hierarchical VAE scales to an infinite number of layers (with the step size shrinking to zero), the standard VAE ELBO perfectly converges to their newly derived CT-ELBO.

This framework also explains the success of deterministic "probability flow ODEs." Previous work showed that diffusion SDEs could be converted into ODEs that achieve excellent likelihoods. This paper explains why: minimizing the score-matching loss implicitly maximizes the likelihood of a whole family of SDEs, which includes the ODE as a limiting case.

Empirical Results and Trade-offs

The theoretical findings are backed by empirical evaluations on standard datasets, including a 2D Swiss Roll toy dataset and image datasets like MNIST and CIFAR10.

Swiss Roll trajectories comparing deterministic ODEs and stochastic SDEs.
  • Computational Trade-offs: On the Swiss Roll dataset, the authors visualize SDE trajectories to compare computational efficiency. While Continuous-Time Normalizing Flows (Neural ODEs) require fewer training iterations to converge, plug-in reverse SDEs are vastly faster in terms of wall-clock time. This is because SDEs trained via score matching avoid the expensive numerical integration required by ODEs during training.
  • Improved Likelihood Estimation: Standard score matching often reweights the loss function to reduce variance, which unfortunately biases the gradient estimator. The authors introduce a debiased estimator by sampling the time variable non-uniformly. Applied to MNIST and CIFAR10, this debiased estimator achieves a tighter variational lower bound (better Bits Per Dimension) and lower standard error compared to prior biased gradient estimators.

Limitations and Future Directions

While this paper provides a robust theoretical foundation for the likelihood properties of diffusion models, the authors explicitly note a major limitation: the theory does not fully explain why these models produce such incredibly high-quality visual samples. In generative models, likelihood and sample quality are often decoupled, leaving this as an open research problem.

For future work, the authors suggest that training could be accelerated by generalizing the underlying noise processes (such as the Ornstein-Uhlenbeck process) to feature non-linear dynamics parameterized by monotone neural networks. This advancement could allow for more complex inference paths without sacrificing the ability to sample efficiently.

Summary updated

BibTeX
@inproceedings{huang2021variational,
  author = {Chin-Wei Huang and Jae Hyun Lim and Aaron Courville},
  title = {{A Variational Perspective on Diffusion-Based Generative Models and Score Matching}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=bXehDYUjjXi},
}
Figure