Diffusion Models Observe Only Gradients: A Geometric Perspective on Score Matching Errors

Naïl B. Khelifa, Richard E. Turner, Ramji Venkataramanan

TL;DR

Standard theoretical analyses of score-based diffusion models rely on the total $L^2$ score matching error to bound generation quality, but this paper reveals that a large portion of this error is completely "invisible" to the model's actual generative performance. By decomposing score errors into gradient and solenoidal (rotational) components, the authors provide a tighter theoretical bound and a practical, critic-based diagnostic tool that correlates significantly better with actual sample quality.

What Problem Does This Paper Address?

Score-based diffusion models generate data by reversing a noise-inducing diffusion process. To do this, they train a neural network to estimate the "score"—the gradient of the log probability density of the noised data. Naturally, researchers have long evaluated these models using the standard $L^2$ score matching error, and foundational mathematical proofs (like those using Girsanov's theorem) use this total error to place an upper bound on how much the generated distribution diverges from the true data.

However, the authors point out a fundamental flaw in this assumption: a diffusion model can incur an arbitrarily large $L^2$ score error while still perfectly matching the target distribution. This happens because the physical law governing how the data distributions evolve over time (the Fokker-Planck equation) filters out certain types of vector field changes. Standard $L^2$ error penalizes all mistakes equally, making existing theoretical bounds overly pessimistic and poorly reflective of actual sample quality.

Methods

To fix this geometric mismatch, the authors introduce three key innovations:

  1. Helmholtz-Hodge Decomposition of Errors: They mathematically split the score estimation error into two orthogonal parts: a gradient component (which actively moves probability mass and alters the data density) and a solenoidal component (which is divergence-free and merely rotates mass locally without changing the distribution).
  2. A Tighter KL Divergence Bound: They prove that the solenoidal component is structurally invisible to the marginal distribution dynamics. By discarding this irrelevant error, they derive a new, sharper upper bound on the Kullback-Leibler (KL) divergence between the target and learned distributions.
  3. Observable-Error Critic (Variational Estimation): Projecting high-dimensional neural network errors onto gradient fields is normally computationally intractable. To bypass this, the authors leverage a dual Sobolev ($H^{-1}$) variational identity. They train a separate scalar-valued neural network (a "critic") via gradient ascent to find the steepest gradient directions of the score error, creating a practical, sample-based diagnostic tool that avoids solving complex partial differential equations (PDEs).

Datasets

The authors validated their theoretical insights and diagnostic tools using two standard image datasets:

  • Fashion-MNIST
  • CIFAR-10

No new datasets were introduced in this work.

Key Insights and Ideas

  • The "Invisible" Error: Solenoidal errors are completely harmless. Because they only induce local rotations, a model with massive solenoidal error will still generate perfect samples. Standard training objectives waste network capacity trying to minimize these invisible errors.
  • The Girsanov Saturation Floor: During training, standard Denoising Score Matching (DSM) successfully minimizes the gradient component of the error, but the solenoidal component quickly plateaus and dominates the remaining total error. This causes traditional theoretical bounds to flatten out, falsely indicating that the model has stopped improving when actual sample quality is still rising.
  • Optimal Transport Alignment: The gradient component of the score error maps directly onto the tangent space of the Wasserstein-2 space (the Otto manifold). This provides a clean, elegant bridge between diffusion models and optimal transport theory.

Key Results

  • Superior Correlation with FID: The gradient error component ($\mathcal{E}_{\text{grad}}$) tracks actual sample quality much more reliably than the full $L^2$ error ($\mathcal{E}_{\text{full}}$). On Fashion-MNIST, the Spearman rank correlation between the gradient error and the Fréchet Inception Distance (FID) remains exceptionally high (~0.96–0.97) across all model sizes, whereas the full error's correlation degrades significantly on smaller models.
  • Visualizing the Phenomenon: Figure 1 demonstrates that adding purely solenoidal error fields results in an identical generated distribution to the baseline, whereas gradient errors of the exact same energy cause the model to completely miss data modes.
Helmholtz-Hodge decomposition of score errors showing identical distributions despite solenoidal errors.
  • Exposing the Inobservability Gap: When tracking a model throughout its training trajectory on CIFAR-10, the gradient error drops by roughly two orders of magnitude, while the solenoidal error plateaus. Consequently, the authors' proposed bound continues to decrease alongside improving sample quality, while the standard Girsanov bound prematurely saturates.
Figure 3: DSM does not reduce the invisible component of the score error on CIFAR-10 [41]. Left. The gradient (observable) component of score estimation errors falls by roughly two orders of magnitude during training, while the solenoidal (invisible) component rises early and then plateaus, eventually accounting for nearly all of the residual error. Right. As a consequence, the standard Girsanov bound (15) saturates at the solenoidal floor while our bound (Theorem 3.2) continues to decrease. The shaded inobservability gap is what the standard analysis misses by penalizing error components invisible to marginals (Theorem 3.1). Median (solid) and inter-quartile range (band) over five seeds. Setup details in Appendix D.3. The same observations hold for Fashion-MNIST (Figures 4 and 5, Appendix D.2).

Limitations and Future Work

  • Instantaneous vs. Accumulated Paths: The new bound integrates instantaneous gradient errors along the reverse path. However, it does not fully capture how these errors accumulate, amplify, or dissipate as they approach the final endpoint. Developing a sharper notion of "endpoint observability" remains an open theoretical challenge.
  • Moving from Diagnostic to Objective: Currently, this method is used purely as a post-hoc diagnostic tool (the score network is frozen while the critic is trained). Translating this estimator into an active training objective to force the score network to ignore solenoidal directions presents a difficult min-max optimization problem that could destabilize training if not carefully managed.

Summary updated

BibTeX
@inproceedings{khelifa2026diffusion,
  author = {Naïl B. Khelifa and Richard E. Turner and Ramji Venkataramanan},
  title = {{Diffusion Models Observe Only Gradients: A Geometric Perspective on Score Matching Errors}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=ZfRxNzTSSZ},
}
Figure