Probabilistic thermal stability prediction through sparsity promoting transformer representation

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

TL;DR

Standard approaches to protein property prediction flatten pre-trained transformer embeddings using uniform mean pooling, treating every amino acid position as equally important. This paper demonstrates that replacing mean pooling with learned, sparsity-promoting positional masks combined with Gaussian Process (GP) regression yields highly accurate melting temperature ($T_m$) predictions ($0.226^\circ\text{C}$ MAE) while providing critical Bayesian uncertainty estimates to guide drug design.

What Problem Does This Paper Address?

Single-chain variable fragments (scFvs) are vital building blocks for multi-specific therapeutic antibodies, but they frequently suffer from poor thermal stability and aggregation. Optimizing their melting temperature ($T_m$) via experimental directed evolution is constrained by low-throughput biophysical assays and an astronomically large sequence space (e.g., $10^{130}$ possibilities for a 100-residue chain).

Machine learning can guide this search, but standard pipelines face two core issues:

  1. Information loss via mean pooling: Typical protein language model representations average hidden states across all sequence positions, diluting the localized mutation signals that actually drive stability.
  2. Deterministic overconfidence: Standard regressors lack calibrated uncertainty estimates, which are essential for active learning and Bayesian optimization when balancing sequence exploration with exploitation.

Methods

The authors extract per-residue embeddings ($\mathbf{x} \in \mathbb{R}^{250 \times 1280}$) from the pre-trained ESM-1b transformer model for each antibody variant, then route them into a Gaussian Process (GP) regression model with a Matérn $\frac{5}{2}$ kernel.

Rather than averaging embeddings uniformly across all sequence positions $p \in \{1, \dots, P\}$, the authors introduce three positional weighting schemes learned directly during GP maximum marginal log-likelihood optimization:

  • Positively constrained learned mask: Normalizes weights via an exponent: $\hat{\mathbf{x}}_l = \frac{\sum \exp(w_{lp})\mathbf{x}_p}{\sum \exp(w_l)}$.
  • Sigmoid-transformed mask: Induces sparsity via the logistic function: $\hat{\mathbf{x}}_s = \frac{\sum S(w_{sp})\mathbf{x}_p}{\sum S(w_s)}$.
  • Half-Cauchy prior-based mask: Regularizes weights with a heavy-tailed prior $w_p \sim \text{Half-Cauchy}(0, \sigma)$, preventing overly aggressive zeroing of non-mutated residues while promoting structured sparsity.

Datasets

  • Experimental Data: An internal dataset of scFv antibody variants with thermal stability ($T_m$) measured by nano differential scanning fluorimetry (nanoDSF).
  • Data Splits:
  • Total dataset consists of a training set ($N_{\text{train}} = 147$, containing 80 single-point mutations and 67 multi-site variants with 1–5 mutations) and a dedicated hold-out test set ($N_{\text{test}} = 35$).
  • Experiments evaluate three validation splits: 1-MUT Shuffle (validation on 10 single-site variants), Uniform Shuffle (random validation split of 24 variants), and the independent Hold-out Test Set.

Key Insights and Ideas

  • Not all residues matter equally: Thermal stability is governed by a small subset of structural contacts. Weighting positions explicitly enables the downstream GP to focus on residues that drive stability.
  • Prior-controlled sparsity prevents blind spots: Standard learned and sigmoid masks set over 200 out of 250 positions to near-zero ($< 10^{-5}$). In contrast, the Half-Cauchy prior keeps all but 9 positions softly active. This modest density acts as a safeguard, ensuring the model retains general sequence context when evaluating mutations at novel positions.
  • Uncertainty highlights additive blind spots: Training exclusively on single-site mutations fails to predict the magnitude of multi-mutation stability (systematically underestimating $T_m$), but the GP's predictive variance correctly widens on multi-mutant variants, reliably signaling that the model is in unfamiliar sequence territory.

Key Results

  • Hold-Out Test Set Performance: All three learned masking techniques significantly outperformed the uniform baseline ($p < 0.05$ over 64 trials):
  • Baseline (Mean Pooling): $\text{MAE} = 0.273 \pm 0.006^\circ\text{C}$
  • Learned Mask: $\text{MAE} = 0.227 \pm 0.010^\circ\text{C}$
  • Sigmoid Mask: $\text{MAE} = 0.227 \pm 0.008^\circ\text{C}$
  • Half-Cauchy Prior Mask: $\mathbf{MAE = 0.226 \pm 0.010^\circ\text{C}}$
  • Cross-Validation Diagnostics: On splits where the validation set introduced mutations at residue positions unseen in training (e.g., Uniform Shuffle), overly sparse masks slightly degraded performance relative to baseline ($0.841^\circ\text{C}$ vs. $0.819^\circ\text{C}$ MAE), confirming that aggressive sparsity must be tempered when generalizing out-of-distribution.

Limitations and Future Work

  • Sensitivity to Out-of-Distribution Positions: If a test sequence mutates positions that were zeroed out during training on small datasets, performance degrades because the model ignores the mutated site.
  • Limited to Mean Prediction: The current study evaluates point-prediction metrics (MAE) rather than closed-loop discovery.
  • Future Work: The authors plan to embed this sparse GP representation into a full Bayesian optimization pipeline, leveraging acquisition functions like Upper Confidence Bound (UCB) to steer sequence space exploration toward unobserved, high-uncertainty regions.

Summary updated

BibTeX
@inproceedings{zainchkovskyy2022probabilistic,
  author = {Yevgen Zainchkovskyy and Jesper Ferkinghoff-Borg and Anja Bennett and Thomas Egebjerg and Nikolai Lorenzen and Per Jr. Greisen 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