Navigating the Latent Space Dynamics of Neural Models
Marco Fumero, Luca Moschella, Emanuele Rodolà, Francesco Locatello
TL;DR
This work reframes autoencoders as dynamical systems on a latent manifold by defining a latent vector field $f(z)=E(D(z))$ and studying the discrete flow $z_{t+1}=f(z_t)$. Under typical regularization and architectural biases, $f$ tends to be contractive, producing attractors that capture the balance between memorization and generalization and reflect the learned data distribution. The authors connect the latent dynamics to the latent density $q(z)$, showing that trajectories ascend the score of $q$ and, when $J_f$ is symmetric, relate to a potential energy landscape, enabling an energy-based interpretation. They demonstrate practical benefits through data-free weight probing on vision foundation models and trajectory-based OOD detection, illustrating that attractors can serve as interpretable priors and that latent trajectories reveal distributional shifts. Overall, the latent dynamics framework provides a principled tool to analyze model behavior, diagnose generalization vs memorization, and probe weight-encoded knowledge without direct access to input data.
Abstract
Neural networks transform high-dimensional data into compact, structured representations, often modeled as elements of a lower dimensional latent space. In this paper, we present an alternative interpretation of neural models as dynamical systems acting on the latent manifold. Specifically, we show that autoencoder models implicitly define a latent vector field on the manifold, derived by iteratively applying the encoding-decoding map, without any additional training. We observe that standard training procedures introduce inductive biases that lead to the emergence of attractor points within this vector field. Drawing on this insight, we propose to leverage the vector field as a representation for the network, providing a novel tool to analyze the properties of the model and the data. This representation enables to: (i) analyze the generalization and memorization regimes of neural models, even throughout training; (ii) extract prior knowledge encoded in the network's parameters from the attractors, without requiring any input data; (iii) identify out-of-distribution samples from their trajectories in the vector field. We further validate our approach on vision foundation models, showcasing the applicability and effectiveness of our method in real-world scenarios.
