Dynamics of the Transformer Residual Stream: Coupling Spectral Geometry to Network Topology

TL;DR

Full Jacobian eigendecomposition reveals spectral evolution from non-normal to symmetric layers, with training inducing low-rank bottlenecks and topology-spectral coupling.

cs.LG 🔴 Advanced 2026-05-14 49 views
Jesseba Fernando Grigori Guitchounts
deep learning transformer spectral geometry network topology dynamical systems

Key Findings

Methodology

This study performs exact Jacobian eigendecomposition across three large-scale transformers (Llama 3.1 8B, OLMo 3 7B, Gemma 4 E4B). Each layer’s Jacobian is computed sample-wise, followed by Schur decomposition to separate spectrum and non-normality. Spectral properties such as eigenvalue distribution, complex conjugate pairs, and non-normality metrics are analyzed to reveal depth-dependent spectral gradients. Community detection on activation graphs links topology to spectral dynamics, establishing how perturbations propagate and are compressed through the network. The analysis distinguishes architecture-driven features from training-induced effects by comparing trained models with their initial random states.

Key Results

  • The eigenvalues of the mean Jacobian predominantly form conjugate pairs (~98%), indicating spiral-like rotation-stretch modes. Across depth, the Jacobian transitions from rotation-dominated (early layers) to near-symmetric (late layers), with a monotonic increase in operator symmetry. The condition number decreases mid-depth, then re-expands, reflecting spectral shifts. The cumulative Jacobian product shows a dramatic reduction in effective rank from hundreds to fewer than ten, indicating a learned low-rank bottleneck that constrains end-to-end perturbation propagation.
  • Removing non-normality via Schur decomposition reveals that the bottleneck largely results from trained off-diagonal upper-triangular components, not the eigenvalues themselves. The spectral radius remains expanding at all layers, but the non-normal structure controls the effective dimensionality. Community analysis shows that units bridging multiple communities (boundary nodes) are selectively amplified or suppressed depending on their topological position, with the sign of coupling governed by local operator type. These effects emerge gradually during training, linking spectral geometry to functional topology.
  • The spectral evolution and topological coupling are consistent across models and checkpoints, indicating a robust, learned spectral geometry. The results suggest that training induces a systematic reorganization of the residual stream’s spectral and topological properties, which in turn shapes the model’s capacity for perturbation control, information compression, and robustness.

Significance

This work provides a comprehensive spectral geometric map of trained large language models, connecting eigenvalue distributions, non-normality, and network topology. It advances understanding of how training sculpts the internal dynamical landscape, revealing mechanisms behind information compression and perturbation control. The insights have implications for model interpretability, robustness, and design, offering pathways to optimize spectral properties for stability and efficiency. By linking spectral geometry to network topology, the study opens new avenues for principled model analysis and engineering, addressing long-standing questions about the internal dynamics of deep neural networks.

Technical Contribution

The paper introduces a full eigendecomposition framework for large-scale Jacobians, combined with Schur decomposition to disentangle spectral and non-normal contributions. It develops depth-wise spectral metrics, such as eigenvalue distribution, condition number, and complex conjugate pairs analysis, to characterize the evolution of spectral geometry. The integration of community detection on activation graphs with spectral analysis establishes a novel link between network topology and spectral properties, revealing how training shapes the residual stream’s dynamical landscape. These methodological innovations enable a detailed, quantitative understanding of perturbation propagation and compression in deep models.

Novelty

This is the first comprehensive spectral analysis of trained, production-scale transformers, revealing a systematic depth-dependent spectral gradient and low-rank bottleneck formation. Unlike prior work limited to initializations or approximate linearizations, this study directly computes the full Jacobian eigenspectrum, uncovering the emergent non-normality and its role in information flow. The coupling between network topology and spectral dynamics, especially the role of community boundaries in perturbation amplification, is a novel insight that bridges spectral geometry and functional organization, offering a new paradigm for understanding deep neural dynamics.

Limitations

  • The analysis relies on linear approximations via Jacobians, which may overlook complex nonlinear interactions during actual inference, potentially limiting the scope of dynamic predictions.
  • The study focuses on a limited set of architectures and datasets, requiring validation across broader model types and tasks to establish universality.
  • Computational costs of full eigendecomposition and community detection are high, restricting scalability to larger models or real-time applications. Future work should optimize algorithms for efficiency.

Future Work

Future directions include extending spectral analysis to nonlinear regimes, integrating with dynamical systems models to capture transient behaviors, and exploring how spectral properties influence training stability and generalization. Additionally, leveraging spectral and topological insights to guide model pruning, robustness enhancement, and architecture design could lead to more efficient and interpretable models.

AI Executive Summary

Deep Dive

Plain Language Accessible to non-experts

想象你在一个大型工厂里,每个生产环节都像神经网络中的一层。每个环节都在处理原材料(信息)并传递给下一环。刚开始时,工厂的流程像旋转的螺旋,信息在不同环节中不断旋转、扭曲。经过训练后,流程变得更有序,有些环节像镜子,只反映信息,不改变。工厂内部的不同区域形成了社区,有些区域紧密合作,有些像桥梁连接不同社区。研究发现,训练让工厂的流程变得更有秩序,信息流受到限制,但效率更高。不同的环节位置会影响信息的放大或抑制,就像某些工序能让产品更好,而其他工序会抑制瑕疵。这个过程就像工厂不断优化生产线,让产品更快、更稳定、更可靠。

ELI14 Explained like you're 14

想象你在学校里,每个班级就像神经网络的一层。每个学生代表一个信息点,老师(模型)在每节课上都在调整学生们的学习方式。刚开始,学生们的学习方法很乱,像旋转一样不断变化,但经过一段时间的训练,老师让他们变得更有序,有的学生变成了“镜子”,只反映信息而不改变。班级之间也形成了不同的“社区”,有些班级关系紧密,有些像桥梁连接不同的班级。研究发现,训练让学校的学习变得更有秩序,信息在班级间的流动变得有限,但效率更高。不同班级的位置会影响信息的放大或抑制,就像某些班级会让学习效果变好,而其他的会抑制瑕疵。这个过程就像学校不断优化教学方法,让学习变得更快、更稳定、更可靠。

Abstract

Large language models are remarkably capable, yet how computation propagates through their layers remains poorly understood. A growing line of work treats depth as discrete time and the residual stream as a dynamical system, where each layer's nonlinear update has a local linear description. However, previous analyses have relied on scalar summaries or approximate linearizations, leaving the full spectral geometry of trained LLMs unknown. We perform full Jacobian eigendecomposition across three production--scale LLMs and show that training installs a monotonic spectral gradient through depth -- from non-normal, rotation-dominated early layers to near--symmetric late layers -- together with a cumulative low-rank bottleneck that funnels perturbations into a small fraction of the residual stream's effective dimensions. Our experiments reveal that this gradient and the dimensional collapse are learned rather than architectural, and is largely dissolved when structured non-normality is removed. We further show that the topological positioning of graph communities predicts whether the Jacobian amplifies or suppresses them, with the sign of the coupling determined by the local operator type, a relationship absent at initialization. These results map a learned spectral geometry in LLMs that links perturbation propagation and compression to the network's functional topology.

cs.LG cs.AI