Generative models, such as Stable Diffusion and StyleGAN, have revolutionized digital content creation by mapping low-dimensional "latent" vectors to high-dimensional images. However, the internal structure of these latent spaces remains largely a black box. While researchers often treat them as simple Euclidean spaces where linear interpolation yields smooth transitions, the reality is far more complex. Sudden "jumps" in generated content—such as a cat abruptly becoming a mountain—suggest that the underlying geometry is non-trivial and highly curved.
In the paper "Hessian Geometry of Latent Space in Generative Models," the authors bridge information geometry and statistical physics to rigorously map this hidden terrain. They propose that the natural geometry of a latent space is defined by the statistical distribution of the images it generates, rather than arbitrary pixel-based metrics.
The Euclidean Fallacy
The common assumption that latent spaces are flat, Euclidean environments is a convenient simplification that often fails in practice. In such a space, a straight line between two points should represent a smooth conceptual transition. However, image generation frequently exhibits non-smooth behavior, where minor perturbations lead to disproportionate visual changes. This suggests that the latent space is curved or even discontinuous.
Existing methods to map this geometry often rely on "pullback metrics" derived from image pixels or feature vectors. These methods are frequently noisy and computationally expensive. This paper seeks a more fundamental approach: can we define the geometry of the latent space based on the statistical distribution of the images it generates?
Methodology: Information Geometry and Thermodynamics
The authors leverage Information Geometry, specifically the property that for exponential families of distributions, the Fisher Information Metric (the natural "ruler" for measuring distances between probability distributions) is the Hessian of the log-partition function (also known as "free energy" in physics).
Their approach follows a three-step pipeline:
- Posterior Approximation: They estimate the probability $p(t|x)$—the likelihood that a specific latent vector $t$ produced a generated image $x$. For physics models, they use a U2-Net; for diffusion models, they use CLIP embeddings to measure distances.
- Learning the Free Energy: They train a neural network to represent the log-partition function $\log Z(t)$. They optimize this by ensuring the distribution derived from their learned $Z(t)$ matches the approximated posterior using a Jensen-Shannon Divergence (JSD) loss.
- Geodesic Computation: Once they have the metric (the Hessian of $Z(t)$), they can calculate "geodesics"—the true shortest paths between two points in the latent space.
Key Insights: Phases and Fractal Boundaries
The study reveals that latent spaces are not uniform but consist of distinct "phases," much like physical states of matter.
- Conceptual Phases: Latent spaces contain regions of stability where images remain conceptually consistent. Moving within a phase is smooth; crossing a boundary constitutes a "phase transition."
- Fractal Boundaries: In diffusion models, the boundary between two concepts (e.g., a "lion" and a "mountain") isn't a clean line. It is a fractal structure. As you zoom in on the boundary, you find smaller and smaller pockets of each phase permeating the other.
- The Breakdown of Linearity: The assumption that linear interpolation is "good enough" holds true only within a single phase. At phase boundaries, the model exhibits a divergent Lipschitz constant, meaning the output changes infinitely fast relative to the input.
Empirical Validation
The method was validated across three distinct domains: statistical physics models (Ising, TASEP), Stable Diffusion 1.5 (Dreamshaper8), and StyleGAN v3.
- Superior Accuracy: On the Ising and TASEP models, the "Convex" method (the authors' approach) achieved significantly lower Root Mean Squared Error (RMSE) in reconstructing thermodynamic quantities compared to standard baselines like PCA-VAE.
- Smoother Interpolation: Geodesics calculated using the Hessian metric were found to be more "perceptually smooth" than linear paths. While linear paths might "jump" suddenly between concepts, geodesics navigate the curvature of the space to provide a more natural transition.
- Visualizing Transitions: The authors successfully visualized the first and second derivatives of the latent space's free energy, clearly marking the "shocks" and "discontinuities" that correspond to visual changes in generated images.
Conclusion and Future Work
The primary limitation of this approach is dimensionality. The current study focuses on two-dimensional slices of the latent space. While the mathematical framework scales, the computational cost of training the log-partition function for the full high-dimensional latent space of a model like Stable Diffusion is currently prohibitive.
Future work may involve scaling these techniques to higher dimensions or using them to "smooth out" generative models during training, potentially leading to models that are more robust, easier to control, and fundamentally more aligned with human conceptual structures.
Reference: Lobashev, A., Guskov, D., Larchenko, M., & Tamm, M. (2025). Hessian Geometry of Latent Space in Generative Models. Proceedings of the 42nd International Conference on Machine Learning (ICML).
Summary updated