The geometry of hidden representations of large transformer models
Lucrezia Valeriani, Diego Doimo, Francesca Cuturello, Alessandro Laio, Alessio Ansuini, Alberto Cazzaniga
Abstract
Large transformers are powerful architectures used for self-supervised data analysis across various data types, including protein sequences, images, and text. In these models, the semantic structure of the dataset emerges from a sequence of transformations between one representation and the next. We characterize the geometric and statistical properties of these representations and how they change as we move through the layers. By analyzing the intrinsic dimension (ID) and neighbor composition, we find that the representations evolve similarly in transformers trained on protein language tasks and image reconstruction tasks. In the first layers, the data manifold expands, becoming high-dimensional, and then contracts significantly in the intermediate layers. In the last part of the model, the ID remains approximately constant or forms a second shallow peak. We show that the semantic information of the dataset is better expressed at the end of the first peak, and this phenomenon can be observed across many models trained on diverse datasets. Based on our findings, we point out an explicit strategy to identify, without supervision, the layers that maximize semantic content: representations at intermediate layers corresponding to a relative minimum of the ID profile are more suitable for downstream learning tasks.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext a67481d7-5f5a-4906-b953-30b8f0c5d3e0Cited by top-tier papers16
- Intrinsic Dimension Estimation for Robust Detection of AI-Generated TextsEduard Tulchinskii, Kristian Kuznetsov, Laida Kushnareva, Daniil Cherniavskii et al.NeurIPS 2023 · 163 citations
- Large language models implicitly learn to straighten neural sentence trajectories to construct a predictive representation of natural languageEghbal A. Hosseini, Evelina FedorenkoNeurIPS 2023 · 41 citations
- Bridging Information-Theoretic and Geometric Compression in Language ModelsEmily Cheng, Corentin Kervadec, Marco BaroniEMNLP 2023 · 5 citations
- Balanced Data, Imbalanced Spectra: Unveiling Class Disparities with Spectral ImbalanceChiraag Kaushik, Ran Liu, Chi-Heng Lin, Amrit Khera et al.ICML 2024 · 4 citations
- The Narrow Gate: Localized Image-Text Communication in Native Multimodal ModelsAlessandro Serra, Francesco Ortu, Emanuele Panizon, Lucrezia Valeriani et al.NeurIPS 2025 · 4 citations
Builds on7
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Generative Pretraining From PixelsMark Chen, Alec Radford, Rewon Child, Jeffrey Wu et al.ICML 2020 · 1,773 citations
- Language models enable zero-shot prediction of the effects of mutations on protein functionJoshua Meier, Roshan Rao, Robert Verkuil, Jason Liu et al.NeurIPS 2021 · 969 citations
Related papers
- Geometry of Decision Making in Language ModelsAbhinav Joshi, Divyanshu Bhatt, Ashutosh ModiNeurIPS 2025 · 12 citations
- Understanding Scaling Laws with Statistical and Approximation Theory for Transformer Neural Networks on Intrinsically Low-dimensional DataAlexander Havrilla, Wenjing LiaoNeurIPS 2024 · 36 citations
- Geometric Signatures of Compositionality Across a Language Model's LifetimeJin Hwa Lee, Thomas Jiralerspong, Lei Yu, Yoshua Bengio et al.ACL 2025
- Emergence of a High-Dimensional Abstraction Phase in Language TransformersEmily Cheng, Diego Doimo, Corentin Kervadec, Iuri Macocco et al.ICLR 2025 · 1 citation
- Abstraction Induces the Brain Alignment of Language and Speech ModelsEmily Cheng, Aditya Vaidya, Richard AntonelloICML 2026
