For research use only · We delete your sequences and results from our servers within 1 hour of your job finishing · Details
Protein Language Models
6 min read
A protein language model is a computational system that learns the rules of protein sequences by reading millions of them — much the way a person learns grammar by reading millions of sentences. Once trained, the model can evaluate whether a given sequence (or a mutated version of one) looks like something that could plausibly exist and function in nature. NeuroAutomata uses ESM-2, a protein language model developed at Meta AI Research and described by Lin et al. (2023), as the foundation for all its analyses.
What Is a Language Model?
To understand what a protein language model does, start with the simpler version: the text autocomplete on your phone. When you type "thank you for your" and your phone suggests "help," it is not reading a dictionary. It has learned, from enormous amounts of human text, that certain words tend to follow others. It has internalized patterns — grammar, idioms, context — without anyone explicitly teaching it the rules.
A protein language model works the same way, but instead of words in sentences, it processes amino acids in protein sequences. Instead of learning that "help" often follows "your," it learns that a leucine in the middle of a buried helix is almost always surrounded by other hydrophobic residues, that a proline rarely appears in the middle of an alpha-helix, and that positions which contact each other in 3D structure tend to mutate together across species.
In plain terms: A protein language model is autocomplete for amino acid sequences. Feed it a protein with a missing position and it predicts what amino acid most likely belongs there, drawing on patterns learned from hundreds of millions of real proteins.
How ESM-2 Was Trained
ESM-2 was trained using a technique called masked language modeling (MLM). The procedure is straightforward: take a real protein sequence, randomly hide (mask) a fraction of its amino acids, and ask the model to predict what was there. Run this process on ~250 million protein sequences from UniRef — a curated database of sequences from organisms spanning all of life — and the model gradually learns what makes proteins work.
Here is a concrete example. Imagine a short stretch of the enzyme beta-lactamase, which bacteria use to break down penicillin-type antibiotics:
... A L G V L A F F [?] V P G H H W R ...
The [?] represents a masked position. The model must predict the original amino acid from context. In this case, the position is buried in a hydrophobic region, flanked by nonpolar residues. Based on patterns across thousands of related enzymes, the model learns to predict a nonpolar amino acid (like isoleucine or valine) with high confidence — and assigns low probability to charged residues like lysine or aspartate.
In plain terms: During training, the model plays a fill-in-the-blank game across hundreds of millions of protein sequences. Over billions of these "games," it learns which amino acids belong where, and why. No one ever tells it what a hydrophobic core is — it discovers the concept from the data.
What the model learns
Because the model must predict masked positions from their context, it is forced to capture three overlapping signals:
Evolutionary conservation. If the same amino acid appears at a given position across thousands of species, the model learns that position is constrained. This is analogous to what tools like SIFT and PolyPhen-2 extract from sequence alignments — but here it emerges automatically from raw training data, without any explicit alignment step.
Structural preferences. Positions in hydrophobic cores tolerate only nonpolar residues; surface positions accept charged and polar ones; alpha-helices disfavor prolines (which introduce a kink). ESM-2 learns all of these from sequence alone, without ever seeing a protein crystal structure during training. Rives et al. (2021) demonstrated this directly: attention heads in the model learned to focus on residue pairs that are in physical contact in 3D structures — a structural signal that emerged purely from sequence statistics.
Co-evolution. When two positions in a protein interact structurally or functionally, mutations at one position tend to be compensated by mutations at the other across evolution. ESM-2 captures this. Rives et al. (2021) showed that the model's internal attention patterns encode the same pairwise residue contact information that computational biologists previously had to extract from large multiple sequence alignments.
Why this matters: The model's probability scores reflect evolutionary plausibility. A sequence position that the model assigns low probability to is one that evolution has rarely visited — which usually means it would disrupt something important. That intuition is the basis for NeuroAutomata's mutation effect predictions.
Limitation: The model learns from what evolution has explored. Mutations that are deleterious in ways evolution never had reason to select against — or that create a genuinely new function that does not exist in nature — can fall outside the model's reliable range. Gain-of-function mutations, for example, may receive low scores even when they are biologically significant, because the model cannot distinguish "breaks the protein" from "does something novel."
ESM-2 Specifically
ESM-2 is the second-generation protein language model from Meta AI Research, described by Lin et al. in Science (2023). It improves on the original ESM (Rives et al., PNAS, 2021) with architectural refinements — including rotary position embeddings that better handle sequences of varying lengths — and a training procedure scaled to ~250 million sequences.
The result is a model that encodes each amino acid in a sequence as a vector of numbers that captures not just that amino acid's identity, but its role in the broader sequence context: what it contacts, what it constrains, what it enables. Those vectors — called embeddings (numerical representations of biological context) — are the output that NeuroAutomata uses for similarity visualization, clustering, and mutation scoring.
Lin et al. (2023) demonstrated that ESM-2's representations are rich enough to predict 3D protein structure at atomic resolution via a downstream module called ESMFold. The fact that sequence alone — no crystal structure, no experimental data — is sufficient to predict structure is a measure of how much biological information the model has internalized.
Why "Zero-Shot" Matters
Most machine learning tools require labeled training data: examples of mutations that are harmful, examples that are neutral, and so on. Collecting that data for a specific protein is expensive — it requires running a deep mutational scanning experiment, which takes months and significant wet-lab resources.
Zero-shot prediction means the model has not been trained on labeled data for your protein. It has never seen a fitness measurement for your protein of interest. It still produces predictions because it learned general evolutionary principles during pre-training that transfer to any protein.
This is the direct parallel to how a skilled protein engineer with deep domain experience can look at a sequence and have informed intuitions about which mutations are likely to be tolerated — except the model has "read" 250 million sequences instead of the engineer's career of perhaps thousands.
In plain terms: Zero-shot means you can submit any protein sequence — one that has never been studied computationally before — and receive mutation effect predictions immediately. No labeled data, no waiting, no experimental input required.
Limitation: Zero-shot predictions are more reliable for proteins that are well-represented in evolutionary databases (many sequenced homologs across diverse organisms). For newly discovered proteins, recently evolved proteins, or engineered sequences with no natural relatives, prediction accuracy is lower.
Model Variants on NeuroAutomata
NeuroAutomata runs three sizes of ESM-2. They differ in how many parameters (learned numerical weights) they contain, which affects prediction quality and compute time.
| Model | Parameters | Embedding dimension | VRAM (FP16) | When to use |
|---|---|---|---|---|
| ESM-2 35M | 35M | 480 | ~140 MB | Fast screening; rough landscape scans |
| ESM-2 150M | 150M | 640 | ~650 MB | Balanced accuracy and speed |
| ESM-2 650M (legacy) | 650M | 1280 | ~1.3 GB | Well-validated baseline; default until ESMC benchmark clears |
| ESMC 600M | 600M | 1152 | ~1.2 GB | Next-generation ESM architecture (MIT); evaluation in progress |
Parameter count and representation quality are correlated. Lin et al. (2023) measured residue contact prediction precision across ESM-2 variants and found a meaningful gap between the 650M and smaller models — the larger model recovers substantially more true residue-residue contacts. That difference in structural knowledge translates into better mutation predictions.
For most analyses, use the 650M model. The compute cost on NeuroAutomata's GPU is low enough that there is no practical reason to downgrade unless you are running many exploratory scans in rapid succession and want faster turnaround.
Use the 35M or 150M model when speed matters more than precision. If you are doing a preliminary scan across many variants to filter down a candidate list — before committing to a higher-confidence analysis — the smaller models offer faster results with acceptable accuracy for that purpose.
In plain terms: Bigger models have seen more patterns and make better inferences. The 650M model is the default because the accuracy improvement over smaller variants is meaningful, and the compute cost on modern GPU hardware is not the limiting factor.
What a Protein Language Model Cannot Do
Understanding the limits of the tool is as important as understanding its capabilities.
It cannot predict binding affinity directly. The model scores evolutionary plausibility, not binding energy. Mutations at protein-protein or protein-ligand interfaces may score as neutral when they are functionally important for binding — because binding specificity is often under weaker evolutionary conservation pressure than core stability.
It does not model epistasis well. Epistasis (when the combined effect of two mutations differs from the sum of their individual effects) is difficult to capture with standard single-position scoring. ESM-2 masked marginal scoring evaluates one position at a time. Multi-mutation effects that depend on interactions between positions are not reliably captured.
It does not replace experimental measurement. Predictions guide hypothesis generation and help prioritize which variants to test. They are not a substitute for wet-lab validation. The article on benchmarks describes exactly how well the predictions correlate with experimental data — and on which types of proteins the model works best and where it falls short.
Summary
ESM-2 is a protein language model trained on ~250 million sequences using masked language modeling. It learned evolutionary constraints, structural preferences, and coevolutionary patterns entirely from raw sequence data, with no structural or functional labels. That training enables zero-shot predictions on any protein, without requiring labeled data or multiple sequence alignments. NeuroAutomata exposes three ESM-2 variants — 35M, 150M, and 650M — with the 650M model recommended for standard use. The model's outputs underpin every analysis on the platform: embeddings, similarity visualization, and mutation scoring.
References
-
Rives, A., Meier, J., Sercu, T., Goyal, S., Lin, Z., et al. (2021). Biological structure and function emerge from scaling unsupervised learning to 250 million protein sequences. PNAS, 118(15), e2016239118. https://doi.org/10.1073/pnas.2016239118
-
Meier, J., Rao, R., Verkuil, R., Liu, J., Sercu, T., & Rives, A. (2021). Language models enable zero-shot prediction of the effects of mutations on protein function. NeurIPS, 34, 29287–29303. https://doi.org/10.48550/arXiv.2110.07588
-
Lin, Z., Akin, H., Rao, R., Hie, B., Zhu, Z., Lu, W., et al. (2023). Evolutionary-scale prediction of atomic-level protein structure with a language model. Science, 379(6637), 1123–1130. https://doi.org/10.1126/science.ade2574