A general framework for modelling realistic protein evolution in time

Wait 5 sec.

MainModels of protein evolution describe how protein sequences evolve over time under mutation and various selective pressures. These models are at the core of most applications in evolutionary biology, and act as the engine that powers a variety of phylogenetic methods1,2,3,4,5,6,7. Classical models of protein evolution date back to Margaret Dayhoff8, and further refinements of her seminal work have proceeded in lockstep with ever-increasing data in sequencing databases9,10,11. These methods typically use continuous-time Markov chains (CTMCs) to model protein evolution. A CTMC is parametrized by a rate matrix (frequently denoted by Q) that describes the relative mutation rates and transition probabilities of different amino acids as a function of evolutionary time. Until now, the models of protein evolution used most widely are the WAG10 and LG11 models, both parametrized by a rate matrix Q that is learned using maximum likelihood methods. The LG model generalizes WAG by adding the notion of site-rate variation, in which different sites are allowed to evolve with different overall rates, providing a means to deal with different patterns of conservation across sequences.Although successful, these classical models come with two important shortcomings: they require sequences to be pre-aligned with gap characters (‘–’) to ensure equal length, and they assume that each site evolves independently of all other sites. Although alignment errors can lead to incorrect inference of evolutionary patterns and the independent-sites assumption is biologically unrealistic, these simplifications have remained standard in phylogenetics due to computational tractability. If a model of protein evolution is viewed as translating between ‘past’ and ‘future’ versions of a protein, then the independent-sites assumption is analogous to translating a sentence between languages one word at a time, without considering the surrounding context.Although some early models relaxed the independent-sites assumption by enlarging the evolutionary unit either to paired sites in a structure12 or to entire structure-dependent sequences13, these models were, by and large, computationally intractable, and efforts in the field turned instead towards developing more sophisticated substitution rate matrices (Fig. 1a). In particular, this led to the advent of biologically motivated mixture models that combine a base substitution matrix with learned amino acid profiles to generate a set of related rate matrices that better capture the selective pressures experienced in different structural and functional environments14. The most sophisticated versions of these models estimate site- and family-specific profiles using a combination of single-site and pairwise interaction terms15.Fig. 1: Learning models of protein evolution.Full size imagea, Top: classically, models of protein evolution learn the parameters for a shared rate matrix that describes how each site in a protein’s MSA evolves over time. Bottom: the problem of learning from evolution can be recast as learning transitions between full sequences in the cherries of the tree. b, Our PEINT transformer learns to model evolutionary transitions in these cherries, accounting for mutations, insertions and deletions. PEINT does not require the sequences to be aligned. S, M and E denote Start, Masked and End tokens, respectively.In a different vein, probabilistic models over sequence distributions have made great strides capturing epistatic signals in protein sequences. Historically, these models also relied on multiple sequence alignments (MSAs), starting from the Potts model16 to its neural analogue—the MSA transformer that serves as the backbone of the MSA processing module in AlphaFold models17,18 and is used widely as a stand-alone MSA processing architecture19,20. More recent work has highlighted the promise of using techniques from natural language processing to learn probabilistic models from single protein sequences21,22,23,24. Although these models can capture interactions between residues, they do not model explicitly how proteins evolve over time under structural and functional constraints. Moreover, treating sequences as independent ignores their phylogenetic relatedness and biases learned distributions toward overrepresented lineages25,26. Clustering sequence databases mitigates this bias but also removes variation important for specialized functions within protein families27,28.Here we demonstrate how to achieve the best of both worlds: by integrating principled evolutionary reasoning with modern protein language models (pLMs), we introduce a new framework for learning models of ‘protein evolution in time’ that is alignment-free and accounts for higher-order interactions. This enables us to make use of epistatic signals within sequences to build more sophisticated models of variation between sequences. We show that our approach can make use of evolutionary data at scale, leading to models that show substantially improved performance at modelling both retrospective and prospective evolution. We anticipate that further work along these lines will lead to new insights about the evolution that has led to our current protein universe, as well as models that can predict more accurately forward evolution of proteins involved in disease processes.The PEINT frameworkThe objective of evolutionary modelling is to estimate a likelihood over a set of sequences that are related under a phylogenetic tree (for a more thorough treatment, see Supplementary Text). The difficulty arises from the fact that we typically only have access to the leaves of the tree (extant sequences) and ancestral sequences must be integrated out. This computation is tractable only for independent-sites models29, which, by definition, cannot accurately model the higher-order epistatic interaction patterns that are known to be essential for protein structure and function. Recent work has shown that one can instead ignore the ancestral states completely, by using a composite likelihood over cherries, and learn models of protein evolution that move beyond the independent-sites assumption30. The composite likelihood approach recasts the problem of learning a complicated joint probability over many sequences to one of learning many conditional probability paths between pairs of sequences—termed ‘cherries’—on a tree. Intuitively, this can be thought of as decomposing a larger tree into many smaller trivial trees—‘sticks’—in which both the root and leaf are observed, assuming time-reversibility. This allows us to train a model using a negative composite log-likelihood loss:$${\mathcal{L}}=-\sum _{T\in \text{trees}}\sum _{\text{cherries}\,(x,y,t)\,\text{in}\,T}\log \,p(y|x,t).$$(1)In equation (1), a triple (x, y, t) makes up a cherry and p(y|x, t) quantifies the conditional probability of observing a sequence y given a starting sequence x and the time t on the tree that separates them. The composite likelihood formulation has a key advantage: in sidestepping the ancestral state integration step, evolutionary transitions are no longer constrained to occur between aligned positions in an MSA. This has two important consequences. First, it allows for the use of arbitrary model classes, including deep neural networks, to learn directly from evolutionary transitions across entire sequences in one go. Second, it removes the constraints of relying on a precomputed alignment, which may contain errors, and in doing so enables models to learn more natively from insertion and deletion (indel) processes within protein families. Despite their outsized importance in evolution31, indels have traditionally been difficult to incorporate into classical models of evolution.Here we present the protein evolution in time (PEINT) framework, a deep neural network that learns explicit models of full protein sequence evolution in time (Fig. 1b). The PEINT model uses a coupled encoder–decoder transformer—the standard architecture in the field of machine translation32—and is aptly suited to learning under a composite likelihood framework that recasts the fitting of protein evolutionary models into a direct sequence-to-sequence setup33. Concretely, the transformer parametrizes the transition probability in a single cherry as \(p({y|x},t)=\prod _{i\in \text{sites}(y)}p({y}_{i}|{y}_{1:i-1},x,t)\), that is, for each site i in sequence y, estimating its likelihood given the conditioning sequence x, the branch length t and the already generated positions in y ({1, ..., i − 1}). We found that overall model performance was correlated with the strength of the encoder module and therefore used a pretrained, frozen 150 million (150 M)-parameter evolutionary scale modelling 2 (ESM2) encoder22 to provide rich representations of the input sequence x. The resulting PEINT model adds 5 encoder and decoder layers with approximately 57 million trainable parameters and is trained on TrRosetta evolutionary transitions using a composite task of masked language modelling of x and autoregressive prediction of y (Supplementary Methods and Supplementary Fig. 1).We note that, as a general framework, PEINT is agnostic to the particular choice of encoder model. To demonstrate encoder modularity, we also trained a second PEINT model on the same data, termed ‘PEINT (ESMC)’ after the base encoder ESMC34 (Extended Data Fig. 1), which was released while this manuscript was in revision, and we show its evaluations throughout. Architectures, training configurations and computational costs are summarized in Supplementary Table 1. Models typically converged in a matter of 1–2 days on 2 × A100 graphics processing units.Evaluating evolutionary transitionsA model of protein evolution should be able to reason over various combination of its inputs, that is, a pair of sequences (x, y) and the branch length that separates them (t). By varying which inputs were provided to PEINT, we assayed its ability to reconcile how evolutionary time is related to mutational burden across protein families.First, we evaluated the composite likelihood function on held-out transitions from real data. To build intuition for this task, we can compare with the uniform random guess model—a trivial model of evolution which assumes that each site in a protein will mutate randomly to any of the 20 amino acids regardless of how much time has passed. This model would assign a uniform data likelihood of \(\frac{1}{20}\) (\(=\,0.05\)) across all times (Fig. 2a, dotted grey line). A more sophisticated model should be able to reason about the kinds of mutations that are most likely to occur (or not occur) over various evolutionary distances. The classical models WAG10 and LG11 show good performance at short divergence times, and the LG model in particular improves upon WAG by incorporating site-rate variation to better account for patterns of conservation across sites in protein families (Fig. 2a). The PEINT transformer shows superlative performance across all time ranges assayed (Fig. 2a). Most importantly, this improvement persists even on transitions from trees held out during training (Fig. 2a, right), highlighting the ability of PEINT to generalize evolutionary insights across protein families.Fig. 2: PEINT learns characteristics of evolution along single branches.Full size imageModels of protein evolution must learn to relate sequences and evolutionary times. a, Given held out evolutionary transitions from subtree splits (left) and entirely held-out trees (right), PEINT outperforms classical models (WAG and LG) substantially in terms of data likelihood over all evolutionary times. b, Given a pair of sequences x and y, PEINT can estimate the time separating them by maximizing \(p({y|x},t)+p({x|y},t)\) over t (left). This procedure can be applied at scale to pairs of sequences in a single tree (middle), as well as across 150 held-out families (right, Pearson’s r = 0.95). c, Given a starting sequence and time, PEINT generates new sequences with defined mutational loads that mirror those of classical models (left). Compared with independent-sites models, PEINT generates structurally coherent sequences (right). Each point shows the mean and s.d. of ten independent samples from the model.Ablation studies showed that masked language modelling stabilized training, whereas low-rank adaptation (LoRA)35 fine-tuning provided no measurable benefit (Extended Data Fig. 2). We report the decoder depth analysis in Supplementary Fig. 2. See Supplementary Methods for the full ablation discussion, including the role of additional encoder layers in early training.PEINT can infer branch lengthsIntuitively, a model of protein evolution should learn a notion of the evolutionary time that separates sequences based on the number and types of mutation that occur between them. Classically, one can obtain a maximum likelihood estimate of the evolutionary time separating a pair of aligned sequences x,y in an MSA using classical models by maximizing p(y|x,t). This information is the basis for neighbour-joining tree reconstruction algorithms36. Similarly, one can use PEINT to estimate \({{\rm{argmax}}}_{t}\{p({y|x},t)+p({x|y},t)\}\), that is, the time that maximizes the transition probability between a pair of observed sequences (in both directions), even in the absence of an explicit alignment. Empirically we found that PEINT generates concave likelihood curves as a function of time, so we used gradient ascent on the likelihood to solve this optimization problem (Fig. 2b, left). We carried out this procedure on cherries from held-out families—for a specific held-out family (Fig. 2b, middle) and also across 150 randomly selected held-out families (Fig. 2b, right)—and observed strong correlations between PEINT’s time estimates and those from classical models (Pearson’s r = 0.95). This strong correlation suggests that PEINT is able to provide consistent estimates of evolutionary distances within the time framework in which it is trained, even in trees it has not seen. As PEINT estimates are obtained from unaligned sequences, our results indicate the potential of deep models of protein evolution to more accurately reconstruct phylogenies that reflect the full spectrum of mutational processes—mutations, insertions and deletions.Mutational load and structure qualityModels of protein evolution are fundamentally generative in that they can be used to propose a distribution over sequences given a starting sequence and a branch length (that is, the evolutionary time separating those sequences). Unlike classical models, which sample substitutions for each position in the protein’s alignment as a function of branch length, PEINT can generate new sequences with both substitutions as well as new indels. We compared the generative capabilities of the classical models WAG and LG, as well as PEINT, by fixing a starting sequence (x) and decoding a distribution of sequences with progressively larger branch lengths (longer t) (Fig. 2c). We evaluated these sequences for their mutational load, as well as the structural confidence score—predicted local distance difference test (pLDDT)—assigned to them using OmegaFold37, a structure prediction model that uses single sequences as input. All model classes showed similar behaviour in that the average mutational load increased monotonically with evolutionary time and generated comparable numbers of mutations across the evaluated time range (Fig. 2c, left).However, we found that the quality of generated sequences differed greatly, even controlling for numbers of mutations, with PEINT generating consistently high quality sequences even at high mutational loads (Fig. 2c, right) whereas the classical models show a marked drop in the predicted folding quality of their sampled sequences. We surmise that the ability of a deep learning model such as PEINT to capture epistatic interactions allows it to generate compensatory mutations that account for already mutated positions and thus maintain functionally important contacts. This is a crucial aspect that is new to deep models of evolution, and prompted further investigation into the ability of PEINT to simulate evolution within protein families.Simulating realistic evolution on treesSimulations on trees are central to developing and benchmarking phylogenetic methods because true evolutionary histories are generally unknown38. Yet classical independent-sites models often generate sequences that are easily distinguishable from naturally evolved proteins39 and struggle to model realistic indel processes, sometimes relying on insertion patterns extracted from individual alignments40.We therefore tested whether the ability of PEINT to generate realistic sequences, including indels, along individual branches (Fig. 2c) extends to entire phylogenetic trees (Fig. 3a). We compared PEINT with widely used classical models WAG, LG, LG4X, LG + C60 and LG + S256, spanning single-rate matrix approaches, models with among-site rate variation and increasingly flexible mixture models that capture variation in amino acid preferences across sites (Supplementary Methods). All models produced comparable mutational loads along single branches and throughout the entire pathway down the tree (Extended Data Fig. 3a–c), and generated sequences with generally less than approximately 50% identity to natural sequences (Extended Data Fig. 3d).Fig. 3: PEINT is a realistic simulator of protein evolution.Full size imagea, Simulation setup—existing trees are re-rooted on a randomly chosen leaf sequence. From this root sequence, all internal and leaf nodes are generated progressively using classical (LG or WAG) or PEINT evolutionary models. To account for normal variation within each family, a subtree is retained for evaluation—its distance to the new root node remains unchanged. b, PEINT generates sequences that maintain amino acid usage at conserved sites, whereas simulations using classical models (LG) do not. Example shown for a single family, Human TRAAK. c, J–S divergence of amino acid usage at conserved sites compared with real sequences, aggregated across 545 simulation trees. d, PEINT faithfully recapitulates family-specific indel rates (number of indels per family; each dot represents a family). e, Per-event indel length (number of amino acids inserted or deleted) distribution from PEINT simulation matches closely that inferred from real data. f, When evaluated using AF2Rank, PEINT-generated leaf sequences have pLDDTs that are almost identical to real sequences, and markedly higher than those generated using the best classical model (LG + S256). g, Similar analysis as in f, evaluated using OmegaFold. Boxplots show the median value as the centre, and the box is bounded by Q1 (25th percentile) and Q3 (75th percentile). The whiskers extend to the furthest data point within 1.5× the interquartile range (IQR), with outliers beyond the minimum and maximum of the whiskers shown as individual points.Sequence evaluation metricsWe first examined whether simulations faithfully capture amino acid usage patterns at conserved sites. For example, the mechanosensitive human TRAAK channel41 has many conserved residues in the selectivity filter of its ion conducting pore, as well as pore-adjacent domains that regulate channel currents42 (Fig. 3b). The expected level of divergence can be captured by examining the real sequences from the evaluation subtree, which show relatively little divergence relative to the other subtree, with a mean Jensen–Shannon (J–S) divergence across sites of around 0.2 (Fig. 3b). PEINT-simulated sequences show a similar level of J–S divergence (around 0.25), mostly with subtle differences in non-pore residues that show lower conservation in natural sequences. In contrast, the LG + S256 model—despite having access to conservation statistics and optimal per-site residue frequencies—struggles to maintain these functionally important sites across the tree and generates sequences with highly dissimilar patterns of amino acid usage across all conserved positions, reflected in a much higher J–S divergence of around 0.42. In general, mutations at highly conserved sites are not tolerated, and it is likely that this level of divergence would lead to non-functional proteins. These results hold over the remaining 545 held-out simulation trees (Fig. 3c and Extended Data Fig. 1b). PEINT accurately recapitulates real patterns of amino acid usage at conserved sites, whereas the classical models show more divergent amino acid usage profiles at these highly conserved positions for each protein family. A complementary analysis of conserved structural environments, represented by Foldseek 3Di states43, supported this finding (Extended Data Fig. 4a,b). Furthermore, PEINT simulations accurately reflect family-specific indel rates (Fig. 3d and Extended Data Fig. 1e–g) and lengths (Fig. 3e). Notably, this correlation is explained only partially by sequence length (Extended Data Fig. 4c) and indicates that PEINT can match the indel dynamics of different protein families in simulation.Structural confidence scoresWe evaluated simulated leaf sequences using both forward-folding models (OmegaFold37 and AF2Rank44) and an inverse-folding model (ESM-IF45) to provide structural confidence scores using models with varying reliance on homology. Across pLDDT from forward-folding (Fig. 3f,g) and structure-conditioned likelihood and sequence recovery from inverse folding (Extended Data Fig. 5d,e), PEINT-generated sequences scored similarly to natural sequences from the same families. PEINT (ESMC), which uses an encoder with better structural understanding at scale than the ESM2 series, further improved upon PEINT (ESM2). In contrast, classical model simulations yielded sequences with poor folding propensity; median pLDDT scores were around 50, with few sequences exceeding 80.To mitigate the confounding effects of homology biases and the boost of a strong template, we used AlphaFold2 (ref. 17) as an unbiased discriminator by providing MSAs constructed from simulated leaf sequences. MSAs based on classical model-driven simulations frequently yielded low-confidence structure predictions, whereas PEINT-generated MSAs produced substantially higher-confidence predictions, with many falling within the range observed for natural MSAs, despite the latter being explicitly represented in the AlphaFold2 training set (Extended Data Fig. 5).Because PEINT’s performance tracks the characteristics of their pretrained encoder, what then is the benefit of training PEINT on evolutionary transitions? Indeed, others have explored the use of a base pLM to perform Markov chain Monte Carlo (MCMC) ‘evolutionary’ sampling in sequence space46,47 (Extended Data Fig. 6a). We replicated these approaches in our simulation setup. We found that the strength of the language model was important for judicious evaluation of mutation proposals (Extended Data Fig. 6b), with strong pLM-based energy terms leading to more realistic evolutionary endpoints, but at substantially higher computational cost to reach the expected number of mutations for a given branch (Extended Data Fig. 6c–e). This runtime difference reflects a fundamental distinction between a model of protein sequences and a model of protein evolution. Although both are ultimately trained on the same data (extant protein sequences), PEINT learns directly from evolutionary transitions and conditions explicitly on evolutionary time, effectively amortizing iterative rejection sampling into a single proposal. Consequently, its runtime is constant with respect to branch length. Furthermore, because PEINT places no restrictions on the types of evolutionary transition used for training, it natively generates indels, whereas the MCMC approaches tested here are limited to substitutions.We further evaluated how these results generalize beyond the train and/or test split we used. We stratified performance by family based on their degree of similarity to training sequences (Extended Data Fig. 7). PEINT simulations remained broadly comparable with natural sequences even for families more divergent from the training data. Inverse-folding scores decreased modestly for these families, but similar decreases occurred for natural sequences, suggesting that they are also challenging for the evaluation models themselves. Together, these results indicate that PEINT captures key features of natural protein evolution and generalizes beyond the sequences it was trained on.PEINT generates functional enzymesCarbonic anhydrases are a ubiquitous family of enzymes that catalyse the hydration of carbon dioxide into aqueous bicarbonate. These enzymes balance an exceptional turnover rate (kcat) with poor affinity for substrate (KM)—carbon dioxide is a small, linear molecule with negligible dipole moment. We reasoned that carbonic anhydrase would present a stringent test of the ability of PEINT to realistically simulate evolution while preserving function across large sequence distances. To ensure the generalizability of these results, we selected a held-out tree, and simulated from its seed sequence—that of the β-carbonic anhydrase sequence from cultivated pea (Pisum sativum) (Fig. 4a). Although other β-carbonic anhydrases were present in the training set, by design they show minimal sequence identity to this family, as they come from stringent clustering of the underlying fold space, with a maximal percent identity of approximately 60% to any sequence in the training set. All leaves showed exceptional designability metrics, with OmegaFold pLDDT values above 85 and exact maintenance of the enzyme’s catalytic site (Fig. 4b). This contrasts with simulations using the LG model to suggest substitutions, in which the generated sequences show notably worse structural confidence scores, despite showing similar mutational event burdens (Fig. 4c, top). We also highlight how most leaves generated using either model showed 40–50% sequence identity to any known gene in the National Center for Biotechnology Information nonredundant database, indicating how PEINT naturally explores new regions of sequence space in the process of simulating evolution down a tree (Fig. 4c, bottom). We selected 20 leaves randomly from the PEINT simulation tree for experimental characterization.Fig. 4: PEINT evolutionary trajectories maintain protein function at large sequence distances.Full size imagea, Starting from the sequence of the P. sativum (pea) β-carbonic anhydrase (β-CA), PEINT and LG simulations were carried out on the same tree without filtering. Simulated leaves are coloured by pLDDT (colour bar). b, Structural predictions of the PEINT-generated leaves are shown, coloured by pLDDT (scale as in a). All sequences maintain the catalytic site (inset) but show structural variation at neighbouring sites that is predicted to maintain protein fold with high confidence. In comparison, the LG simulation leads to sequences with poor structural confidence metrics (pLDDT dots in a). c, Top: both PEINT- and LG-simulated sequences show similar numbers of mutations compared with pea β-carbonic anhydrase, but LG-generated sequences have substantially worse pLDDT scores. Bottom: PEINT-generated sequences show low sequence identity to any extant sequence in BLAST databases, despite their high pLDDT. d, Growth over time in the carbonic anhydrase-free functional complementation assay. Six simulated leaves show growth between that of the pea β-carbonic anhydrase and D152N mutation. Curves show the mean and s.d. from three independent growth measurements. e, In vitro CO2 hydration shows a similar trend. Each curve shows the mean behaviour from n = 4 independent measurements. f, Distribution of kcat parameters for natural carbonic anhydrase enzymes (n = 57) span a large range. To roughly situate PEINT-simulated sequences, empirical kcat values of D152N site mutations are shown (yellow lines). The boxplot shows the median value as the centre, with the box bounded by Q1 (25th percentile) and Q3 (75th percentile). The whiskers extend to the furthest data point within 1.5× the IQR. a.u., arbitrary units; OD600, optical density at 600 nm.As an initial assay to test the functionality of the simulated carbonic anhydrase genes, we used a functional complementation assay in the Escherichia coli carbonic anhydrase-free48,49 background. This engineered bacterial strain is deficient in endogenous carbonic anhydrase genes and cannot grow in low CO2 concentration in the absence of an exogenously provided functional carbonic anhydrase gene. We transformed the 20 selected leaves, the root sequence50 as a wild-type control and a previously characterized mutant at a conserved aspartic acid residue, D152N (D162N in our construct) that is shown to yield slower, but still marginally functional, carbonic anhydrase enzymes51,52,53. At an intermediate, but not growth-permissive, CO2 concentration of 1%, we found that 6 of the 20 designs could rescue growth better than the D152N mutation (Fig. 4d), although all intriguingly showed a long lag phase phenotype. We followed this growth-based functional complementation assay with an in vitro characterization of CO2 hydration rates. We expressed and purified the wild-type pea β-carbonic anhydrase and the D152N mutant, as well as one of our growth-rescuing simulation endpoints, seq1360, and measured the rate of hydration using the pH indicator assay54 at a saturating concentration of 17 mM CO2 (Supplementary Fig. 3). This assay validated our results from functional complementation, with seq1360 showing a slower rate of hydration than the wild-type enzyme (despite being assayed at a higher concentration), but faster reaction kinetics than the D152N mutant, which is only marginally faster than the uncatalysed reaction (Fig. 4e).Despite a historical notion that carbonic anhydrase is essentially a perfect enzyme, carbonic anhydrases across the tree of life are not universally perfect in their rates55, with many possessing more modest kcat values in the approximately 104 s−1 range (roughly 1% of the well-known human carbonic anhydrase II enzyme) (Fig. 4f). Although we did not measure full kinetic curves, we can place our functional PEINT-generated sequences approximately relative to independent measurements of the kinetics of mutations at the conserved aspartic acid (D152) in orthologous enzymes from spinach53 and the archaeon Methanobacterium thermoautotrophicum52 (Fig. 4f, yellow dashed lines), which implies that our designed enzymes’ kcat values should fall within the range that is naturally observed in different organisms. It is possible that, by training more broadly on evolutionary transitions across the tree of life, PEINT has learned patterns of evolution from organisms for which the rapid hydration of CO2 is not as imperative as it is in human and plant metabolism, and may predominantly generate enzymes with modest, but measurable, activity.PEINT improves variant effect predictionAs the need to maintain function constrains protein evolution, extant protein families contain a partial record of millions of years of evolutionary trial and error selecting for a given function. Density models fit on evolutionarily related sequences, either for specific families56 or across the whole tree of life57 have shown to be strong zero-shot variant effect predictors, which means that they do not require access to assay-labelled training data to score variant effects. However, recent works also suggest that increasing scaling of pLMs does not necessarily translate to increased performance on variant effect prediction (VEP) tasks58,59, due potentially to its likelihood being biased towards certain evolutionary neighbourhoods25, suggesting that better accounting for phylogenetic relationships might be a promising approach for improving the performances of these models for VEP. Although some approaches have been proposed to improve VEP with pLMs by accounting for wild-type preference58 or injecting information from homologous sequences at inference time59, our approach can be viewed as a complementary approach, with the potential benefit of more fully leveraging the phylogenetic information from evolutionary data with a flexible model coupled with a principled training objective.Herein we explored ways to leverage the PEINT framework to predict the effect of substitutions in families from ProteinGym60—a standardized benchmark for protein VEP—by training smaller PEINT models on top of a base pLM (for example, ESM2-150) using cherries from each family in the ProteinGym substitution benchmark. Following ref. 61, we score mutants (mut) using \(\log \left[\frac{p({x}^{\text{mut}}|{x}^{\text{wt}},t)}{p({x}^{\text{wt}}|{x}^{\text{wt}},t)}\right]\), where t is a hyper-parameter controlling the size of the evolutionary neighbourhood around the wild type (wt). At t = 0, all mutants should have zero probability and, as t increases from 0, mutant sequences will be assigned non-zero probabilities, and the extent to which these probabilities change depends on how likely it is that the mutant could have arisen from the process of mutation and selection according to the model.Each family in the ProteinGym substitution benchmark has been categorized by the assay type of the deep mutational scanning. We found that PEINT offers the largest performance gains on datasets where the assays measure the extent to which mutations affect the growth rate of an organism (Fig. 5a), while improving on the pretrained backbone model ESM2 across all mutational depths (Fig. 5b). The growth rate is a more holistic proxy for the overall fitness constraints imposed on an organism compared with other molecular phenotypes (for example, binding and stability); hence, it stands to reason that a model that is better able to extract information from evolutionarily related sequences would be a better zero-shot variant effect predictor. We saw that PEINT was able to rescue performance in many families where ESM2-150M struggled to generate reasonable predictions (Spearman’s ρ