[Paper Review] Identifying Adversarial Attacks on Text Classifiers
This paper introduces a novel approach to identifying adversarial attacks on text classifiers by analyzing features of perturbed text, using a new benchmark dataset (TCAB) with 1.5 million attack instances. It demonstrates that combining text, language model, and target model features (TLC) enables accurate detection and identification of attacks with up to 97% accuracy, even when generalizing to unseen attacks.
The landscape of adversarial attacks against text classifiers continues to grow, with new attacks developed every year and many of them available in standard toolkits, such as TextAttack and OpenAttack. In response, there is a growing body of work on robust learning, which reduces vulnerability to these attacks, though sometimes at a high cost in compute time or accuracy. In this paper, we take an alternate approach -- we attempt to understand the attacker by analyzing adversarial text to determine which methods were used to create it. Our first contribution is an extensive dataset for attack detection and labeling: 1.5~million attack instances, generated by twelve adversarial attacks targeting three classifiers trained on six source datasets for sentiment analysis and abuse detection in English. As our second contribution, we use this dataset to develop and benchmark a number of classifiers for attack identification -- determining if a given text has been adversarially manipulated and by which attack. As a third contribution, we demonstrate the effectiveness of three classes of features for these tasks: text properties, capturing content and presentation of text; language model properties, determining which tokens are more or less probable throughout the input; and target model properties, representing how the text classifier is influenced by the attack, including internal node activations. Overall, this represents a first step towards forensics for adversarial attacks against text classifiers.
Motivation & Objective
- To address the growing threat of adversarial attacks on NLP models by identifying which attack method was used to generate a given text.
- To develop a comprehensive benchmark dataset (TCAB) for training and evaluating attack identification models.
- To investigate the effectiveness of three feature classes—text properties, language model properties, and target model properties—for distinguishing between different adversarial attack methods.
- To enable forensic analysis of adversarial attacks to support defense strategies and detect malicious actors in real-world applications.
- To demonstrate generalization of attack identification models to unseen attacks, improving robustness in practical deployment.
Proposed method
- The authors construct the Text Classification Attack Benchmark (TCAB), comprising 1.5 million adversarial examples generated by 12 attacks on 3 transformer-based classifiers across 6 datasets for sentiment and abuse detection.
- They extract three types of features: text properties (e.g., word length, punctuation, non-ASCII characters), language model properties (e.g., token probability, perplexity), and target model properties (e.g., internal activations, gradients, saliency).
- The features are combined with BERT embeddings and used to train linear and tree-ensemble classifiers for attack detection and identification.
- The model is evaluated under both in-domain and out-of-domain settings, testing generalization to unseen attacks.
- A feature ablation study is conducted to assess the contribution of each feature type to attack identification performance.
- The dataset and code are released publicly to support future research and model expansion.
Experimental results
Research questions
- RQ1Can adversarial attacks be accurately identified using a combination of text, language model, and model-specific features?
- RQ2How well do attack identification models generalize to attacks not seen during training?
- RQ3Which feature types—text properties, language model properties, or target model properties—contribute most to attack identification performance?
- RQ4Can attack identification be used as a forensic tool to trace malicious actors or campaigns in social media and misinformation contexts?
- RQ5What is the upper bound of performance for attack identification when the target model used in training matches or differs from the one used in inference?
Key findings
- Attack detection (determining if any attack is present) achieves 84–97% accuracy when the target model used to generate the attack matches the one used for feature extraction.
- Attack detection accuracy drops to 83–91% when the target model differs between training and inference, indicating strong generalization capability.
- The model generalizes effectively to unseen attacks, with detection performance remaining high even when the attack type was not in the training set.
- Text properties (T), language model properties (L), and target model properties (C) collectively form the TLC feature set, which significantly improves attack identification over baseline methods.
- Among the three feature types, target model properties (C) contribute the most to identification performance, followed by language model properties (L) and text properties (T).
- The best-performing model achieves 97% accuracy in attack identification on the SST-2 dataset when using in-domain target models, demonstrating high effectiveness of the proposed approach.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.