nextflow Frontier
All posts

#3 BenchmarkProtein engineering · 12 min read

A model 80 times smaller kept pace on protein stability

By Edmund Miller and Harshil Patel

Figure: ranking one-amino-acid edits by folding stability.

Nextflow Frontier trained a small protein model to rank edits that lengthen or shorten a protein by one amino acid. On 46 held-back variants of a mouse protein, its selected model scored 0.953 against 0.940 for ESM-1v Embeddings, the strongest published supervised method for this task. A score of 1 means a perfect ranking. Nextflow Frontier's approach uses a protein language model with about one eightieth as many parameters as the language model behind that method.

The recipe also scored close to the reference in broader reruns. Across 19 random starts, it averaged 0.934 on those same 46 variants. Under the full benchmark protocol, averaging predictions across the starts gave 0.913 against 0.906 for ESM-1v Embeddings. The uncertainty in that difference leaves neither method with an established lead. The size comparison concerns their language-model components. We did not measure runtime or cost.

Editing a protein can change how firmly it holds its folded shape. Predicting whether an edit will make the protein more or less stable is hard, especially when it makes the chain longer or shorter. Protein engineers use these edits to shorten flexible loops or lengthen linkers between parts of a protein (Savino et al. 2022; Chen et al. 2013). Reliable predictions would help them skip edits likely to fail. We used Nextflow Frontier to test approaches to this problem on a public benchmark. Its selected model ranked about 91 in every 100 pairs of unseen variants correctly, against about 89 for ESM-1v Embeddings on the same variants.

The smallest length change inserts or deletes one amino acid, a building block of the protein chain. Most published stability measurements concern swaps, where one amino acid replaces another (Savino et al. 2022), so far fewer measurements exist for insertions and deletions.

A protein holds its shape through many small forces between its amino acids. For example, water-avoiding side chains pack into its core. A swap can upset that balance (Pace et al. 2011). An insertion or deletion also shifts the position of every amino acid after it along the chain. That can disrupt a stretch of contacts unless a flexible loop absorbs the change.

The benchmark task

ProteinGym tests methods that predict the effects of protein changes (Notin et al. 2023a). This dataset uses a 72-amino-acid domain of mouse CSN4. A domain is a section of a protein that folds into its own compact shape. CSN4 is part of the COP9 signalosome, a complex that regulates protein degradation (Wei and Deng 2003; Lingaraju et al. 2014).

The method receives stability measurements for 149 of the domain’s 196 measured variants, each differing by one inserted or deleted amino acid. It must rank the remaining 47 from least to most stable without seeing their measurements.

Top: a chain of lettered amino-acid beads, natural, with one deleted and with one inserted, each edit shifting every bead after it. Below: proteases cut an unfolded chain but not a folded one, a curve of how much protease each variant withstands, and that resistance as a low or high stability score

Figure 1The top row shows how deleting or inserting one amino acid shifts every amino acid after it one place along the chain; each bead is one amino acid and the dashed circle marks the deleted one. Panels A to C show how stability was measured: a protease cuts an unfolded chain but not a folded one, the amount of protease each variant withstands is recorded, and that resistance becomes its stability score. The example sequence uses one-letter amino-acid codes. F is phenylalanine, I is isoleucine, D is aspartate, Q is glutamine, G is glycine and A is alanine. The curves in panel B are schematic.

The measurements come from a 2023 study by Tsuboyama and colleagues. Their method can measure the folding stability of up to 900,000 protein domains in one week. It exposes a mixture of variants to proteases, enzymes that cut proteins apart, and records how much protease each variant withstands. Folded chains protect their cut sites, so proteases cut unfolded chains more easily. How much protease a variant withstands therefore gives a measure of its stability.

ProteinGym uses Spearman’s rank correlation to compare predicted and measured rankings. It runs from 1 for the same order through 0 to −1 for the reverse. We also report the share of variant pairs for which the model correctly predicts which variant is more stable. Random guessing gets 50 of every 100 pairs right. A perfect method gets all 100.

ProteinGym splits the 196 variants into five random groups of 47, 44, 39, 37 and 29. We confirmed that the hidden variants form the largest group. The split ignores the position of an edit along the chain. As a result, 45 of the 47 hidden variants occur at positions where a different edit was measured. The task tests predictions for missing measurements at mostly familiar positions. This resembles a lab measuring some edits, then asking which remaining edits are worth making.

How Nextflow Frontier built its model

