Iterative attack-and-defend framework for improving TCR-epitope binding prediction models

Pengfei Zhang, Hao Mei, Seojin Bang, Heewook LeeBioinformatics 2025

TL;DR

This paper introduces an "attack-and-defend" framework to improve TCR-epitope binding prediction models. By iteratively generating biologically implausible sequences that fool existing models and then using these "false positives" to retrain them, the authors significantly enhance model robustness and reduce prediction errors. This approach addresses a critical data scarcity issue in training these models, leading to more reliable predictions for applications like T-cell therapies.

What Problem Does This Paper Address?

Accurately predicting how T-cell receptors (TCRs) bind to specific epitopes (parts of antigens) is crucial for developing advanced immunotherapies and vaccines. However, current prediction models often struggle with "false positives" – incorrectly identifying non-binding TCR-epitope pairs as binders. This issue is largely due to a lack of diverse and comprehensive negative training data. Existing methods for generating negative samples, like shuffling sequences or using healthy repertoires, don't fully capture the complexities of real-world non-binding interactions and can lead to models that are easily deceived by biologically implausible sequences. The paper aims to tackle this by systematically identifying and rectifying these model weaknesses.

Methods

The core of this work is an iterative attack-and-defend framework.

  • Attack Phase: This phase uses a Reinforcement Learning from AI Feedback (RLAIF) approach. A TCR generation model (acting as the "policy") is trained to produce TCR sequences that maximize the "reward" signal from a target TCR-epitope binding prediction model (the "reward model"). This reward signal is derived from the raw logit outputs of the prediction model, encouraging the generator to create sequences that the prediction model confidently labels as binding.
  • False Positive Identification: Sequences generated during the attack phase are then evaluated for biological plausibility using two methods:
  • TCRMatch: A k-mer based sequence comparison method that checks similarity to known binding TCRs. Low similarity suggests potential non-binding.
  • GPT-LL: A transformer-based language model trained on authentic TCR sequences, which outputs a log-likelihood score indicating authenticity. Low scores suggest implausibility. Sequences that score high on the binding prediction model but low on authenticity metrics are flagged as false positives.

  • Defense Phase: The identified false positives are combined with existing positive binding pairs, negative shuffle pairs, and negative healthy pairs to create a refined, comprehensive training dataset. The original TCR-epitope binding prediction model is then fine-tuned on this augmented dataset.

This attack-defend cycle is repeated iteratively. The process stops when attacks no longer generate significant false positives, indicating the model has become more robust.

Datasets

  • Labeled TCR-Epitope Pairs:
    • Positive Pairs: Collected from VDJdb, IEDB, and McPAS databases, resulting in 150,008 experimentally validated binding pairs.
  • Negative Shuffle Pairs: Created by shuffling TCRs from known binding pairs with different epitopes.
  • Negative Healthy Pairs: Generated by pairing epitopes with TCR sequences randomly sampled from healthy repertoires. These datasets were split for training/evaluating BAP models (64% train, 16% pool, 20% test) and for fine-tuning the TCR generation model (80% train, 20% test).

  • Unlabeled TCR Sequences: 4 million TCR sequences from healthy repertoires were used to train the GPT-LL model for authenticity assessment.

A newly curated adversarial negative dataset is a key output of this work, generated through the iterative attack-and-defend process across multiple models.

Key Insights and Ideas

  • RLAIF for Adversarial Generation: The paper ingeniously repurposes RLAIF, typically used to reduce model "hallucinations," to deliberately generate them. This allows for the systematic discovery of model weaknesses.
  • "Harder" False Positives: The iterative nature of the framework leads to the discovery of increasingly sophisticated false positives – sequences that are not just obviously implausible but also subtly mimic real TCRs, making them harder for models to reject.
  • Universality of Vulnerability: The study demonstrates that even diverse BAP models (varying in architecture and embedding strategies) are susceptible to these adversarial attacks, highlighting a common challenge in the field.
  • Data Augmentation is Key: The research strongly suggests that improving negative data curation, rather than solely focusing on model architecture, is a critical path to enhancing TCR-epitope binding prediction robustness.

Key Results

  • Reduced False Positives: The iterative attack-and-defend framework significantly reduced the number of false positives generated by the models, with negligible amounts remaining by the third iteration.
  • Improved Robustness: Fine-tuning with the adversarial negative dataset led to substantial improvements in model performance on adversarial negative data, reducing misclassification rates to below 10% (and often under 5%) for most models, outperforming heuristic filtering alone.
  • Stable Performance on Real Data: Crucially, the fine-tuned models maintained or improved performance on positive, negative shuffle, and negative healthy datasets, indicating that robustness was gained without sacrificing accuracy on standard data.
  • Model-Agnostic Improvement: The framework successfully improved five different BAP models, showcasing its broad applicability.

Limitations and Future Work

  • Model-Specific Optimization: While the framework is generally applicable, the degree of improvement varied across models. The authors suggest future work could involve systematically characterizing these differences to optimize attack-and-defend strategies for specific architectures.
  • Paired-Chain TCRs: The current work focuses on single TCR chains. Extending the framework to paired-chain TCR models is identified as a promising future direction.
  • Adaptability to Other Domains: The authors believe the framework's core principles can be adapted to other biological problems where negative sampling is challenging, such as antibody or small molecule binding prediction.

Summary updated

BibTeX
@article{zhang2025iterative,
  author = {Pengfei Zhang and Hao Mei and Seojin Bang and Heewook Lee},
  title = {{Iterative attack-and-defend framework for improving TCR-epitope binding prediction models}},
  journal = {Bioinformatics},
  year = {2025},
  doi = {10.1093/bioinformatics/btaf224},
}
Figure