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

Follow the Energy, Find the Path: Riemannian Metrics from Energy-Based Models

Louis Béthune, David Vigouroux, Yilun Du, Rufin VanRullen, Thomas Serre, Victor Boutin

TL;DR

This paper introduces a novel framework for deriving data-aware Riemannian metrics directly from pretrained Energy-Based Models (EBMs). By leveraging the global energy landscapes of EBMs, the proposed method successfully computes geodesics (shortest paths) that closely adhere to complex, high-dimensional data manifolds, significantly outperforming traditional distance baselines.

What Problem Does This Paper Address?

In machine learning, high-dimensional data (like images or text embeddings) rarely fills the ambient space uniformly; instead, it concentrates on lower-dimensional, curved structures called data manifolds. When interpolating between two data points, standard Euclidean geometry dictates taking a straight line. However, a straight line often slices directly through "empty" space where no realistic data exists.

To find paths that stay on the manifold, researchers use Riemannian geometry, which introduces a locally varying metric tensor to warp space—effectively making low-density regions "expensive" to cross and high-density regions "cheap." The shortest paths under this metric are called geodesics. The core challenge has been accurately estimating this Riemannian metric in high-dimensional spaces where data is sparsely sampled. Prior methods (like kernel density estimators) break down as dimensions scale up.

Methods

The authors propose deriving conformal Riemannian metrics from Energy-Based Models (EBMs). EBMs are generative models trained to assign low energy values to realistic data points and high energy to unrealistic ones. Crucially, their contrastive training forces them to learn a smooth, global energy landscape across the entire space.

The paper introduces two novel conformal metrics that scale the identity matrix $I$ by a positive scalar function:

  1. $G_{E_\theta}$ (Log-based metric): Directly scales the raw energy of the EBM: $G_{E_\theta}(x) = (\alpha * E_\theta(x) + \beta) \cdot I$. High-energy regions act as a penalty barrier.
  2. $G_{1/p_\theta}$ (Density-based metric): Uses the inverse of the unnormalized probability estimate: $G_{1/p_\theta}(x) = (\alpha * \exp(-E_\theta(x)) + \beta)^{-1} \cdot I$. This creates an even sharper repulsive force away from low-density zones.

To avoid the massive computational cost of solving differential equations for every path at inference time, the authors train a neural network called a geodesic interpolant ($\phi_\eta$). This network learns to apply a non-linear correction to a simple straight line, bending the path toward high-density regions by minimizing a kinetic energy functional via finite differences.

Datasets

The framework was evaluated across three distinct levels of complexity:

  • Circular Mixture of Gaussians: Synthetic 2D toy datasets (Uniform and Weighted) where the true data density is known analytically, providing a perfect ground-truth baseline.
  • Rotated Characters: A 64-dimensional latent space dataset featuring seven asymmetric characters (5, G, F, P, J, 7, 2) under uniform and biased rotations.
  • Animal Faces (AFHQ): High-resolution natural images of cats and dogs, mapped into a high-dimensional latent space ($4 \times 16 \times 16$) using a pretrained Stable Diffusion v1 VAE.

Key Insights and Ideas

  • Global vs. Local Landscapes: Unlike normalizing flows or diffusion models—which struggle with out-of-distribution data or rely on time-dependent noise scales—EBMs provide a stable, global energy landscape perfectly suited for defining a continuous Riemannian metric.
  • The "Acceleration" Phenomenon: Geodesics calculated using log-based metrics ($G_{E_\theta}$) naturally accelerate through high-density regions in Euclidean terms. Because the Riemannian metric cost is so low in high-density areas, a particle must move faster through them to maintain the constant Riemannian speed required by geodesic physics. This mathematically mirrors human psychophysical observations in mental rotation tasks, where familiar orientations are processed faster.

Key Results

The EBM-derived metrics consistently outperformed established baselines like GLAND and GRBF across all tasks:

  • Manifold Adherence: On the Rotated Characters dataset, the EBM metrics successfully generated smooth, realistic in-plane rotations that preserved character identity. As shown in the PCA projection, baseline methods like GLAND and GRBF frequently drifted off-manifold, turning the letter 'F' into a 'P' or '7' mid-trajectory.
Geodesics visualization on the URC dataset projected into PCA space
  • Quantitative Scaling: In the high-dimensional image space of AFHQ, paths generated by $G_{1/p_\theta}$ achieved an exceptionally low Fréchet Inception Distance (FID) of 16.47 along the trajectory. This drastically beat standard linear interpolation (42.47), spherical interpolation/slerp (32.67), and traditional metrics like GLAND (39.17).
  • Curvature Sensitivity: Log-based metrics ($G_{E_\theta}$) demonstrated much sharper sensitivity to density changes, producing distinct step-size variations along the path compared to density-inverse metrics.
Figure 3: Step size along geodesics in the WCG dataset. Log-based metrics (GEθ and GEM) produce sharper vari- ations, reflecting stronger sensitivity to density curvature.

Limitations and Future Work

Despite the strong results, the authors highlight several limitations:

  • Conformal Restriction: The metrics are purely conformal, meaning they scale space uniformly in all directions (isotropically) and cannot capture directional, anisotropic structures.
  • EBM Training Hurdles: EBMs are notoriously difficult and computationally expensive to train in high dimensions due to their reliance on MCMC/Langevin sampling.
  • Indirect Evaluation: Evaluating the true mathematical curvature of complex spaces like natural image manifolds remains difficult, forcing reliance on proxy metrics like FID.

Future directions include extending this framework to more expressive, non-conformal score-based metrics and improving the training stability of the underlying EBMs.

Summary updated

BibTeX
@inproceedings{bethune2025follow,
  author = {Louis Béthune and David Vigouroux and Yilun Du and Rufin VanRullen and Thomas Serre and Victor Boutin},
  title = {{Follow the Energy, Find the Path: Riemannian Metrics from Energy-Based Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=BOiQ7Kd5Lx},
}
Figure