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

What's Inside Your Diffusion Model? A Score-Based Riemannian Metric to Explore the Data Manifold

Simone Azeglio, Arianna Di Bernardo · DOI

Introduction

Diffusion models have set new standards in generative AI, yet the underlying geometric structure of the data they model—the "data manifold"—remains largely opaque. Standard interpolation techniques like Linear Interpolation (LERP) often fail because they traverse "empty" regions of pixel space, resulting in blurry or unrealistic transitions. This paper introduces a novel Riemannian metric derived from the Stein score function, allowing for the computation of geodesics that naturally follow the high-density regions of the data manifold.

The Stein Score Metric Tensor

The core contribution is the definition of the Stein score metric tensor: $$g(x) = I + \lambda \cdot s(x)s(x)^T$$ where $s(x) = \nabla_x \log p(x)$ is the score function estimated by the diffusion model. This metric is designed to be anisotropic: it "stretches" distances in directions perpendicular to the manifold (where the score magnitude is high) while preserving distances along the manifold.

Conceptual overview of the data manifold support, interpolation comparison, and ambient space deformation.

By penalizing movement away from the manifold, the "shortest path" (geodesic) between two images is forced to curve through regions of high data density. To find these paths, the authors utilize a three-stage algorithm involving noise addition for smoothing, geodesic optimization via a specialized Riemannian Adam optimizer, and a final denoising step.

The practical benefit of this geometric approach is most evident in image interpolation. Unlike Euclidean paths that "fade" one image into another, score-based geodesics perform semantically meaningful transformations.

Comparison between linear (Euclidean) and geodesic paths in pixel space for MNIST digits. The geodesic path maintains digit structure by following the manifold.

In experiments with Rotated MNIST, the geodesic path correctly identifies the rotational structure of the data, rotating the digit rather than simply overlaying two static images. This alignment with human perception is a key advantage of the proposed metric.

Experimental Results

The method was evaluated on synthetic data, Rotated MNIST, and the MorphBench benchmark using Stable Diffusion 2.1.

  • Rotated MNIST: The geodesic approach significantly outperformed baselines in structural consistency, achieving a PSNR of 14.98 and SSIM of 0.650.
  • Natural Images (MorphBench): On complex image pairs, the method achieved superior perceptual and distributional scores, with an FID of 140.6 and LPIPS of 0.358, outperforming standard LERP.

Conclusion and Future Work

By leveraging the score function as a geometric guide, the authors provide a principled way to explore the internal representations of diffusion models. While the current optimization process is computationally intensive, future work involving neural surrogate models could enable real-time applications in interactive image editing and semantic manipulation.

Summary updated

BibTeX
@misc{azeglio2025what,
  author = {Simone Azeglio and Arianna Di Bernardo},
  title = {{What's Inside Your Diffusion Model? A Score-Based Riemannian Metric to Explore the Data Manifold}},
  year = {2025},
  eprint = {2505.11128},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.11128},
}
Figure