Trajectory Geometry of Transformer Representations Across Layers
Not on the map. Why?
Abstract (arXiv)
Understanding how transformer representations evolve across layers, not merely what they encode, remains an open problem in mechanistic interpretability. We recast the transformer forward pass as a discrete population trajectory through a high-dimensional representation manifold, drawing on geometric tools from computational neuroscience. Rather than probing for pre-specified features, we characterize trajectory geometry using five metrics computed directly in the ambient space: trajectory length, curvature, a semantic convergence index, layerwise cosine similarity, and representational stability. Across three model families (GPT-2, TinyLlama, Qwen2.5) and five controlled prompt families, we report four findings. First, semantically related prompts converge significantly in middle-to-late layers (peak CI 0.41--0.58, p<0.001, Mann-Whitney U), consistent with attractor-like dynamics. Second, reasoning tasks produce trajectories of greater curvature than lexical variations (0.71--0.83 rad vs. 0.27--0.31 rad), suggesting curvature encodes computational complexity. Third, ambiguous tokens exhibit trajectory bifurcation with up to 5.6x representational separation by the final layer, absent in unambiguous controls. Fourth, layerwise cosine similarity reveals a universal three-phase structure: encoding, elaboration, and output preparation, consistent across all three architectures. All four effects vanish under shuffled-layer and random-embedding controls. We release a fully open-source, model-agnostic pipeline and argue that trajectory geometry constitutes a principled, probe-free lens for mechanistic interpretability.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 18 of its 37 references that are in the map. First posted on arXiv 8 Jun 2026.
Builds on
18 of 37 references.
References · 18
- 2017Attention Is All You Needcited by 59,932
- 2024Qwen2.5 Technical Reportcited by 4,713
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2018UMAP: Uniform Manifold Approximation and Projection for Dimension Reductioncited by 2,841
- 2022Locating and Editing Factual Associations in GPTcited by 2,609
- 2019Similarity of Neural Network Representations Revisitedcited by 1,695
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,307
- 2016Understanding intermediate layers using linear classifier probescited by 1,279
- 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,046
- 2022In-context Learning and Induction Headscited by 930
- 2022Toy Models of Superpositioncited by 928
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
6 more
- 2020Prevalence of Neural Collapse during the terminal phase of deep learning trainingcited by 713
- 2024TinyLlama: An Open-Source Small Language Modelcited by 604
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 522
- 2024The Platonic Representation Hypothesiscited by 362
- 2018Insights on representational similarity in neural networks with canonical correlationcited by 318
- 2023Linearity of Relation Decoding in Transformer Language Modelscited by 190
Built on by
Not cited yet.