Hamiltonian Mechanics of Feature Learning: Bottleneck Structure in Leaky ResNets
Arthur Jacot, Alexandre Kaiser
TL;DR
The paper analyzes Leaky ResNets as continuous-depth systems with an effective depth $\tilde{L}$ and studies the emergent feature-learning dynamics via Lagrangian and Hamiltonian formalisms. It introduces representation geodesics $A_p$ and decomposes the optimization into a kinetic term and a Cost of Identity (COI) term that measures representation dimensionality, explaining how large $\tilde{L}$ drives a bottleneck: rapid transitions to a low-dimensional space, slow evolution within it, then a rapid return to high-dimensional outputs. A Hamiltonian formulation with momenta $B_p$ formalizes the conserved energy $\mathcal{H}$ and clarifies the separation of timescales, while a gamma-stabilized version resolves pseudo-inverse instabilities. Practical discretization schemes, including adaptive layer stepping, are proposed to align layer density with the bottleneck, enabling efficient training and revealing a robust bottleneck rank $k^*$. Overall, the work provides a mechanistic view of bottleneck formation in deep nets and a principled path to adaptive training strategies rooted in Hamiltonian dynamics.
Abstract
We study Leaky ResNets, which interpolate between ResNets and Fully-Connected nets depending on an 'effective depth' hyper-parameter $\tilde{L}$. In the infinite depth limit, we study 'representation geodesics' $A_{p}$: continuous paths in representation space (similar to NeuralODEs) from input $p=0$ to output $p=1$ that minimize the parameter norm of the network. We give a Lagrangian and Hamiltonian reformulation, which highlight the importance of two terms: a kinetic energy which favors small layer derivatives $\partial_{p}A_{p}$ and a potential energy that favors low-dimensional representations, as measured by the 'Cost of Identity'. The balance between these two forces offers an intuitive understanding of feature learning in ResNets. We leverage this intuition to explain the emergence of a bottleneck structure, as observed in previous work: for large $\tilde{L}$ the potential energy dominates and leads to a separation of timescales, where the representation jumps rapidly from the high dimensional inputs to a low-dimensional representation, move slowly inside the space of low-dimensional representations, before jumping back to the potentially high-dimensional outputs. Inspired by this phenomenon, we train with an adaptive layer step-size to adapt to the separation of timescales.
