Mechanisms of AI Protein Folding in ESMFold

Kevin Lu, Jannik Brinkmann, Stefan T. Huber, Aaron Mueller, Yonatan Belinkov, David Bau, Chris WendlerGEM @ ICLR 2026

TL;DR

This paper dives deep into the "black box" of AI protein folding models like ESMFold, revealing a consistent two-stage process for how they predict protein structures. They found that early stages focus on biochemical signals from the amino acid sequence, while later stages build up spatial information about distances and contacts, demonstrating that these models learn interpretable, causal mechanisms for protein folding.

What Problem Does This Paper Address?

While AI models like AlphaFold2 have achieved remarkable success in predicting protein structures, the underlying mechanisms of how they achieve this remain largely mysterious. We don't fully understand what physical principles or biochemical information these models have learned about the complex process of protein folding. This paper aims to demystify this by investigating the internal computations of AI protein folding models, specifically focusing on how they represent and process information to fold proteins. They want to understand if these models have learned interpretable, physically relevant representations of the folding process.

Methods

The researchers employed a combination of techniques to probe the internal workings of AI protein folding models (ESMFold, OpenFold, and Boltz-1):

  • Activation Patching: This is a core technique where they "patch" representations from a donor protein (e.g., one with a beta hairpin) into a target protein's computation. By observing the output, they can infer which parts of the model are responsible for specific structural features.
  • Representation Steering: They manipulated specific learned representations (like charge or distance) to see if they could causally influence the predicted protein structure. This is akin to "nudging" the model in a specific direction to see if it leads to a predictable outcome.
  • Linear Probing: They trained simple linear models to predict specific biochemical or geometric features from the internal representations. This helps determine if these features are linearly encoded and thus easily accessible.
  • Cross-Model Alignment (CKA and Procrustes Analysis): To understand if different models learn similar internal representations, they compared the pairwise representations of different models to see how well they align.

Datasets

The study utilized several datasets:

  • PDB (Protein Data Bank): This is a large archive of experimentally determined protein structures, used for selecting donor and target proteins for patching experiments, as well as for training and evaluating models.
  • DSSP (Dictionary of Protein Secondary Structure): Used to assign secondary structure (like helices and beta strands) to predicted protein structures for evaluation.
  • CATH (Class, Architecture, Topology, Homologous superfamily): Used to construct a dataset of all-alpha proteins for representation analysis.
  • Curated motif datasets: Used for selecting beta-hairpin proteins.

Key Insights and Ideas

  • Two-Stage Folding Process: The most significant finding is the consistent identification of a two-stage computational process within the folding "trunk" of these AI models, regardless of their specific architecture.
  • Stage 1 (Early Blocks): Biochemical Signals: Early in the folding process, the models focus on translating biochemical information from the amino acid sequence (like residue charge) into pairwise representations. This stage is crucial for initializing the folding decision.
  • Stage 2 (Late Blocks): Spatial Geometry: Later stages build upon this biochemical foundation by accumulating spatial information, such as residue-residue distances and contacts, which are critical for forming the final 3D structure.
  • Causal Mechanisms: The interventions (patching and steering) demonstrate that these learned representations are not just correlational but causally operative. Manipulating charge can induce hairpins, and manipulating distance information also influences folding. This suggests the models are learning something akin to physical principles.
  • Interchangeable Representations: Pairwise representations from different models can be linearly aligned and even substituted for each other. This implies that despite architectural differences, these models converge on a shared representational organization for mapping sequence chemistry to spatial geometry, particularly in the later stages.
  • Charge is Linearly Encoded: The models linearly encode charge information, making it easily manipulable through steering. This is a key biochemical feature that influences folding.
  • Distance is Linearly Encoded in Late Stages: In the later stages, pairwise representations linearly encode distance information, which is then read by the structure module to generate 3D coordinates.

Key Results

  • Hairpin Formation: Activation patching successfully induced beta-hairpin formation in approximately 40% of cases when applied to the folding trunk.
  • Stage-Specific Effectiveness: Sequence patching was effective in early blocks (0-7), while pairwise patching became effective in later blocks (starting around block 25).
  • Charge Steering: Steering charge direction induced hairpin formation in all three models, with effects concentrated in early blocks.
  • Distance Steering: Steering distance information also induced hairpin formation, with peak effectiveness in middle-to-late blocks.
  • Representation Alignment: Centered Kernel Alignment (CKA) showed high similarity between pairwise representations of different models in middle and late blocks, indicating a shared representational geometry.
  • Cross-Model Patching: Patching representations from one model into another successfully reproduced the late-block pairwise window, demonstrating functional interchangeability.

Limitations and Future Work

  • Limited Structural Motifs: The study primarily focused on relatively local motifs like beta-hairpins and alpha-helices (12-25 residues). It remains to be tested whether this two-stage structure extends to larger motifs or long-range domain contacts, which might require different mechanisms.
  • Pairwise-Representation-Free Architectures: The analysis applies to models with iterative sequence/pairwise trunks. Architectures like SimpleFold, which predict structure without an explicit pairwise representation, might implement analogous computations in different ways, posing an open question.
  • Physical Viability of Counterfactual Structures: While interventions can induce desired structures, the resulting proteins often have low PLDDT scores, and inverse folding struggles to recover viable sequences. Interventions can also lead to unrealistic structures with steric clashes.
  • Future Directions:
    • Probing Conditional Protein Behavior: The linear encoding of charge suggests a path to probe how models predict protein behavior under different conditions (e.g., varying pH), potentially accessing dynamics not explicitly trained for.
  • Extending to Larger Motifs: Investigating whether the two-stage mechanism applies to larger structural elements and full protein folds.
  • Understanding Pairwise-Representation-Free Models: Exploring how models that don't explicitly use pairwise representations achieve similar folding goals.

Summary updated

BibTeX
@inproceedings{lu2026mechanisms,
  author = {Kevin Lu and Jannik Brinkmann and Stefan T. Huber and Aaron Mueller and Yonatan Belinkov and David Bau and Chris Wendler},
  title = {{Mechanisms of AI Protein Folding in ESMFold}},
  booktitle = {GEM @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=6IjPacqASB},
}
Figure