Nextflow Frontier made 1,012 scored attempts over about a day and a half. It began with the protein’s structure, describing each variant by how tightly its amino acids pack inside the fold. This approach put 73 of every 100 pairs in the right order.

Light gray dots for every attempt over about 35 hours with a teal line tracing the best Spearman score: 0.638, 0.855 with a protein language model, 0.903, 0.938 and 0.955 after fine-tuning, passing the 0.940 line for ESM-1v Embeddings. Below: ESM-2’s six fixed layers, each with a small trained update, feeding a trained scoring layer

Figure 2Switching to a protein language model produced the largest increase in the best score. Fine-tuning produced the final increase. Light gray dots show individual attempts. The 159 attempts that scored below 0.5 fall below the plotted range. The teal line shows the best score so far, and each label gives that step's score. The gray horizontal line is ESM-1v Embeddings rescored on the 46 hidden variants that have published predictions. The dots and the teal line use all 47. The lower panel shows how ESM-2, short for Evolutionary Scale Modeling, was fine-tuned. Its original layers stay fixed while added parameters, called adapters, and a final scoring layer train on the measurements.

Within two hours, Nextflow Frontier switched to a protein language model trained on millions of natural protein sequences without stability data. It used the model to score how closely each edited sequence resembles natural proteins. Sequences the model scores as less natural usually prove less stable in the laboratory. This approach got 84 of every 100 pairs right. Nextflow Frontier continued testing structure-based approaches, which briefly scored higher. By about 31 hours, its revised language-model approach got about 90 of every 100 pairs right.

About 31 hours in, Nextflow Frontier began fine-tuning a published language model on the stability measurements. It chose the smallest released ESM-2, with 8 million parameters (Lin et al. 2023). Parameters are the adjustable numbers inside a model. Nextflow Frontier kept the original parameters fixed and trained small additions called adapters, along with a final scoring layer. This method is called low-rank adaptation (Hu et al. 2022). Only the additions and scoring layer learned from the 149 measurements. About three hours later, the model ordered about 91 of every 100 pairs correctly, the run’s best result.

How it compares with the published methods

The three published supervised methods keep their language models fixed (Notin et al. 2023b). Each uses a large language model to turn a variant’s sequence into a numerical summary. A small model then learns to predict stability from those summaries. The strongest, which ProteinGym lists as ESM-1v Embeddings, uses ESM-1v, with about 650 million parameters (Meier et al. 2021). The other two use MSA Transformer (Rao et al. 2021) and Tranception (Notin et al. 2022). These language models also read related natural sequences.

ProteinGym’s leaderboard reports 0.906 for ESM-1v Embeddings. It pools predictions for all 195 published variants into one correlation. That score covers more variants than Nextflow Frontier’s test group. ProteinGym publishes each method’s predictions, so we rescored all three methods on the hidden group.

ESM-1v Embeddings scores 0.940 on that group. Two differences explain the increase from 0.906. First, pooling predictions gives a lower score than averaging the five group correlations, 0.906 against 0.914. Second, the hidden group is one of the easier groups for ESM-1v Embeddings. Its five group scores are 0.94, 0.94, 0.91, 0.90 and 0.88.

One of the 47 hidden variants is the unedited natural protein, which has no published prediction. The matched comparison therefore uses 46 variants. Nextflow Frontier’s model scores 0.953 on those 46 and 0.955 on all 47. ESM-1v Embeddings scores 0.940 on the matched 46.

Bar chart of Spearman correlation on the same 46 held-back variants: Nextflow Frontier 0.953, ESM-1v Embeddings 0.940, MSA Transformer Embeddings 0.881, Tranception Embeddings 0.803

Figure 3On the same 46 hidden variants, Nextflow Frontier's selected model scored 0.953 against 0.940 for ESM-1v Embeddings, and higher than the other two published methods. Bars show Spearman's rank correlation from 0, where 1 means a perfect ranking. Nextflow Frontier is in teal and ESM-1v Embeddings in gray. Each published method trains a small model on numerical sequence summaries from the named language model. ESM means Evolutionary Scale Modeling. MSA means multiple sequence alignment.

The selected recipe ordered about two more pairs in every 100 correctly than ESM-1v Embeddings. On these 46 variants, the uncertainty interval around that gap includes zero. The observed gaps from the other two comparators were larger (Figure 4).

Left: each published method’s score beside Nextflow Frontier’s 0.953. Right: Nextflow Frontier’s score difference from each method with a 95% interval; the interval against ESM-1v Embeddings crosses zero, while those against MSA Transformer Embeddings and Tranception Embeddings sit above it

