Adversarial Attacks on Protein Language Models

Ginevra Carbone, Francesca Cuturello, Luca Bortolussi, Alberto CazzanigabioRxiv 2022

Abstract

Deep Learning models for protein structure prediction, such as AlphaFold2, leverage Transformer architectures and their attention mechanism to capture structural and functional properties of amino acid sequences. Despite the high accuracy of predictions, biologically insignificant perturbations of the input sequences, or even single point mutations, can lead to substantially different 3D structures. On the other hand, protein language models are often insensitive to biologically relevant mutations that induce misfolding or dysfunction (e.g., missense mutations). Precisely, predictions of the 3D coordinates do not reveal the structure-disruptive effect of these mutations. Therefore, there is an evident inconsistency between the biological importance of mutations and the resulting change in structural prediction. Inspired by this problem, we introduce the concept of adversarial perturbation of protein sequences in continuous embedding spaces of protein language models. Our method relies on attention scores to detect the most vulnerable amino acid positions in the input sequences. Adversarial mutations are biologically diverse from their references and are able to significantly alter the resulting 3D structures.

Introduction

Deep learning has revolutionized structural biology, with models like AlphaFold2 and various Transformer-based protein Language Models (pLMs) achieving near-experimental accuracy. However, these models exhibit a critical inconsistency: they can be insensitive to biologically disruptive single-point mutations while remaining fragile to insignificant sequence tweaks. This "blind spot" means that high-confidence structural predictions may not reflect the biological reality of a mutation, such as misfolding or dysfunction.

This research addresses this gap by developing a systematic framework for generating "adversarial mutations." By leveraging the internal attention mechanisms of pLMs, we identify sequence perturbations that most effectively deceive these models, exposing vulnerabilities in their representation of protein space.

Methodology

The proposed framework for adversarial attacks on protein sequences involves two primary stages:

1. Identifying Target Positions

The researchers utilize attention scores from pLMs (e.g., ESM-1b, MSA Transformer) to pinpoint "vulnerable" residues. High average attention across model layers often correlates with structurally or functionally critical sites, making these positions ideal candidates for mutation.

2. Selecting Mutant Residues

Once a position is identified, several attack strategies are employed to select the replacement amino acid:

  • Maximum Distance: Maximizes the L1 distance between the original and perturbed embedding in the model's initial layer.
  • Maximum Cosine Similarity: Uses gradient-based methods to push the internal representation in the direction of maximal change.
  • Maximum Contact Map Distance: Maximizes the divergence between predicted 2D contact maps.
  • Maximum Entropy: (Specific to MSA models) Increases uncertainty in sequence alignment.

To ensure biological plausibility, mutations are constrained using BLOSUM matrices, which reflect natural substitution probabilities.

Results and Discussion

The study evaluated adversarial mutations against "natural" mutations from the ProTherm database and other plausible substitutions.

Embedding and Biological Divergence

Adversarial mutations resulted in significantly larger shifts in the model's internal embedding space compared to standard substitutions. As shown in Figure 1, the "max_dist" and other attack strategies create distinct distributions far removed from typical mutations.

Embedding distance distribution showing how adversarial attacks create much larger shifts in the model's internal representation than standard mutations.

Furthermore, these mutations are biologically more "distant" from the reference sequences. Figure 2 illustrates that adversarial perturbations result in higher BLOSUM distances compared to both general substitutions and known experimental mutations from ProTherm.

Blosum distance distributions comparing adversarial mutations against (a) other plausible substitutions and (b) experimental mutations from the ProTherm database.

Structural Impact and the Confidence Trap

When fed into structure prediction pipelines like ColabFold, these adversarial sequences caused substantial structural deviations (measured by metrics such as LDDT, TM-score, and RMSD). Crucially, AlphaFold2 often maintained high confidence (pLDDT) in these incorrect predictions, suggesting that model confidence is an unreliable proxy for biological accuracy in the presence of adversarial noise.

Conclusion

This work demonstrates that protein language models can be systematically "fooled" by targeted mutations at high-attention sites. The finding that models remain overconfident in structurally incorrect predictions highlights a significant limitation in current architectures. Future research will focus on using these adversarial examples to augment training datasets, aiming to develop more robust models that are sensitive to the subtle, yet critical, mutations underlying human disease.

Summary updated

BibTeX
@misc{carbone2022adversarial,
  author = {Ginevra Carbone and Francesca Cuturello and Luca Bortolussi and Alberto Cazzaniga},
  title = {{Adversarial Attacks on Protein Language Models}},
  year = {2022},
  doi = {10.1101/2022.10.24.513465},
  howpublished = {bioRxiv},
}
Figure