Interpreting Latent Protein Language Model Features with Geometric Annotations
Organizations: School of Mathematics University of Edinburgh, UK
Abstract
Protein language models (pLMs) encode information about protein sequences which enable downstream tasks such as structure prediction, but their internal representations are not well understood. Sparse autoencoders (SAEs) provide a promising tool to disentangle latent pLM representations into interpretable features, but existing annotation pipelines largely rely on protein-level annotations derived from database labels and LLM annotations of top activating sequences. Such annotations can overlook the localized residue-level and geometric patterns encoded by sparse features. We introduce an automated and scalable method for interpreting SAE features in ESM-2 by using geometrically inspired features of the protein backbone. Across ESM-2 8M layers, an FDR-controlled discovery analysis shows that local geometry is significantly associated with many SAE features, with varying levels of predictive strength, expanding coverage beyond database and sequence-based methods. In particular, geometry can distinguish SAE features sharing the same database annotation, revealing substructure within known biological labels. A significant portion of SAE features activate on unannotated metagenomic protein sequences enabling us to use our SAE annotations to better understand these sequences. In addition, ablation experiments at the level of contact prediction show that removing found geometric features shifts ESM-2's predicted contact maps in the direction of the descriptor. This provides a robust method of annotating proteins activated within SAE neurons at a residue level, providing a bridge between mechanistic interpretability and structural biology.
Figures & tables
| % Total annotated | % InterPro Prot. | % InterPro Res. | % Seq Pos | % Seq Motif | % Geometric | |
| Layer 2 | 86.53 | 56.11 | 42.03 | 62.22 | 69.33 | 84.38 |
| Layer 4 | 93.50 | 56.75 | 61.46 | 79.19 | 77.56 | 92.79 |
| Layer 6 | 94.57 | 56.68 | 67.70 | 71.35 | 77.20 | 94.49 |
| PR-AUC 0.0-0.3 | PR-AUC 0.3-0.6 | PR-AUC | |
| Layer 2 | 95.15 | 3.27 | 1.58 |
| Layer 4 | 81.72 | 12.24 | 6.05 |
| Layer 6 | 91.86 | 6.51 | 1.63 |
| No. InterPro Res families | % Geom Distinguishable | |
|---|---|---|
| Layer 2 | 120 | 59.17 |
| Layer 4 | 578 | 77.51 |
| Layer 6 | 45 | 68.89 |
| % NMPFam act. | % geom. -sig. | % feat. med. PR-AUC 0.5 | NMPFams matched | Sequences annotated | |
|---|---|---|---|---|---|
| Layer 2 | 63.55 | 91.72 | 1.65% (169) | 4.74% (2,369) | 4.40% (440,475) |
| Layer 4 | 77.78 | 93.50 | 3.67% (376) | 7.75% (3,875) | 7.58% (757,802) |
| Layer 6 | 90.95 | 96.18 | 4.10% (420) | 16.22% (8,108) | 15.88% (1,588,446) |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Distribution | Range / values | Notes |
| Learning rate | log-uniform | Adam initial LR | |
| L1 coefficient | log-uniform | full strength after warmup | |
| Dictionary size | categorical | 8 , 16 , 32 , 64 | |
| Batch size | categorical | residue tokens / step | |
| Warmup ratio | uniform | of 500 000 total steps | |
| Decay-start ratio | uniform | of 500 000 total steps |
| Layer 2 | Layer 4 | Layer 6 | |
| Architecture | |||
| Activation dim | 320 | 320 | 320 |
| Dictionary size | 10 240 | 10 240 | 10 240 |
| Expansion factor | 32 | 32 | 32 |
| Optimisation | |||
| Batch size | 4 096 | 2 048 | 1 024 |
| Hyperparameter | Value |
|---|---|
| Number of estimators | 80 |
| Maximum tree depth | 3 |
| Learning rate | 0.1 |
| Subsample ratio | 0.8 |
| Minimum samples per leaf |
| Predicate name | Position condition | Description |
|---|---|---|
| first_5 | pos < 5 | First 5 residues (0–4). |
| first_10 | pos < 10 | First 10 residues (0–9). |
| first_20 | pos < 20 | First 20 residues (0–19); typical signal-peptide window. |
| last_5 | pos >= slen - 5 | Last 5 residues. |
| last_10 | pos >= slen - 10 | Last 10 residues. |
| last_20 | pos >= slen - 20 | Last 20 residues. |
| % Total annotated | % InterPro Prot. | % InterPro Res. | % Seq Pos | % Seq Motif | % Geometric | |
| Layer 6 | 92.99 | 65.68 | 64.28 | 81.52 | 70.08 | 92.92 |
| PR-AUC 0.0-0.3 | PR-AUC 0.3-0.6 | PR-AUC | |
|---|---|---|---|
| Layer 6 | 63.20 | 26.30 | 10.50 |
| Protein | PDB | RMSD (Å) | Feature ID | nPos | PR-AUC (AF) | PR-AUC (crystal) |
| P75804 | 2g8s | 0.13 | 1498 | 182 | 0.974 | 0.965 |
| Q46927 | 4d79 | 0.43 | 6894 | 17 | 0.703 | 0.699 |
| P0AC98 | 5zug | 0.30 | 7257 | 16 | 0.725 | 0.694 |
| Q47208 | 3dmy | 0.44 | 2231 | 50 | 0.492 | 0.500 |
| P0ADR8 | 9hs1 | 1.51 | 2231 | 28 | 0.488 | 0.516 |
| P0ABE5 | 5oc0 | 0.44 | 6603 | 39 | 0.987 | 0.960 |
Mechanistic Interpretability
Mechanistic interpretability studies how neural networks implement behaviors through internal features, circuits, and causal information flow.
See all 391 papers