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

Abstract

Interpolating between data points in high-dimensional spaces often results in paths that traverse low-density regions, leading to unrealistic intermediate samples. This paper introduces a framework for deriving Riemannian metrics directly from pretrained Energy-Based Models (EBMs). By treating the energy landscape as a geometric map, the authors define "data-aware" shortest paths (geodesics) that remain on the data manifold. This approach demonstrates superior performance in high-dimensional latent spaces, outperforming traditional density-estimation baselines in both manifold adherence and generative quality.

Introduction

In machine learning, the ability to interpolate between two data points—such as morphing one face into another—is a fundamental task. However, simple linear interpolation in high-dimensional space typically fails because the data manifold is often highly curved and sparse. A straight line between two points on a manifold usually cuts through "empty" regions where no valid data exists, resulting in blurry or nonsensical intermediate samples.

To address this, we must find the "shortest path" along the data manifold itself. This requires a Riemannian metric: a mathematical construct that defines local distance such that traveling through high-density (likely) regions is "cheap" and traveling through low-density (unlikely) regions is "expensive." While methods for estimating these metrics exist, they often suffer from the "curse of dimensionality," becoming unreliable as the number of features grows. This paper proposes leveraging the global energy landscapes of Energy-Based Models (EBMs) to overcome these limitations.

Methodology

EBM-Derived Metrics

Energy-Based Models learn a scalar energy function $E(x)$, where low energy corresponds to high data density. The authors propose deriving conformal metrics—metrics that scale the identity matrix by a scalar—from these models. They introduce two specific formulations:

  1. Log-based Metric ($G_{E_\theta}$): Proportional to the energy itself (the negative log-likelihood).
  2. Density-based Metric ($G_{1/p_\theta}$): Proportional to the inverse of the unnormalized density.

Unlike previous methods like LAND or RBF metrics that rely on local kernel density estimation, EBMs provide a global landscape. This allows the metric to remain meaningful even in regions far from the training samples, providing a more robust geometric prior.

Geodesic Interpolants

Solving the differential equations for geodesics is computationally expensive. To make the framework feasible for real-time applications, the authors train a geodesic interpolant. This is a small neural network designed to predict the curved path between any two points in the latent space.

A key theoretical insight of this work is the physical interpretation of these paths. The authors demonstrate that these geodesics behave like particles moving in a force field shaped by the "Stein score" (the gradient of the log-density). In this view, the data geometry acts as a repulsive force, pushing paths away from low-density "voids" and keeping them within the high-density manifold.

Experimental Setup

The approach was evaluated across three levels of complexity:

  • Circular Mixture of Gaussians: Toy 2D datasets used to validate the framework against known ground-truth geometry.
  • Rotated Characters (URC/BRC): Images of digits and letters rotated at various angles, embedded in a 64-dimensional latent space. This provides a controlled environment where the manifold (rotation) is interpretable.
  • Animal Faces (AFHQ): High-resolution images of cats and dogs embedded in a 1024-dimensional latent space of a pretrained Stable Diffusion VAE, testing the scalability of the metric in extreme dimensions.

Key Results and Insights

High-Dimensional Scalability

On the 1024D AFHQ latent space, the EBM-derived metrics produced significantly more realistic interpolations than standard baselines. The $G_{1/p_\theta}$ metric achieved a Fréchet Inception Distance (FID) score of 16.47, a substantial improvement over linear interpolation (42.47) and Spherical Interpolation (Slerp) (32.67).

Manifold Adherence

In the rotated character tasks, the EBM metrics stayed much closer to the true manifold of rotation. The deviation (D-RMSE) for $G_{E_\theta}$ was measured at 0.11, whereas traditional metrics like LAND (0.66) and RBF (0.36) struggled to maintain the correct trajectory. Furthermore, the EBM approach proved robust to hyperparameters, avoiding the "sinuous" or jagged paths often produced by LAND and RBF when bandwidth is not perfectly tuned.

The "Speed" of Geometry

An interesting observation was that geodesics under these metrics move faster through high-density regions. While initially counter-intuitive, this is a mathematical consequence of minimizing "kinetic energy"—it is more efficient for the path to spend less "time" in expensive, low-density areas. This behavior mirrors psychophysical findings in human "mental rotation" tasks, suggesting that EBMs may capture fundamental aspects of human object perception.

Limitations and Future Work

Despite its success, the framework has limitations. The current metrics are conformal, meaning they scale space equally in all directions. They cannot yet capture anisotropic structures where the manifold might stretch more in one direction than another. Additionally, training stable EBMs in very high dimensions remains a challenge, which is why the authors currently utilize VAE latent spaces.

Future research directions include exploring non-conformal metrics to capture more complex manifold structures and integrating these geometric priors directly into the training of generative models, rather than applying them post-hoc.

Conclusion

By deriving Riemannian metrics from Energy-Based Models, this work provides a powerful tool for navigating high-dimensional data manifolds. The framework not only improves the quality of data interpolation but also provides a bridge between deep generative modeling, differential geometry, and cognitive science.

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