Feature-Based Interpolation and Geodesics in the Latent Spaces of Generative Models

Łukasz Struski, Michał Sadowski, Tomasz Danel, Jacek Tabor, Igor T. Podolak · DOI

Abstract

Generative modeling often relies on linear or spherical interpolation in latent spaces, assuming Euclidean geometry and simple Gaussian distributions. This paper introduces a robust mathematical framework for navigating latent spaces by treating interpolation as a search for geodesics in a redefined Riemannian space. By optimizing a quality measure through a neural interpolation model, the proposed method enables realistic, feature-aware transitions that respect data density. The framework is validated across diverse benchmarks, including image synthesis and molecular design.

Introduction

In generative modeling, interpolating between two points in a latent space is a common technique to explore the learned manifold. Traditional methods, such as linear (LERP) or spherical (SLERP) interpolation, assume that the latent space is Euclidean and the data distribution is a simple, unimodal Gaussian. However, real-world latent spaces are often highly structured and "curved." Straight-line paths between high-probability points may traverse "dead zones" of low probability, resulting in blurry or unrealistic intermediate samples. Furthermore, standard methods lack the ability to "steer" transitions to ensure intermediate samples maintain specific semantic features.

Methodology

The authors propose a unified framework that treats latent space interpolation as a shortest-path problem on a manifold where the metric is weighted by data probability.

Quality Measure and Riemannian Connection

The core of the approach is a Quality Measure for curves. The authors define a quality function $Q(z)$ representing the probability of a point $z$ belonging to the data manifold or possessing a specific feature. They prove that maximizing the quality of a curve is mathematically equivalent to finding a geodesic under a specific Riemannian metric.

Neural Interpolation Model

To avoid solving complex differential equations, the framework utilizes a dedicated neural network ($f_\theta$) to represent the interpolation path. This network is optimized to minimize an "energy function" that balances path length with data quality.

Overview of the neural interpolation framework and energy minimization process.

By incorporating classifiers into the quality measure, the model can perform Feature Steering, forcing the interpolation path through regions of the latent space that represent specific attributes, such as "blond hair" or "beard."

Experiments and Results

The method was evaluated on several benchmarks, including synthetic manifolds, image datasets (MNIST, CelebA, Glow), and chemical compounds (ZINC database).

Visual Fidelity and Attribute Control

In models like DCGAN and Glow, the proposed method produced significantly more realistic intermediate images than linear interpolation. When tasked with finding a path that includes a specific feature, the method maintained that feature in nearly 90% of intermediate frames, whereas spherical interpolation often failed.

Comparison of interpolation paths for facial attributes using Pioneer and Glow models.

Chemical Optimization

Using a Junction Tree VAE (JT-VAE), the method successfully found paths between molecules that optimized for properties like hydrophobicity (log P) and drug-likeness (QED) while ensuring every intermediate step represented a chemically valid molecule.

Key Insights

  • Interpolation as Geodesics: "Good" interpolation is fundamentally a shortest-path problem on a probability-weighted manifold.
  • Handling Non-Gaussian Priors: The framework handles arbitrary densities gracefully, unlike standard models that fail when the latent prior is non-standard.
  • Robustness: Results were largely indifferent to the specific choice of kernel, suggesting that the underlying Riemannian geometry is the dominant factor in path quality.

Conclusion and Future Work

The proposed framework offers a powerful tool for post-hoc analysis of pre-trained generative models. While effective, it faces challenges such as feature entanglement—where requesting one attribute might inadvertently trigger another due to training data correlations. Additionally, the method requires an optimization step for every interpolation, which is computationally more expensive than closed-form calculations. Future research may extend this approach to robotics for path-finding or to the exploration of neural activations in biological systems.

Summary updated

BibTeX
@article{struski2023feature,
  author = {Łukasz Struski and Michał Sadowski and Tomasz Danel and Jacek Tabor and Igor T. Podolak},
  title = {{Feature-Based Interpolation and Geodesics in the Latent Spaces of Generative Models}},
  journal = {IEEE Transactions on Neural Networks and Learning Systems},
  year = {2023},
  doi = {10.1109/tnnls.2023.3251848},
}
Figure