Tranception: protein fitness prediction with autoregressive transformers and inference-time retrieval

Pascal Notin, Mafalda Dias, Jonathan Frazer, Javier Marchena-Hurtado, Aidan N. Gomez, Debora S. Marks, Yarin Gal · DOI

Introduction

Predicting protein fitness—the functional impact of amino acid mutations—is a cornerstone of modern computational biology, with profound implications for drug discovery, variant interpretation in disease, and protein engineering. Historically, the field has been divided between two paradigms: Multiple Sequence Alignment (MSA) models and Large Language Models (LLMs).

MSA-based models rely on evolutionary conservation; if a specific residue has been preserved across millions of years, a mutation at that site is likely deleterious. However, these models suffer from a "scope" problem: they require deep alignments (many similar sequences), struggle with disordered regions, and are typically constrained by fixed coordinate systems that cannot process insertions or deletions (indels). Conversely, protein LLMs trained on massive sequence databases offer greater flexibility but often lack the precise evolutionary context required to outperform specialized MSA models.

Tranception bridges this gap by combining a specialized autoregressive transformer architecture with a retrieval mechanism that incorporates evolutionary "neighbors" at inference time.

The Tranception Architecture

Tranception introduces several architectural innovations designed to capture the unique structural and evolutionary properties of proteins:

1. Tranception Attention

Standard transformers treat amino acids as isolated tokens. Tranception enhances this by splitting its attention heads into four distinct groups. Three of these groups utilize spatial depthwise convolutions with varying kernel sizes (3, 5, and 7). This design forces the model to explicitly attend to "k-mers" (contiguous subsequences), allowing it to capture local patterns and motifs more effectively than standard global attention alone.

2. Grouped ALiBi

Instead of traditional absolute or relative position encodings, the model employs Grouped ALiBi (Attention with Linear Biases). This method applies a bias term proportional to the distance between tokens, enabling different heads to specialize in different sequence ranges. This is particularly useful for proteins, where both local secondary structures and long-range tertiary interactions are critical for function.

Hybrid Inference: Combining LLMs with Evolution

The most significant innovation of Tranception is its Inference-Time Retrieval mechanism. Rather than relying solely on the patterns learned during its pre-training on UniRef100 (a database of ~250 million sequences), Tranception retrieves an MSA for the specific target protein at test time.

The final fitness score is a weighted blend of two components:

  1. The Autoregressive Score: The probability distribution predicted by the transformer based on the sequence context.
  2. The Retrieval Score: The actual distribution of amino acids observed in nature at that specific position within the retrieved MSA.

This hybrid approach allows the model to benefit from specific evolutionary data when available, while the autoregressive transformer provides a robust "prior" that can handle regions where the alignment is sparse or non-existent.

ProteinGym: A New Standard for Evaluation

To rigorously test Tranception, the authors introduced ProteinGym, a comprehensive benchmark that significantly expands upon previous datasets like DeepSequence. ProteinGym includes:

  • Substitution Benchmark: 87 assays covering approximately 1.5 million missense variants.
  • Indel Benchmark: 7 assays covering approximately 300,000 mutants involving insertions and deletions.
  • Diversity: The benchmark spans various taxa, including humans, viruses, prokaryotes, and eukaryotes.

Key Results and Insights

State-of-the-Art Performance

Tranception (with retrieval) achieved the highest overall Spearman correlation on both the ProteinGym substitution benchmark (0.451) and the indel benchmark (0.463). It showed particularly strong performance on human proteins and viruses, even outperforming models like EVE that were specifically designed for human clinical variants.

Robustness to "Shallow" Data

A critical advantage of Tranception is its performance in data-scarce scenarios. Traditional models like EVE or MSA Transformer often see a significant drop in accuracy when the available MSA is "shallow" (contains few sequences). Tranception maintains high performance in these cases, as the autoregressive transformer compensates for the lack of evolutionary neighbors.

Scoring Indels and Multiple Mutants

Because Tranception is autoregressive—predicting the next token in a sequence—it can naturally score sequences of varying lengths. This allows it to process insertions and deletions that "coordinate-fixed" models cannot. Furthermore, the performance gap between Tranception and competing models widens as the number of mutations increases, suggesting a superior ability to extrapolate further away from the wild-type sequence.

Limitations and Future Directions

While Tranception represents a significant leap forward, it faces certain challenges. The requirement for MSA retrieval and the autoregressive nature of the model make inference slower than simple masked language models. Additionally, while ProteinGym is a major advancement, the authors note that experimental data remains biased toward single-site mutations; future work will need to focus on complex, multi-site mutants to further refine protein engineering capabilities. Finally, scaling the model beyond its current 700M parameters and training on even more diverse datasets remains a promising avenue for future performance gains.

Summary updated

BibTeX
@inproceedings{notin2022tranception,
  author = {Pascal Notin and Mafalda Dias and Jonathan Frazer and Javier Marchena-Hurtado and Aidan N. Gomez and Debora S. Marks and Yarin Gal},
  title = {{Tranception: protein fitness prediction with autoregressive transformers and inference-time retrieval}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=lkb6Ofm7aEq},
}
Figure