Determining the similarity between complex dynamical systems—such as recurrent neural networks (RNNs), Large Language Models (LLMs), and the human brain—is a notoriously difficult challenge. In fields like neuroscience or AI, researchers often need to know if two different networks (e.g., a GRU and an LSTM) are internally "doing the same thing."
Existing methods generally fall into two traps:
- Representation-based metrics (like Centered Kernel Alignment or Procrustes) focus on the geometry of the data. However, two systems can have identical internal structures but produce different behaviors, or vice versa. They often fail to capture the "flow" of time.
- Dynamics-based metrics (like HAVOK) try to model the underlying math but struggle with "spectral pollution"—mathematical artifacts and noise that arise when trying to approximate infinite-dimensional operators with finite data. Furthermore, they often fail when a system operates across multiple timescales (e.g., fast neural spiking vs. slow cognitive shifts).
To address these limitations, researchers introduce KoopSTD (Koopman Spectrum with Timescale Decoupling), a robust, coordinate-invariant metric that captures the essence of a system's behavior even when its physical representations look vastly different.
The KoopSTD Methodology
The KoopSTD framework operates through a four-stage pipeline designed to isolate true underlying dynamics from noise and artifacts:
- Timescale Decoupling: Instead of analyzing raw time-series data, the pipeline uses a Short-Time Fourier Transform (STFT). This decomposes the signal into different frequency components, allowing the model to capture both fast and slow dynamics simultaneously.
- Koopman Approximation: Dynamic Mode Decomposition (DMD) is used to find a linear operator that approximates the nonlinear system. In Koopman theory, a nonlinear system can be represented as a linear one by moving to a high-dimensional space of "observables."
- Spectral Residual Control: Using the Galerkin method, the authors calculate a "residual" (an error score) for every captured dynamical mode. They filter out "spurious" modes—likely noise or mathematical artifacts—leaving only the true underlying dynamics.
- Wasserstein Distance: Finally, the "cleaned" spectra of two systems are compared using the Wasserstein distance, providing a single scalar that represents their dynamical similarity.
Crucially, KoopSTD is mathematically proven to be invariant to isotropic scaling, rotation, and permutation. This ensures the metric remains robust even if the compared systems use entirely different coordinate systems or units.
Experimental Validation and Key Results
The authors validated KoopSTD across a diverse range of physical and neural systems, including synthetic chaotic data (the Lorenz system), perceptual decision-making models, artificial RNNs, fMRI recordings from the human auditory cortex, and hidden representations from LLMs (GPT-2 and LLaMA families).
Superior Clustering and Robustness
On the chaotic Lorenz system, KoopSTD vastly outperformed previous state-of-the-art metrics. It achieved a Silhouette coefficient of 0.94, compared to HAVOK (0.47) and representation metrics like CKA (-0.05).
Furthermore, in a "Geometric Homogeneity" test—where different attractors were optimized to look geometrically identical—KoopSTD maintained a near-perfect clustering score (0.99), while Procrustes analysis failed completely (-0.02). KoopSTD also successfully identified that Vanilla RNNs, LSTMs, and GRUs share the same underlying computational dynamics when solving the same task, despite differing internal gates.
Key Insights in AI and Neuroscience
- A New Perspective on LLM Scaling: The paper suggests a dynamical "scaling law" for LLMs. As models grow larger, their internal dynamics become significantly more coherent and stable across different instructions. Smaller models exhibit "messier" internal trajectories, while larger models converge on a consistent dynamical language.
- Brain Structure-Function Coupling: Applied to the human auditory cortex, KoopSTD revealed a functional hierarchy matching known biological myelin density. This implies that the speed and complexity of neural dynamics are physically hardcoded into the brain's insulation.
Limitations and Future Directions
While highly effective, KoopSTD's use of the Galerkin method for residual control adds computational complexity that may be taxing for extremely high-dimensional systems. Additionally, the choice of "observables" for lifting data into higher dimensions remains a classic challenge in Koopman theory.
Looking forward, the authors suggest KoopSTD could revolutionize knowledge distillation. By using this metric, smaller "student" models could be trained to mimic the stable internal dynamics of "teacher" models, rather than merely copying their final outputs, potentially leading to more robust and capable efficient AI systems.
Summary updated