Figure 4Each comparison uses the same 46 variants. The left half plots each published method's score (gray) next to the selected recipe's 0.953 (teal) on a zoomed axis that does not start at 0. The right half shows each score difference and its 95 percent resampling interval. The interval crosses zero for ESM-1v Embeddings and excludes zero for the other two comparators. These intervals describe the selected predictions and do not correct for adaptive test-score selection. An interval crossing zero does not establish equivalence. Rows name each method as ProteinGym lists it.

A much smaller language model

Nextflow Frontier used ESM-2 with 8 million parameters. ESM-1v Embeddings used an ESM-1v checkpoint with about 650 million, around 80 times as many. This compares the language-model components, not measured runtime or cost.

Bar chart of language-model parameters: ESM-2 used by Nextflow Frontier, 8 million, against ESM-1v, the language model in ESM-1v Embeddings, 650 million

Figure 5The language model inside Nextflow Frontier's model has about one eightieth of the parameters of the one ESM-1v Embeddings reads. Bars compare the language-model components only, not the complete predictors: teal for Nextflow Frontier's, gray for ESM-1v Embeddings'. ESM means Evolutionary Scale Modeling.

What the result does and does not show

Nextflow Frontier selected the highest-scoring of its 1,012 attempts on the hidden variants and used those same scores to tune the recipe’s training settings. Selecting the best of many scores on a small test tends to overstate performance on new variants. Random starting values also affect training, so the same recipe can score differently each time it trains.

We retrained the selected recipe on the original software with 19 random starting values, the original one and 18 new ones. On the same 46 hidden variants, the scores average 0.934 and range from 0.918 to 0.958, on both sides of ESM-1v Embeddings’ 0.940. Only one start in 19 reaches the selected score of 0.953. The average is about 0.02 lower. The reruns show how much training varies and why the best search score should not be treated as the recipe’s typical performance.

The test covers one domain and one group of 46 hidden variants. We recorded the run on 1 October 2026. It subsequently stopped without producing a better result. This test does not establish performance on other proteins.

The search does not isolate the effect of fine-tuning. The best approaches without it scored 0.939 and 0.938, too close to 0.955 to distinguish. An independent audit found no recorded access to hidden measurements in the evidence it inspected. That finding does not establish complete isolation or remove the effect of repeated test feedback.

What the reruns show

Nextflow Frontier also tried retraining with new starting values, using different training settings that it had not tuned. Those settings scored about 0.82. We therefore reran the selected recipe to test how it performed across starts.

We also tested the recipe under the benchmark’s full protocol. For each start, we trained it five times, holding out a different group each time, and scored all 195 predictions together. Individual starts average 0.894, and 17 of the 19 score below ESM-1v Embeddings’ published 0.906.

Averaging predictions from all 19 starts raises the score to 0.913. The 95 percent range for the difference from ESM-1v Embeddings runs from minus 0.022 to plus 0.036. It includes zero, so the comparison establishes neither a lead nor equivalence. Averaged predictions score slightly above the reference, while individual starts score slightly below on average.

We chose to average predictions after seeing the variation across starts. We fixed that rule before scoring and included every start. The full protocol still includes the hidden group whose scores guided the choice of settings. Training and scoring only on the other four groups leaves that group out of the comparison. It gives 0.903 against 0.899 for ESM-1v Embeddings, again close.

Summary

Nextflow Frontier trained a small protein model that ranked unseen variants correctly in about 91 of every 100 pairs, compared with 89 for ESM-1v Embeddings. Under the benchmark’s five-group protocol, averaging predictions over 19 random starts gives 0.913 against 0.906 on all 195 published variants. The difference is too small to establish a lead. Nextflow Frontier reached these scores with a language model that has about one eightieth as many parameters as ESM-1v.

A lab could try this approach with about 150 measurements from its own protein and use the model to rank length-changing edits before making them at the bench. Testing it on other proteins would show how well it carries over.

Bring Nextflow Frontier a computational problem and a way to evaluate its answers. It can search approaches, run them as reproducible workflows and help you decide which results are worth testing further.

References

Interested in Nextflow Frontier?

Nextflow Frontier is a closed-loop discovery system built on Nextflow. It designs computational experiments, runs each one as a reproducible pipeline and learns from every result’s score what to try next, under the supervision of scientists.

Learn more

Filed under Protein engineering

All posts
All posts
  1. Introducing Nextflow Frontier

  2. Drug discovery

    Ranking molecules for a cancer drug target

  3. Biomedical imaging

    Forecasting lung decline from a single CT scan