用Koopman子空间解码Transformer动力学:LLM逐层隐状态近线性演化
Decoding Transformer Dynamics via Koopman Subspaces
研究将LLM隐状态的逐层演化视为动力系统,用Koopman算子与DMD拟合线性算子,单算子预测下一层状态的相对误差约18%,内部方差解释度约0.99。在57个MMLU科目上,主模态张成的子空间构成主题判别性谱指纹,最近邻纯度0.72、any-hit@3为0.75,分半自检索约0.97。
arXiv:2611.29113v1 Announce Type: new Abstract: We apply Koopman operator theory and Dynamic Mode Decomposition (DMD) to characterise how large language models (LLMs) process different input topics. Treating the layer-to-layer evolution of hidden states as a dynamical system, we fit a linear Koopman operator and take the subspace spanned by its dominant modes as a per-topic spectral fingerprint. Four findings emerge. First, the depth map is near-linear: a single linear operator predicts each next-layer state to within approx. 18% relative error (interior variance explained approx. 0.99). Second, over the 57 MMLU subjects the fingerprint is topic-discriminative, matching the MMLU taxonomy at 0.72 nearest-neighbour purity and each subject's semantic neighbourhood at 0.75 any-hit@3. Third, it is a reproducible signature (split-half self-retrieval approx. 0.97$). Finally, these findings are consistent across seven base models (Qwen2.5 0.5-7B, Llama-3 1-8B), with a suggestive trend of alignment rising with MMLU accuracy. The spectral fingerprint thus provides a probe of how transformers process different topics across depth. Code is available at https://github.com/DeepK/koopman-llm-eacl27.
来源:arXiv (AI + Vision + Imaging) · arxiv.org