CT-GAT: Cross-Task Generative Adversarial Attack based on Transferability

Minxuan Lv, Chengwei Dai, Kun Li, Wei Zhou, Songlin Hu

Abstract

Neural network models are vulnerable to adversarial examples, and adversarial transferability further increases the risk of adversarial attacks. Current methods based on transferability often rely on substitute models, which can be impractical and costly in real-world scenarios due to the unavailability of training data and the victim model’s structural details. In this paper, we propose a novel approach that directly constructs adversarial examples by extracting transferable features across various tasks. Our key insight is that adversarial transferability can extend across different tasks. Specifically, we train a sequence-to-sequence generative model named CT-GAT (Cross-Task Generative Adversarial Attack) using adversarial sample data collected from multiple tasks to acquire universal adversarial features and generate adversarial examples for different tasks. We conduct experiments on ten distinct datasets, and the results demonstrate that our method achieves superior attack performance with small cost.

Introduction

Deep learning models for Natural Language Processing (NLP) are notoriously fragile. Small, intentional changes to input text—called adversarial examples—can trick a model into making wrong predictions, such as causing a hate speech detector to miss a slur by swapping a few characters.

Currently, most "black-box" attacks (where the attacker doesn't know the model's internals) rely on transferability: training a "substitute" model on the same task, attacking it, and hoping the same tricks work on the victim model. However, this is often impractical because the attacker might not have the victim's training data or know exactly what task the victim is performing. CT-GAT addresses this by asking: Can we learn to attack a model by looking at successful attacks across entirely different tasks?

Methodology

The authors introduce CT-GAT, which treats adversarial attacking as a translation problem using a sequence-to-sequence (seq2seq) model based on BART.

The CT-GAT framework showing training and using stages.

As illustrated in the framework above, the process involves two main stages:

  1. Training Stage: The model is trained on a massive collection of successful adversarial examples harvested from various tasks (like sentiment analysis and hate speech detection) using multiple existing attack methods. This allows the generator to learn "universal" patterns of vulnerability—such as which words are most sensitive to change.
  2. Using Stage: Once trained, CT-GAT can generate adversarial versions of new, unseen text. Because it has learned general features of "adversarial-ness," it can attack a new victim model without needing feedback or queries during the generation process.

Additionally, the authors developed Cross-task Adversarial Word Replacement (CAWR) rules to identify and extract highly transferable word-substitution patterns across different domains.

Experimental Setup

The model was trained using the TCAB (Text Classification Attack Benchmark) dataset, which contains adversarial examples for tasks like hate speech detection and sentiment analysis. Evaluation was conducted on ten distinct datasets from the Advbench framework, covering misinformation (LUN), toxic content (Founta, Jigsaw2018), spam (SpamAssassin), and sensitive information detection (EDENCE, CGFake).

Results and Discussion

The most striking insight is that adversarial features are transferable not just between models on the same task, but across different tasks. A word that confuses a sentiment classifier often confuses a toxicity detector as well.

Attack Success Rate (ASR) vs. query times on a sample dataset.

Key results include:

  • Attack Success Rate (ASR): CT-GAT achieved the highest ASR on the majority of the ten datasets, often exceeding 90% success in a total black-box setting.
  • Query Efficiency: Traditional attacks use "greedy" algorithms that are slow and query-intensive. CT-GAT’s generative approach is "one-shot," producing adversarial text instantly. It often required 30% to 90% fewer queries than baselines. For example, on the CGFake dataset, CT-GAT achieved a 99.2% ASR with only 6.38 queries on average, compared to BERT-Attack’s 400 queries.
  • Vulnerable Word Consistency: Significant overlap in "vulnerable words" was found across different model architectures (BERT, RoBERTa, XLNet), suggesting that model vulnerabilities are often rooted in the statistical properties of the language data itself.

Conclusion

While CT-GAT is highly effective, its performance may degrade if the victim model performs a task wildly different from those in the training set. Future work may involve adding a real-time feedback loop to the generator. Beyond attacks, the authors demonstrate that CT-GAT can be used for defense by "cleansing" adversarial text, mapping it back to its clean version to build more robust NLP systems.

Summary updated

BibTeX
@inproceedings{lv2023ct,
  author = {Minxuan Lv and Chengwei Dai and Kun Li and Wei Zhou and Songlin Hu},
  title = {{CT-GAT: Cross-Task Generative Adversarial Attack based on Transferability}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=0fPWCsw4la},
}
Figure