Exploring Adversarial Robustness in Classification tasks using DNA Language Models

Hyunwoo Yoo, Haebin Shin, Kaidi Xu, Gail Rosen

TL;DR

This paper investigates the vulnerability of DNA language models to adversarial attacks, finding they are surprisingly susceptible. The authors introduce new attack methods at the codon and back-translation levels, demonstrating that these models degrade significantly under attack. Crucially, they show that adversarial training can effectively improve robustness, making these models more reliable for real-world bioinformatics applications.

What Problem Does This Paper Address?

DNA language models, inspired by their success in natural language processing, are increasingly used for critical tasks in bioinformatics, such as classifying antimicrobial resistance genes or identifying gene promoters. These models treat DNA sequences as text, leveraging their ability to understand context and patterns. However, real-world DNA data is inherently noisy due to sequencing errors, mutations, and laboratory artifacts. This noise can significantly impact model performance. While adversarial attacks are well-studied in NLP, their effect on DNA language models remains largely unexplored. This paper aims to fill this gap by systematically evaluating the robustness of these models against various adversarial attacks and exploring potential defense mechanisms.

Methods

The researchers employed a multi-pronged approach to assess the adversarial robustness of DNA language models:

  • Novel Attack Strategies: Beyond standard nucleotide-level (character-level) substitutions, they introduced:
  • Codon-level attacks: Perturbing three-nucleotide codons, which are the basic units for protein synthesis.
  • Back-translation attacks: A sentence-level approach that translates DNA sequences to amino acids and back, aiming to preserve biological meaning while altering the sequence.
  • Systematic Evaluation: These attacks were applied across different granularities (nucleotide, codon, back-translation) to analyze model vulnerabilities.
  • Defense Mechanism: They explored adversarial training as a defense strategy, where models are trained on both original and adversarially perturbed data to improve their resilience.
  • Model Comparison: The study evaluated three prominent DNA language models: DNABERT2, Nucleotide Transformer, and GROVER, allowing for comparisons based on architecture and pretraining scale.

Datasets

The study utilized two primary benchmarks for evaluation:

  • Antimicrobial Resistance (AMR) Gene Classification: This dataset, derived from CARD v2 and MEGARes v3, focuses on classifying AMR genes based on drug classes. The data was split into training (75%), testing (20%), and validation (5%) sets, with classes having fewer than 15 instances excluded.
  • Promoter Detection: This dataset, from the Genome Understanding Evaluation (GUE) benchmark, is used to identify DNA sequences that initiate gene transcription. It includes complex promoter elements and is split into approximately 80% training, 10% development, and 10% test data, with two classes for binary classification.

Key Insights and Ideas

  • DNA Models are Surprisingly Fragile: Despite their sophisticated architectures, DNA language models are highly susceptible to adversarial perturbations, leading to significant performance drops. This highlights a critical gap between their performance on clean data and their reliability in real-world, noisy biological environments.
  • Granularity Matters: While nucleotide-level attacks are most effective at degrading performance, they can also introduce biologically implausible changes. Codon-level and back-translation attacks offer a more nuanced approach, with back-translation being particularly adept at preserving biological semantics while still impacting model predictions.
  • Adversarial Training is a Promising Defense: Even a simple adversarial training strategy can significantly enhance the robustness of DNA language models, often improving both accuracy and resilience to attacks. This suggests a practical pathway to building more reliable bioinformatics tools.
  • Model Architecture and Scale Influence Robustness: The Nucleotide Transformer and GROVER generally showed greater robustness than DNABERT2, potentially due to their larger model capacities or more extensive pretraining. This indicates that architectural choices play a role in adversarial resilience.

Key Results

  • Significant Performance Degradation: Adversarial attacks, particularly nucleotide-level ones, caused substantial drops in accuracy for all tested DNA language models on both AMR gene classification and promoter detection tasks. For instance, in AMR classification, accuracy dropped to as low as 31.76% under high perturbation levels.
  • Back-translation Preserves Semantics: Back-translation attacks were effective in degrading performance while maintaining a higher degree of biological semantic preservation compared to nucleotide-level attacks.
  • Adversarial Training Improves Robustness: Adversarially trained models consistently showed slower accuracy degradation and lower attack success rates compared to conventionally trained models across various attack types and iterations. In some cases, adversarial training even led to higher accuracy than standard training.
  • Model Comparison: Nucleotide Transformer and GROVER demonstrated superior robustness compared to DNABERT2, especially against back-translation attacks.

Limitations and Future Work

  • Dataset Limitations: The study acknowledges that the datasets used (AMR classification and promoter detection) are limited. Expanding experiments to include more diverse AMR gene families or mechanisms, as well as a broader range of DNA classification tasks, would provide a more comprehensive evaluation.
  • Model Scope: While three prominent models were evaluated, extending the analysis to other DNA classification models could offer further insights into model-specific robustness.
  • Realistic Noise: The paper briefly touches upon realistic sequencing errors, noting that they can also degrade performance. Future work could more deeply integrate these realistic noise models with adversarial attacks to better simulate real-world conditions.
  • General-Purpose LLMs: The authors suggest further investigation into the adversarial robustness of general-purpose Large Language Models (LLMs) when adapted for biological sequence classification.

The study underscores the critical need for robust DNA language models, especially as they are increasingly deployed in sensitive applications. Adversarial training is presented as a key strategy to bridge the gap between theoretical performance and practical reliability.

Summary updated

BibTeX
@inproceedings{yoo2025exploring,
  author = {Hyunwoo Yoo and Haebin Shin and Kaidi Xu and Gail Rosen},
  title = {{Exploring Adversarial Robustness in Classification tasks using DNA Language Models}},
  booktitle = {GenBio @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=6K9WN3MzcP},
}
Figure