A Score-Based Density Formula, with Applications in Diffusion Generative Models

Gen Li, Yuling Yan · Submission to ICLR 2025 · Withdrawn

TL;DR

This paper derives a closed-form density formula that links the data distribution’s log-likelihood directly to the score functions along a continuous-time forward diffusion process. Using this formula, the authors prove that minimizing the standard Evidence Lower Bound (ELBO) in Denoising Diffusion Probabilistic Models (DDPMs) directly minimizes the true KL divergence to the target distribution. The theory also provides rigorous justifications for using diffusion ELBO as a surrogate log-likelihood in GAN regularization, zero-shot diffusion classifiers, and autoregressive models.

What Problem Does This Paper Address?

Diffusion models (such as DDPMs) are routinely trained by minimizing the ELBO on the data log-likelihood. Moreover, recent empirical work frequently uses a pre-trained DDPM’s ELBO as a plug-and-play proxy for the negative log-likelihood in downstream applications—such as regularizing GANs, building zero-shot classifiers, and designing diffusion losses for autoregressive models.

However, two theoretical gaps remain:

  1. Optimization Validity: Why does optimizing a variational lower bound actually yield a generative distribution nearly identical to the true data distribution in KL divergence?
  2. Surrogate Justification: Why does the ELBO act as an accurate point-wise proxy for $-\log p_{\text{data}}(x)$? Previous attempts to extract exact densities from diffusion models relied on continuous normalizing flows (Probability Flow ODEs), which require evaluating computationally expensive and unstable trace-Jacobian terms ($\text{tr}(\nabla^2 \log p_t)$).

Methods

The authors study the continuous-time limit of the DDPM forward process via the stochastic differential equation (SDE): $$dXt = -\frac{1}{2(1 - t)} X_t dt + \frac{1}{\sqrt{1 - t}} dB_t, \quad X_0 \sim p_{\text{data}}, \quad t \in [0, 1)$$

By transforming $X_t$ into a martingale $Y_t = X_t / \sqrt{1 - t}$ and applying Itô’s calculus and Stein’s lemma, they derive a continuous-time score-based density formula: $$\log \rho_0(x_0) = -\frac{1 + \log(2\pi)}{2} d - \int_0^1 \left( \frac{1}{2(1 - t)} \mathbb{E}\left[ \left\| \frac{X_t - \sqrt{1 - t}X_0}{t} + \nabla \log \rho_t(X_t) \right\|_2^2 \,\middle|\, X_0 = x_0 \right] - \frac{d}{2t} \right) dt$$

Discretizing this formula across discrete timesteps recovers the standard score-matching/$\epsilon$-prediction loss terms used in DDPMs.

Datasets

Not discussed in the paper. The work is purely theoretical and does not introduce or evaluate empirical benchmarks.

Key Insights and Ideas

  • No Jacobian or ODE Integration Needed: Unlike standard Instantaneous Change of Variables formulas in continuous normalizing flows, this density representation does not require computing the divergence/Jacobian of the score function ($\nabla^2 \log \rho_t$) or integrating an ODE backwards from $t=1$. It only involves conditional Gaussian expectations of the score function itself.
  • The "Vanishing" Constant $C_0(x)$ is Actually Constant: In the discrete ELBO breakdown, the reconstruction term $C_0(x) = \mathbb{E}[\log p(x|x_1)]$ was historically treated via heuristic discrete binning or incorrectly dismissed as negligible. The authors show that $C_0(x) = -\frac{1 + \log(2\pi\beta_1)}{2}d + \mathcal{O}(\beta_1)$, meaning it is a very large number (since $\beta_1 \to 0$) but independent of $x$. It functions as an additive universal constant $C_0^*$.
  • Global ELBO Minimizer is the True Data Minimizer: Because the discrete ELBO objective satisfies $L(x) \approx -\log q_0(x) + C_0^*$, minimizing the empirical variational bound asymptotically drives $\text{KL}(q_0 \parallel p_0) \to 0$ as the number of diffusion steps $T \to \infty$.
  • Explaining Downstream Successes:
  • GAN Regularization: Adding diffusion loss to GAN generator training acts as an explicit density filter: $p_{G_\lambda}(x) = (z\, p_{\text{data}}(x)^\lambda - 1)_+ p_{\text{data}}(x)$, amplifying high-density modes and cutting off noisy low-density regions.
  • Diffusion Classifiers: In Bayes' rule $p(c|x) \propto p(x|c)$, substituting $-L(x; c)$ works because the offset $C_0^*$ is uniform across all classes $c$ and cancels out during softmax normalization.
  • Autoregressive Diffusion Loss: Using the diffusion loss for next-token conditioning corresponds directly to maximum likelihood estimation (MLE).

Key Results

  • Continuous Density Identity (Theorem 1, Props 1 & 2): Under mild smoothness assumptions, the conditional expectation $\mathbb{E}[\log \rho_t(X_t) \mid X_0 = x_0]$ converges to $\log \rho_0(x_0)$ as $t \to 0^+$ and to $-\frac{1 + \log(2\pi)}{2}d$ as $t \to 1^-$.
  • Coefficient Equivalence: The coefficients of the discrete ELBO and the discretized density formula match up to higher-order error bounded by $\mathcal{O}\left(\frac{\log T}{T}\right)$.
  • Terminal KL Bound: The prior terminal mismatch term is shown to vanish rapidly with schedule: $\text{KL}(p_{Y_T} \parallel p_{X_T \mid X_0}) \le \frac{d + \|x_0\|_2^2}{4 T^{c_2}}$ for constant $c_2 > 0$.

Limitations and Future Work

  • Discretization Error Bounds: The exact identity holds in continuous time; rigorous finite-sample non-asymptotic bounds quantifying the step-size discretization error remain open.
  • Reweighted / Simplified Losses ($L_{\text{simple}}$): In practice, DDPMs are trained with uniform weighting over noise scales rather than the exact ELBO coefficients. The paper does not theoretically explain why this unweighted heuristic often outperforms the exact ELBO.
  • Smoothness Assumptions: Extending the low-noise limit ($t \to 0$) to singular or lower-dimensional manifold distributions without relying on a smoothing parameter $\delta > 0$ requires further work.

Summary updated

BibTeX
@misc{li2024score,
  author = {Gen Li and Yuling Yan},
  title = {{A Score-Based Density Formula, with Applications in Diffusion Generative Models}},
  year = {2024},
  eprint = {2408.16765},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.16765},
}
Figure