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

A prior-based approximate latent Riemannian metric

Georgios Arvanitidis, Bogdan Georgiev, Bernhard Schölkopf

Abstract

Variational Auto-Encoders (VAEs) are powerful tools for learning low-dimensional representations of high-dimensional data. However, the resulting latent spaces are often geometrically distorted, making standard Euclidean distances misleading. While Riemannian metrics like the "pull-back" metric can correct this, they are computationally expensive and numerically unstable. This paper introduces a surrogate conformal Riemannian metric derived from a learnable energy-based prior. This approach provides a simple, efficient, and robust alternative for navigating latent manifolds, demonstrating significant improvements in computational speed and stability across synthetic and real-world datasets.

Introduction

In deep learning, we frequently operate under the manifold hypothesis: the idea that high-dimensional data points lie on a much simpler, low-dimensional surface. VAEs attempt to find this surface by mapping data into a latent space $Z$. However, the mapping is rarely uniform. A straight line in $Z$ might pass through "empty" regions where no data exists, leading to interpolations that look nothing like the training data.

Geodesics on a data manifold where paths are attracted to high-density regions.

To solve this, researchers use Riemannian geometry to define "shortest paths" (geodesics) that follow the data density. The standard approach is the pull-back metric, which uses the Jacobian of the decoder to measure how distances in latent space translate to the data space. Unfortunately, this method is plagued by high computational costs and numerical instability in high dimensions.

The Challenge of Latent Geometry

The traditional pull-back metric $G(z) = J(z)^T J(z)$, where $J(z)$ is the Jacobian of the generator, has three primary drawbacks:

  1. Computational Complexity: Calculating Jacobians and their derivatives for every step of a geodesic solver is extremely slow.
  2. Instability: In regions far from the training data, the Jacobian can "explode" or become singular, causing solvers to fail.
  3. Identifiability: The metric depends heavily on the specific parameterization of the decoder, meaning different models for the same data can yield wildly different "shortest" paths.

The Proposed Solution: A Prior-Based Metric

Arvanitidis et al. propose a shift in perspective. Instead of looking at the decoder's behavior, they look at the prior distribution of the latent codes. By replacing the standard Gaussian prior with a flexible Energy-Based Model (EBM), the model learns exactly where the data "lives" in the latent space.

The authors define a conformal metric that is inversely proportional to this learned density: $$g(z) = \phi(z) \cdot I$$ where $\phi(z)$ is a scaling factor derived from the EBM prior. In this framework, regions of high data density have a small "metric cost," while empty regions have a high cost. This naturally pushes geodesics toward the data manifold. Because the metric is a simple scalar scaling of the identity matrix, the differential equations for finding paths simplify dramatically, leading to much faster and more reliable convergence.

Experimental Validation

The researchers tested their method on synthetic manifolds designed to challenge path-finding algorithms: a "Hole" (a gap in the data), a "Ball" (a dense cluster), and a "Normal" distribution.

Comparison of the proposed metric (green) against the traditional pull-back metric (red) across synthetic manifolds, showing superior stability and path quality.

As shown in the figure above, the proposed metric (green) consistently finds paths that stay within the data-rich regions, even when the traditional pull-back metric (red) deviates or becomes erratic. Quantitatively, the violin plots demonstrate that the error and variance of the proposed method are significantly lower than the baseline.

Beyond synthetic tests, the method showed impressive results in real-world applications:

  • Efficiency: In analyzing mouse cortex cell data, the proposed metric allowed for model fitting in just 10 minutes, compared to 2 hours for the pull-back metric.
  • Robustness: In 10-dimensional latent spaces, the traditional metric failed to converge in over 25% of cases, while the prior-based metric remained stable.
  • Life Sciences: In chemical compound analysis (ZINC database), the metric produced interpolations between molecules that followed chemically plausible trajectories rather than arbitrary linear paths.

Conclusion

By leveraging the latent prior as a proxy for manifold geometry, this work provides a practical path forward for using Riemannian geometry in deep generative models. The proposed conformal metric bypasses the computational bottlenecks of Jacobian-based methods while offering superior stability and interpretability. This makes it a valuable tool for exploratory data analysis, particularly in fields like the life sciences where understanding the underlying structure of high-dimensional data is critical.

Reference: Arvanitidis, G., Georgiev, B., & Schölkopf, B. (2021). A prior-based approximate latent Riemannian metric. arXiv:2103.05290v1.

Summary updated

BibTeX
@inproceedings{arvanitidis2022prior,
  author = {Georgios Arvanitidis and Bogdan Georgiev and Bernhard Schölkopf},
  title = {{A prior-based approximate latent Riemannian metric}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2022},
  url = {https://openreview.net/forum?id=ycoJksZWH},
}
Figure