Abstract
Protein language models (pLMs) transform their input into a sequence of hidden representations whose geometric behavior changes across layers. Looking at fundamental geometric properties such as the intrinsic dimension and the neighbor composition of these representations, we observe that these changes highlight a pattern characterized by three distinct phases. This phenomenon emerges across many models trained on diverse datasets, thus revealing a general computational strategy learned by pLMs to reconstruct missing parts of the data. These analyses show the existence of low-dimensional maps that encode evolutionary and biological properties such as remote homology and structural information. Our geometric approach sets the foundations for future systematic attempts to understand the space of protein sequences with representation learning techniques.
Introduction
Deep learning has fundamentally altered protein biology, with protein language models (pLMs) like ESM and ProtTrans achieving state-of-the-art performance in predicting structure and function. Despite their success, these models remain largely "black boxes." Understanding the internal "computational strategy" used by these Transformers to organize biological data is crucial for decoding the information trapped within their hidden layers. This study investigates how the geometric structure of protein representations evolves as they progress through the network.
Methodology
The researchers analyzed several leading pLMs, including the ESM-2 family and ProtTrans, using two primary geometric metrics:
- Intrinsic Dimension (ID): Estimated using the TwoNN estimator, ID represents the actual number of variables required to describe the data manifold, rather than the nominal embedding dimension.
- Neighborhood Overlap (NO): This measures the stability of a protein's local neighborhood between consecutive layers. High overlap indicates stable representations, while low overlap suggests significant internal rearrangement.
To standardize inputs, global average pooling was applied to generate fixed-length vectors for proteins of varying lengths at each layer. Analysis was conducted on the ProteinNet dataset for ID characterization and the SCOPe (Structural Classification of Proteins) dataset to validate biological relevance.
The Three-Phase Geometric Signature
A universal "three-phase" geometric lifecycle was observed across single-sequence pLMs:
- Phase 1: Peak (PE): The ID expands rapidly. This phase is thought to create "linearly separable" features, spreading data points to identify useful patterns.
- Phase 2: Plateau (PL): The ID collapses to a low-dimensional state (typically 6–7 dimensions). Here, the model distills the most essential biological and evolutionary components.
- Phase 3: Final Ascent (FA): The ID rises again as the model prepares for its specific training task (e.g., predicting masked amino acids), reintroducing task-specific details.
This pattern is remarkably scale-invariant, appearing in models ranging from 8 million to 15 billion parameters. Notably, models trained on Multiple Sequence Alignments (MSAs), such as MSA Transformer, bypass the initial expansion phase, maintaining a low-dimensional state from the outset due to the direct provision of evolutionary information.
Biological Information Distillation
The study reveals that the most accurate biological representations—such as those reflecting remote homology—are found during the Plateau phase. Neighborhood overlap with SCOPe superfamilies peaks at approximately 0.8 during this phase, indicating that the model's internal geometry closely aligns with established biological classifications before the final reconstruction phase begins.
Furthermore, the "reconstruction factor"—the difference in ID between the final and first layers—strongly anti-correlates with model perplexity. Higher-performing models typically exhibit a more pronounced final ascent.
Conclusion
The discovery of a universal three-phase geometric strategy provides a roadmap for interpreting pLMs. It suggests that the most valuable biological insights are often located in the middle layers rather than the final output. Future research may leverage these low-dimensional manifolds to design more efficient, lightweight models that prioritize essential biological information over task-specific noise.
Summary updated