[Paper Review] The geometry of hidden representations of large transformer models
The paper analyzes how intrinsic dimension and neighbor structure evolve across layers in large self-supervised transformers for proteins and images, showing a three-phase (and sometimes four-phase) ID trajectory where intermediate layers encode the most semantic content and can be identified unsupervisedly via ID minima.
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.
Motivation & Objective
- Understand how geometric properties of hidden representations (intrinsic dimension and neighbor composition) evolve through layers in large self-supervised transformers.
- Compare geometry across protein language models and image transformers to identify common patterns.
- Propose an unsupervised strategy to locate layers with maximal semantic content for downstream tasks.
Proposed method
- Estimate intrinsic dimension (ID) of layer representations using the TwoNN estimator on nearest-neighbor distances.
- Measure neighborhood overlap chi_k^{l,m} to quantify changes in local neighbor structure between layers.
- Compute chi_k^{l,gt} to assess alignment with ground-truth semantic labels (e.g., remote homology, ImageNet classes).
- Extract intermediate-layer representations from ESM-2 protein language models and iGPT image transformers for analysis.
- Analyze ID and neighborhood metrics across model sizes, tasks, and datasets (ProteinNet, SCOPe, ImageNet).
- Perform unsupervised identification of semantically rich layers via local minima in the ID profile.

Experimental results
Research questions
- RQ1How does the intrinsic dimension of representations change across layers in large transformers trained with self-supervision?
- RQ2Do ID and neighbor structure show consistent phases across protein language models and image transformers?
- RQ3Can an unsupervised metric identify layers that maximize semantic content for downstream tasks?
- RQ4How does semantic information (remote homology, image class labels) relate to the ID profile and layer position?
- RQ5What are the differences in ID dynamics between pLMs and iGPTs, and how do model size and task affect them?
Key findings
- ID profiles in large transformers show three phases (peak, plateau, final ascent) for pLMs and a fourth phase (second peak) for iGPTs.
- The ID peak occurs early; the plateau shows low ID and stable neighborhood structure, indicating semantically meaningful representations.
- Semantic information (remote homology for proteins; ImageNet labels for images) is best expressed in the plateau region where ID is low, or around a relative minimum of the ID profile.
- The overlap with ground-truth classes chi_k^{l,gt} peaks in the plateau (or near the ID minimum in iGPTs), suggesting semicontent concentration during encoding.
- An unsupervised strategy based on the ID profile can identify layers most suitable for downstream learning tasks.
- In iGPTs, a second, shallower ID peak near the end mirrors the first, indicating a symmetric autoencoder-like behavior in decoding phases.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.