Probabilistic thermal stability prediction through sparsity promoting transformer representation

Yevgen Zainchkovskyy, Jesper Ferkinghoff-Borg, Anja Bennett, Thomas Egebjerg, Nikolai Lorenzen, Per Greisen Jr., Søren Hauberg, Carsten Stahlhut · DOI

Abstract

Predicting the thermal stability of proteins is a critical challenge in biopharmaceutical development. While transformer-based protein language models provide rich sequence embeddings, standard mean-pooling techniques often fail to capture the specific "hotspots" that drive stability. This paper introduces a method using learned, sparsity-promoting masks to weight transformer embeddings, combined with Gaussian Process regression. Our approach achieves a mean absolute error of 0.23°C in predicting melting temperatures ($T_m$) for scFv variants while providing robust uncertainty estimates essential for active learning in drug discovery.

Introduction

In the development of protein-based therapeutics, such as antibodies, thermal stability is a primary determinant of efficacy, shelf-life, and manufacturability. Proteins that are not thermally stable are prone to unfolding and aggregation at physiological temperatures or during storage. The melting temperature ($T_m$), the point at which half of the protein population is unfolded, serves as the standard quantitative benchmark for this stability.

Recent advances in protein Large Language Models (LLMs), such as ESM-1b, have enabled the generation of high-dimensional embeddings that capture complex evolutionary and structural information from sequences. However, these models typically produce a vector for every amino acid in a sequence. The conventional approach to creating a single fixed-length representation for a protein is "mean pooling"—averaging the embeddings across all positions. This method assumes that every residue contributes equally to the protein's overall stability, which contradicts biological reality. In practice, stability is often governed by specific structural "hotspots," and averaging treats the signal from these critical residues with the same weight as the noise from unimportant ones.

Methods: Sparsity-Promoting Learned Masks

To address the limitations of mean pooling, we propose a "surgical" approach using learned positional masks. Instead of a uniform average, we apply a weight $w_i$ to each position $i$ in the sequence embedding. We evaluated three distinct masking strategies to identify the most effective way to capture relevant biological signals:

  1. Learned Mask ($w_l$): A basic weight vector with positive constraints applied to each position.
  2. Sigmoid-transformed Mask ($w_s$): This strategy uses a sigmoid function to push weights toward the extremes of 0 or 1, encouraging a sharper selection of residues.
  3. Half-Cauchy Prior Mask ($w_p$): A Bayesian approach that utilizes a Half-Cauchy prior to strongly encourage sparsity. This method effectively "zeros out" positions that do not contribute significantly to the prediction, focusing the model on a sparse set of critical residues.
Comparison of the three learned masking strategies: Basic Learned Mask, Sigmoid-transformed Mask, and the sparsity-promoting Prior Mask.

These weighted embeddings are integrated into a Gaussian Process (GP) regression framework. Unlike deterministic neural networks, GPs are probabilistic models that provide a predictive distribution rather than a single point estimate. This allows the model to output both a predicted $T_m$ and a measure of uncertainty ($2\sigma$), which is vital for assessing the reliability of predictions in a high-stakes drug discovery pipeline.

Experimental Setup and Datasets

The study focused on single-chain variable fragments (scFvs), which are essential modular components in modern antibody engineering. The dataset consisted of:

  • Training/Validation Set: 147 variants of a specific scFv sequence.
  • Test Set: A hold-out set of 35 variants.
  • Target Metric: Experimental $T_m$ values obtained via nano differential scanning fluorimetry (nanoDSF).
  • Mutation Range: Variants included between 1 and 5 mutations relative to the wild-type sequence.

Key Results

The implementation of sparsity-promoting masks led to a significant improvement in predictive accuracy. The model utilizing the Half-Cauchy prior mask emerged as the top performer, achieving a Mean Absolute Error (MAE) of 0.23°C on the independent test set. This represents a substantial improvement over the standard mean-pooling baseline.

Model predictions compared against experimental true targets for various scFv mutants. The error bars represent the $2\sigma$ uncertainty provided by the Gaussian Process.

A critical finding was the model's ability to generalize. Even when trained on a limited subset of single-site mutations, the GP-based model maintained reliable uncertainty estimates. As shown in the results, the model correctly identified higher uncertainty when tasked with predicting complex variants with multiple mutations (e.g., Mutants 34 and 35), demonstrating its utility in flagging "out-of-distribution" sequences.

Discussion and Conclusion

The success of this approach highlights that "sparsity is power" in protein representation learning. By forcing the model to ignore the majority of the protein sequence and focus on key residues, we achieve more robust and biologically grounded predictions. The standard "mean" is often too simplistic for the complex task of stability prediction.

However, there is a trade-off. If a mask is too aggressive, the model may become "blind" to mutations occurring at positions it has silenced during training. This positional overfitting is a key area for future research.

The integration of Gaussian Processes opens the door for Active Learning in protein engineering. Instead of exhaustive lab testing, researchers can use the model's uncertainty to guide an explorative search, prioritizing sequences that are either predicted to be highly stable or likely to provide the most information to refine the model. This probabilistic framework provides a more efficient and reliable path toward the design of stable therapeutic proteins.

Summary updated

BibTeX
@inproceedings{zainchkovskyy2022probabilistic,
  author = {Yevgen Zainchkovskyy and Jesper Ferkinghoff-Borg and Anja Bennett and Thomas Egebjerg and Nikolai Lorenzen and Per Greisen Jr. and Søren Hauberg and Carsten Stahlhut},
  title = {{Probabilistic thermal stability prediction through sparsity promoting transformer representation}},
  booktitle = {RobustSeq @ NeurIPS},
  year = {2022},
  url = {https://openreview.net/forum?id=ZUHPiSbvoX},
}
Figure