Protein Language Models: When NLP Methods Read Amino Acids

A protein is a string written in an alphabet of twenty amino acids, and that is all a language model needs. Since 2019, research groups have trained the same architectures that power NLP on hundreds of millions of protein sequences, with results that surprised even their authors: models that never saw a 3D structure learned enough about folding to predict one. This guide explains what these models do, how they are trained, and why "language" is a useful but imperfect metaphor.
From sentences to sequences
A protein sequence looks like this: MVLSEGEWQLVLHVWAKVEAD…, the beginning of sperm-whale myoglobin, the protein whose structure John Kendrew's team solved in the late 1950s. Each letter stands for one of twenty standard amino acids, the order is fixed by the gene, and the chain folds into a shape that determines what the protein does. The analogy with text is direct enough to be useful:
- Tokens. Most protein language models use one token per amino acid. There is no need for the subword algorithms described in our guide to how tokenization works: the vocabulary is about twenty-five letters for the standard, rare and ambiguous residues, plus a handful of special tokens.
- Context. As in a sentence, the meaning of a position depends on its neighbours, sometimes hundreds of positions away, because residues far apart in the chain end up side by side once it folds.
- Corpus. The "text" is the protein sequence databases. UniProt groups near-identical sequences into clusters called UniRef, which most models use to avoid over-training on families that biologists happened to sequence many times.
How they are trained
The dominant recipe is the masked-token objective introduced for text by BERT: hide some residues, ask the model to predict them from the rest. To succeed, the model has to learn which amino acids can replace each other, which positions are conserved across a family, and which pairs of positions change together. That last signal is the important one, because positions that co-vary across evolution are often in contact in the folded structure.
Two families of models made the approach mainstream:
- ESM (Evolutionary Scale Modeling), from Meta AI's research team. The 2021 PNAS paper by Rives and colleagues trained a transformer on 86 billion amino acids across 250 million protein sequences, and showed that information about secondary and tertiary structure could be read from its internal representations with simple linear probes (Rives et al., 2021).
- ProtTrans, from the Technical University of Munich and partners, trained several text architectures side by side (BERT, ALBERT, ELECTRA, T5, Transformer-XL, XLNet) on UniRef and the BFD database, which together contain up to 393 billion amino acids, and found that the ProtT5 embeddings beat the previous state of the art on per-residue prediction without any evolutionary alignment (Elnaggar et al., ProtTrans).
Autoregressive models, which predict the next residue the way GPT predicts the next word, are used mainly when the goal is to generate new sequences rather than analyse existing ones.
What they learn without being told
The striking result of this line of work is emergence with scale. In the ESM-2 paper published in Science in 2023, the authors report that as models are scaled up to 15 billion parameters, an atomic-resolution picture of protein structure emerges in the learned representations (Lin et al., 2023). Plugging a structure module on top of ESM-2 gave ESMFold, which predicts a structure from a single sequence an order of magnitude faster than methods that first search for related sequences. The team used it to build the ESM Metagenomic Atlas, with structures predicted for more than 617 million metagenomic proteins, over 225 million of them with high confidence.
This is where the comparison with AlphaFold 2 matters. AlphaFold, described in Nature in 2021, reached accuracy competitive with experiment by combining deep learning with multiple sequence alignments, the slow search for evolutionary relatives. Protein language models compress that evolutionary information into their weights during training, which is why they can skip the search at prediction time, at some cost in accuracy on proteins with few known relatives.
What they are used for
- Embeddings as features. The most common use is the least spectacular: turn each protein into a vector, then train a small classifier for a property such as where in the cell the protein goes, whether it binds a metal, or whether it is likely to be soluble. ProtTrans reported a ten-class accuracy of 81% for subcellular localisation with this approach.
- Variant effect prediction. Because the model assigns a probability to each amino acid at each position, it can score how surprising a mutation is. Researchers use these scores to prioritise genetic variants of unknown significance, alongside clinical evidence, never instead of it.
- Fast structure prediction for very large collections, as with the metagenomic atlas.
- Protein design. Generative models propose new sequences with desired properties. In 2025 the ESM3 paper in Science described a fluorescent protein generated by the model at 58% sequence identity to the closest known fluorescent protein, which the authors estimate is equivalent to simulating 500 million years of evolution (Hayes et al., 2025). Claims of this kind are new and debated; independent replication is still limited.
Where the metaphor breaks
Calling proteins a "language" helps explain the method, but the differences are as instructive as the similarities.
- No speaker, no meaning in the human sense. Sequences are shaped by physics and natural selection, not by communication. A model's "understanding" is a statistical summary of what evolution has allowed.
- Biased corpora. Sequence databases over-represent organisms that are easy to sequence or medically important, exactly as web corpora over-represent a few languages; the problem is familiar to anyone who has read about low-resource languages.
- Evaluation leakage. Test proteins can have close relatives in the training set, which inflates scores in the same way as the benchmark contamination that affects text models. Good papers split data by sequence similarity, not at random.
- Predictions are hypotheses. A predicted structure or a "functional" generated sequence is a starting point for laboratory work, not a result.
Getting started
For readers coming from NLP, the entry cost is low. Pretrained ESM and ProtTrans checkpoints are distributed through the usual model hubs and load with the same libraries as text models; a few lines of code turn a FASTA file into embeddings. The biology is the hard part: before drawing conclusions, read how the training and test sets were split, and talk to someone who knows the protein family. For the wider picture of where language-model research is heading, see our NLP trends 2026 barometer.
Sources
- Rives A. et al. (2021), "Biological structure and function emerge from scaling unsupervised learning to 250 million protein sequences", PNAS 118(15), open access on PubMed Central.
- Elnaggar A. et al. (2021), "ProtTrans: Towards Cracking the Language of Life's Code Through Self-Supervised Deep Learning and High Performance Computing", IEEE TPAMI, arXiv:2007.06225.
- Lin Z. et al. (2023), "Evolutionary-scale prediction of atomic-level protein structure with a language model", Science 379, doi:10.1126/science.ade2574.
- Hayes T. et al. (2025), "Simulating 500 million years of evolution with a language model", Science, doi:10.1126/science.ads0018.
- Jumper J. et al. (2021), "Highly accurate protein structure prediction with AlphaFold", Nature 596.
- UniProt Consortium, UniRef: UniProt Reference Clusters.