SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Method	rs	AUC	MCC	RMSE↓	Stabilizing rs
Mean (cDNA)	0.00	0.50	0.00	2.42	0.00
Mean (ProTherm)	0.00	0.50	0.00	2.26	0.00
MSA	0.07	0.51	-0.05	N/A	0.02
ESM2 [62]	0.05	0.51	0.04	N/A	-0.01
FoldX [67]	0.41	-	-	2.95	-
DDGun [44]	0.25	0.63	0.16	2.21	0.17
DDGun3D [44]	0.26	0.64	0.18	2.24	0.17
PROSTATA [74] (Additive)	0.21	0.60	0.05	2.25	0.00
Mutate Everything (Additive)	0.50(0.02)	0.76(0.01)	0.37(0.02)	2.02(0.03)	0.20(0.01)
Mutate Everything (Ours)	0.53(0.01)	0.78(0.01)	0.43(0.01)	2.04(0.01)	0.19(0.01)
Table 2: Multiple Mutation Results on PTMul. Our additive baseline naively adds predicted single mutation  $\Delta \Delta G_{s}$ . Our model presents a strong mutation assessor. The proteins in PTMul have at most  $35\%$  sequence similarity to those in the training set. Parenthesis is standard error across 7 runs.
To the best of our knowledge, Mutate Everything is the first work that models all double mutations in a computationally tractable manner. Figure 4 shows the runtime of several methods on a protein of 317 amino acids on an A100 GPU. The dashed line indicates the transition from evaluating single mutants to double mutants. Mutate Everything predicts  $\Delta \Delta G$  for all single and double mutations in one pass of the model. It runs in 0.6 seconds using an ESM2 backbone, and 12.1 seconds on an AlphaFold backbone. PROSTATA [74] also uses the ESM2 backbone but takes a protein sequence and its mutated sequence as input and outputs the change in stability. PROSTATA takes 306 hours to evaluate all double mutations with a batch size of 768. On an 8 GPU node, this will take 1.5 days.
Figure 4: Runtime analysis. Our model's runtime is constant.
5.3 Higher-order Mutation Results
We evaluate our model for predicting changes in thermodynamic stability for higher-order mutations in ProTherm. ProTherm is a database of thermodynamic  $(\Delta \Delta G)$  and thermostability  $(\Delta T_{m})$  experimental characterization of protein mutations curated from the literature. We consider a subset of this database that contains  $\Delta \Delta G$  values for higher-order mutations, named ProTherm Multiple (PTMul). PTMul contains 858 mutations [44]. We keep 846 experimentally validated  $\Delta \Delta G$  for higher-order mutants, including 536 doubles and 183 triples, after removing 4 duplicate and 8 ambiguous mutations. PTMul proteins have at most  $35\%$  homology to the proteins used in training.
Table 2 shows our results on PTMul. A description of baselines is provided in Section A.3. Our additive baselines naively add the sum of single mutation  $\Delta \Delta G_{s}$ . This baseline rigorously evaluates our model's ability to learn epistasis, or the non-additive interactions when combining two mutations. Mean always predicts the global test dataset mean statistic. ESM and MSA perform poorly when comparing mutations across proteins. On ProTherm, Mutate Everything achieves the state-of-the-art performance of 0.53 Spearman correlation  $r_s$ , compared to 0.50 of our additive baseline. A breakdown of PTMul performance on double mutations and more ( $>2$ ) mutations is found in Table 6.
While other methods also handle multiple mutations, they usually adopt a mutation- or protein-level train and test split. This results in data leakage since the same protein or a homolog will have mutations in both the training and testing sets, leading to inflated reported metrics [16, 18, 35, 64]. In our study, we use sequence similarity-based splitting where our training proteins have at most  $35\%$  homology to those in PTMul. To fairly evaluate generalization to new proteins, we exclude these inflated comparisons from our study.
Method	Forward	Reverse
rs	AUC	MCC	RMSE↓	rs	AUC	MCC	RMSE↓
Structure-based Methods
mCSM [57]	0.37	0.66	0.13	1.53	0.24	0.61	0.10	2.33
I-Mutant3.0 [11]	0.35	0.64	0.08	1.53	0.17	0.59	0.06	2.35
DUET [56]	0.42	0.68	0.19	1.52	0.26	0.63	0.12	2.16
FoldX [67]	0.27	0.62	0.14	2.35	0.32	0.67	0.20	2.54
MAESTRO [35]	0.46	0.69	0.26	1.45	0.22	0.61	0.11	2.12
PopMusic [17]	0.42	0.69	0.22	1.51	0.24	0.62	0.12	2.10
SDM [77]	0.39	0.67	0.21	1.67	0.14	0.59	0.12	2.15
INPS3D [66]	0.44	0.70	0.20	1.49	0.36	0.69	0.23	1.78
Dynamut [63]	0.38	0.68	0.20	1.59	0.37	0.67	0.17	1.69
ThermoNet [36]	0.38	0.69	0.21	1.62	0.35	0.66	0.18	1.66
PremPS [14]	0.42	0.66	0.20	1.50	0.43	0.66	0.22	1.49
DDGun3D [44]	0.43	0.71	0.27	1.60	0.41	0.71	0.23	1.61
ACDC-NN [7]	0.46	0.73	0.23	1.49	0.45	0.72	0.22	1.50
Stability Oracle [18]	0.53	0.75	0.34	1.44	0.53	0.75	0.32	1.43
Sequence-based Methods
MuPro [15]	0.27	0.61	0.03	1.60	0.22	0.64	0.08	2.41
I-Mutant3.0-Seq [11]	0.34	0.67	0.25	1.54	0.23	0.61	0.05	2.25
DDGun [44]	0.43	0.72	0.24	1.73	0.41	0.71	0.23	1.76
ACDC-NN-Seq [55]	0.44	0.72	0.26	1.52	0.44	0.72	0.23	1.52
INPS-Seq [66]	0.44	0.72	0.25	1.52	0.44	0.72	0.21	1.53
PROSTATA [74]	0.50	0.73	0.28	1.44	0.50	0.73	0.29	1.44
Mutate Everything (Ours)	0.56	0.76	0.35	1.38	0.49	0.73	0.30	1.48
Table 3: Comparisons on Single Mutation Thermodynamic Stability prediction in S669. We report regression and classification metrics on the forward and reverse datasets for structure-based approaches (top block) and sequence-based approaches (bottom block). r refers to Spearman correlation coefficient. Our training proteins have at most  $30\%$  sequence similarity with those in S669. Mutate Everything is state-of-the-art on S669 forward.
5.4 Single Mutation Results
We additionally validate our model's ability to predict changes in thermodynamic stability under single mutations. We compare Mutate Everything to prior works on the newly introduced S669 dataset, which was established to address the data leakage issue and enable fair comparisons between existing methods [54]. We also evaluate the commonly studied reverse dataset setting, in which the model takes the mutant sequence as input and predicts  $\Delta \Delta G$  for mutating back to the wild-type sequence. The experimental value is obtained by negating the original  $\Delta \Delta G$  value going from the wild-type sequence to the mutant sequence. S669 is well curated and extensive, containing 94 proteins totaling 669 mutations [54]. S669 proteins have at most  $30\%$  sequence similarity with those in our training set to ensure separation between the training and validation sets.
Table 3 shows our comparisons with prior works. Mutate Everything is state-of-the-art on S669, achieving a Spearman correlation of 0.56, where the prior art obtained 0.53. Mutate Everything outperforms the existing sequence model by a large margin, with a 6-point gain on Spearman correlation and a 3-point improvement on AUC. Our method is even as powerful as the latest structure-based methods which have access to atom coordinates.
Mutate Everything is competitive on the reverse dataset evaluation, in which the original and mutated sequences are flipped and  $\Delta \Delta G$  negated. Our performance drops on reverse mutations because reverse mutations are out of distribution for our model. We did not perform data augmentation to train on reversed mutations as commonly done in the literature [18, 36, 74]. We found that it was beneficial to bias our reverse predictions using  $\Delta \Delta G$  to the amino acid found in the original sequence. We found the performance to be similar across 5 runs ( $< 0.01$  standard error).
Model	ProteinGym-Stability	ProteinGym
rs	AUC	MCC	rs	AUC	MCC
DeepSequence [61]	0.44	0.74	0.34	0.43	0.74	0.35
EVE [24]	0.47	0.75	0.36	0.46	0.76	0.36
ESM1v [42]	0.41	0.72	0.31	0.41	0.74	0.33
Progen2 [47]	0.45	0.74	0.35	0.42	0.74	0.34
MSA Transformer [60]	0.50	0.77	0.38	0.44	0.75	0.35
Tranception [49]	0.40	0.71	0.31	0.40	0.73	0.32
Tranception+MSA	0.45	0.74	0.35	0.45	0.76	0.36
TranceptEVE [50]	0.50	0.77	0.38	0.48	0.77	0.38
MSA	0.41	0.72	0.32	0.39	0.72	0.31
Mutate Everything	0.52	0.78	0.39	0.38	0.72	0.30
Mutate Everything +MSA	0.52	0.78	0.41	0.44	0.75	0.36
Mutate Everything +MSA+Tranception	0.53	0.79	0.42	0.49	0.78	0.39
Table 4: Comparisons on mutation fitness prediction in ProteinGym. We report ranking and classification metrics on both a subset of ProteinGym with stability-like phenotypes and the entire ProteinGym dataset. Our stability model can generalize to all phenotypes, outperforming existing methods on stability-like phenotypes and performing similarly to existing methods otherwise. The maximum homology between our training set and ProteinGym proteins is  $43\%$ .
5.5 Generalization to other Phenotypes
We show that stability predictors generalize to other phenotypes as well. ProteinGym substitutions is a dataset of 87 proteins with 1.6 million mutation sets labeled with a generic fitness score, such as activity, growth, or expression. The mutation sets have up to 20 substitutions and 14 proteins contain higher-order mutations. The ProteinGym-Stability split contains 7 proteins and 26,000 mutations with fitness labels that are known to correlate with thermodynamic stability (thermostability, abundance, expression). ProteinGym proteins have at most  $45\%$  sequence similarity with those in our training set. Due to memory constraints, we truncate proteins to at most 2000 amino acids.
Table 4 compares our work with previous works. Our MSA baseline uses the empirical amino acid distribution in the MSA at a given position to compute a likelihood ratio. The MSA retrieval prior weights the scores using the per-position first-order statistics in a multiple sequence alignment. On ProteinGym-Stability, Mutate Everything obtains a Spearman correlation of 0.52, compared to 0.50 of the next best method, TrancaptEVE. On the one protein with labeled stability, Mutate Everything obtains 0.51 vs 0.33 of Trancception with MSA retrieval [51]. On the full ProteinGym benchmark, we outperform the strongest methods by ensembling our predictions with Trancception [49]. Ensembling our method with evolutionary models by averaging scores gains 0.11 points on ProteinGym and 0.01 points on ProteinGym-Stability, suggesting that our model learns complementary information to the evolutionary models. For comparison, TransEVE ensembles an evolutionary model (Trancption) and a family-based model (EVE) for a 0.03 point gain [50]. We found the performance to be similar across 5 runs ( $< 0.01$  standard error). An in-depth study on how protein stability related to function can be found in [26].
5.6 Ablation Studies
We ablate several architectural design choices in Table 5. Core architectural designs are evaluated on S669. Architectural designs for only multiple mutations are evaluated on cDNA2.
Backbone. We analyze the effect of different feature extractors on single mutation stability assessment in Table 5a. ESM2 [38] takes only sequence as input whereas MSA-Transformer [60] and AlphaFold [31] take the sequence and its MSA as input. Both ESM2 and MSA-Transformer are trained on masking residue modeling while AlphaFold is also trained on structure prediction. MSA input improves the stability prediction performance and AlphaFold's architecture and training further improve stability prediction.
backbone	rs	AUC
ESM2 [38]	0.47	0.72
MSA-Transformer [60]	0.53	0.75
AlphaFold (scratch)	0.36	0.65
AlphaFold [31]	0.56	0.76
(a) Backbone on S669. MSA inputs improve performance. A pre-trained AlphaFold model performs the strongest.
backbone opt	rs	AUC
freeze	0.48	0.72
finetune	0.56	0.76
(c) Backbone Optimization on S669. Finetuning the AlphaFold backbone improves performance.
aggregator	nDCG	DetPr	AUC
outer prod. + flat.	0.39	0.15	0.82
product	0.42	0.14	0.85
sum	0.43	0.16	0.84
whiten + sum	0.25	0.12	0.80
(b) Mutation Aggregation on cDNA2. Higher-order mutations aggregate single mutation features. Adding these features is competitive.
higher model	nDCG	DetPr	AUC
direct	0.40	0.13	0.85
multiply	0.17	0.08	0.77
add	0.43	0.16	0.84
(d) Higher-order Modeling on cDNA2. We model the  $\Delta \Delta G$  of the double mutation as a residual combined with the  $\Delta \Delta G$  of its single mutation.
Table 5: Mutate Everything ablation experiments. Default Settings are marked in grey.
Backbone Optimization We try fine-tuning and freezing the AlphaFold backbone during stability fine-tuning in Table 5c. We find that fine-tuning the backbone improves stability prediction performance.
Aggregation The technique to aggregate mutation representations for higher-order mutations is ablated in Table 5b. To control for feature dimension size, we reduce the head dimension when aggregating with outer product and flattening. Aggregating with product and summation performs similarly on double mutations. We add the features for a natural extension to more mutations.
Higher Order Modeling In the direct prediction model, the multi-mutant head directly predicts  $\Delta \Delta G$ . In the multiply and add models, the multi-mutant head learns how interactions among single mutations affect the higher-order mutation's  $\Delta \Delta G$ . In these models, the multi-mutant head output learns an additive bias or multiplicative scaling to the sum of single mutation  $\Delta \Delta G_{s}$ . In Table 5d, we show that learning a bias performs the strongest among these three options.
First, our training dataset contains biases that may affect model performance. The training set contains only small proteins, which may limit performance on larger ones. Our model may exhibit biases towards certain types of mutations due to the data imbalance in our training set. Second, the limited availability of experimental stability data poses a challenge for in-silico evaluation. Evaluation on larger and more diverse datasets is necessary to fully assess the generalizability of our model. In the future, we hope that high-throughput experimental assays will enable more rigorous evaluation and further improvements in protein stability prediction.
We present a method that efficiently scales thermodynamic stability prediction from single mutations to higher-order mutations. Our key insight is that the effects of mutations on the same protein are correlated. Thus, for a target protein, it suffices to run a deep backbone once and decode the effect of all mutations simultaneously using a shallow decoder. With the AlphaFold model as our backbone, our method outperforms existing methods on a variety of single and multiple mutation benchmarks. Our method scales to millions of mutations with minimal computational overhead and runs in a fraction of the time it would take prior works.
This work is supported by the NSF AI Institute for Foundations of Machine Learning (IFML).
[79] Yeung, N., Lin, Y.W., Gao, Y.G., Zhao, X., Russell, B.S., Lei, L., Miner, K.D., Robinson, H., Lu, Y.: Rational design of a structural and functional nitric oxide reductase. Nature 462(7276), 1079–1082 (2009) 1, 2
[80] Zhou, B., Lv, O., Yi, K., Xiong, X., Tan, P., Hong, L., Wang, Y.G.: Accurate and definite mutational effect prediction with lightweight equivariant graph neural networks. arXiv preprint arXiv:2304.08299 (2023) 3
[81] Zhou, Y., Pan, Q., Pires, D.E., Rodrigues, C.H., Ascher, D.B.: Ddmut: predicting effects of mutations on protein stability using deep learning. Nucleic Acids Research p. gkad472 (2023) 3
A Experimental Setting
We elaborate on our experimental protocol, including the datasets used for training and testing, the evaluation metrics, and the baselines that calibrate our models.
A fundamental principle in machine learning is to partition data so that the model is not evaluated on the same data it was trained on. This is essential to assess the model's ability to generalize beyond its training data (in our case, to new proteins). Protein sequences are regarded as the same protein when they have large sequence similarity (e.g.  $>50\%$ ), even when they are not exactly the same string. The impact of training on protein sequences similar to those in the test set has received considerable attention [18, 45, 54]. We list the datasets we use below and report the maximum sequence similarity of our training set with each test set. This ensures a clear separation between our training and test sets.
cDNA proteolysis [72] is a large scale dataset containing mutant proteins with  $\Delta \Delta G$  measurements. The dataset is generated by cDNA display proteolysis, a massively parallel technique that measures thermodynamic folding stability for millions of protein variants [72]. The cDNA proteins average 56.1 amino acids in length with a maximum length of 72 and a minimum length of 30 amino acids. The mean MSA depth is 7797 with a standard deviation of 6282. The maximum depth is 23525 and the minimum depth is 5. The mutations contain either one or two substitutions on a small protein. We follow the train-val split introduced in [18] and additionally filter out proteins in our training set that are similar to those in our evaluation datasets. Specifically, we train on 116 proteins with 213,000 total mutations, of which 97,000 are double mutants and 117,000 are single mutants. We hold out cDNA2, a validation set of 18 mini-proteins with 22,000 total double mutations. The proteins in our training set have at most  $36\%$  sequence similarity to those in cDNA2. A comprehensive analysis of the dataset, experimental assay, and filtering criteria are found in their paper [1].
ProTherm [48] contains experimentally measured thermodynamic data  $\Delta \Delta G$  for protein mutants. We use PTMul, a split containing only higher-order mutations curated by DDGun [44]. There are 88 proteins with 846 total mutations in PTMul. The proteins in our training set have at most  $35\%$  sequence similarity to those in PTMul.
S669 [54] is a manually curated dataset of mutant proteins and their  $\Delta \Delta G$  measurements. S669 contains mutations with one substitution. There are 94 proteins with 669 total single mutations in S669. The proteins in our training set have at most  $30\%$  sequence similarity to those in S669.
ProteinGym [49] is a curated set of proteins in which mutations are assessed for some fitness phenotype. These fitness phenotypes vary drastically, from cell growth to expression to fluorescence. The fitness values are always normalized so a higher value indicates stronger fitness. For classification metrics, the fitness values are binarized by some threshold either defined manually or arbitrarily at the median value. We also consider a subset of the proteins in ProteinGym in which fitness correlates highly with thermodynamic stability. These phenotypes include thermostability, expression, etc. There are 87 proteins totaling over 1.6 million (potentially higher-order) mutations. The proteins in our training set have at most  $45\%$  sequence similarity to those in ProteinGym.
T2837 [18] is an aggregate dataset with mutant proteins and their  $\Delta \Delta G$  measurements. T2837 contains mutations with one substitution. There are 129 proteins with 2837 total single mutations in T2837. The proteins in our training set have at most  $34\%$  sequence similarity to those in T2837.
A.2 Metrics
We evaluate our model's ability to assess mutations in ProTherm, S669, and ProteinGym. Additionally, we evaluate our model's ability to detect stabilizing mutations in cDNA2.
A.2.1 Mutation Assessment
The model predicts the  $\Delta \Delta G$  measurement under all mutations with experimental data. The models are evaluated by the following regression and classification metrics. The classification metrics are
useful in applications where it is unnecessary to provide exact  $\Delta \Delta G$  and a binary stabilizing or de-stabilizing label (or third label, neutral) is sufficient.
Following the literature, we additionally evaluate reverse mutations (in contrast to the standard "forward" mutations) where the "to" and "from" amino acids are flipped (e.g. P1K to K1P). The model takes the mutant sequence as input and is expected to output the negation of the original  $\Delta \Delta G$  value when mutating to the original native amino acid.
Spearman correlation coefficient  $(\mathbf{r}_s)$  evaluates the model's ability to rank the mutations by their  $\Delta \Delta G$  values. This metric considers only the relative ordering between mutations and disregards the predicted values. Spearman has its limitations because our datasets contain predominantly destabilizing mutations ( $\Delta \Delta G > 0$ ). Spearman applied on these datasets overwhelmingly measures the model's ability to rank destabilizing mutations which does not directly translate to identifying the most stabilizing mutations [8, 58].
Root Mean Square Error (RMSE) provides a measure of how closely the predicted measurements align with the true measurements.
Area Under the receiver operating characteristic Curve (AUC) is a popular classification metric that focuses on positives. The receiver operating characteristic curve is created by plotting precision against recall at various classification thresholds. Precision is calculated as the ratio of true positives to the sum of true positives and false positives. Recall is calculated as the ratio of true positives to the sum of true positives and false negatives.
Matthew correlation coefficient (MCC) evaluates a model's classification performance under imbalanced datasets. It takes into account true positive, true negative, false positive, and false negative predictions to measure the overall performance of a model.
A.2.2 Mutation Detection
The regression metrics for mutation assessment are not directly suitable for protein engineering where the goal is to find stabilizing mutations. In addition to the classification metrics, we evaluate our models using per-protein metrics which evaluate the model's ability to detect a few stabilizing mutations from a large number of possible mutations. These metrics are applied to heavily annotated proteins ( $\sim 1000 \Delta \Delta G$  measurements) with randomly sampled mutations.
Stabilizing Spearman correlation coefficient  $\mathbf{r}_s$  is the Spearman coefficient calculated on the subset of experimentally stabilizing mutations. This mimics the case in protein engineering where there are too many stabilizing mutations to test in vitro and the goal is to prioritize the most stabilizing ones. This metric is used in [18, 65].
Normalized Discounted Cumulative Gain (nDCG) [30] quantifies the quality of a ranking among mutations by considering both the experimental  $\Delta \Delta G$  and predicted rank of each mutation. Specifically, nDCG computes the sum of experimentally stabilizing  $\Delta \Delta G_{\mathrm{s}}$  weighted inversely by their ranks. This metric rewards a model that ranks the best mutations first. We truncate the ranking at  $K = 30$  mutations to approximate the number of in-vitro experiments that can typically be run in parallel. This metric is found in [59].
Detection Precision (DetPr) measures the fraction of experimentally stabilizing mutations among the top  $K = 30$  predicted mutations by the model. This simulates the success rate a protein engineer might expect when deploying this model.  $K$  is set to approximate the number of in-vitro experiments that can typically be run in parallel.
A.3Baselines
Several baselines calibrate performance across datasets. A subset of the critical baselines is introduced briefly (see [54] for more).
Mean is a simple baseline in which the mean measurement is predicted for all mutations. This baseline is not conditioned on the protein or mutation and instead uses only the dataset statistic.
Multiple Sequence Alignment (MSA) leverages the statistics from a set of similar protein sequences to rank mutations. Similar protein sequences are fetched, aligned, and indexed at a mutation position.
This yields an amino acid frequency count normalized into a probability distribution. The score is defined as the likelihood ratio between the mutated and native amino acid types. While calibrated for a given position and protein, it may not be well-calibrated across proteins.
ESM [38] also computes the likelihood ratio between a mutated and native amino acid type [42]. Unlike MSA, the probability distribution is decoded from ESM2 [38], a model pre-trained on masked amino acid prediction. Like MSA, ESM may not be well-calibrated across proteins.
DDGun [44] uses a linear combination of scores derived from evolutionary and structural features to compute  $\Delta \Delta G$ .