Abstract
Adversarial attacks in Natural Language Processing (NLP) pose significant security risks by intentionally causing models to misclassify inputs. While most research focuses on binary attack detection, this paper introduces AACTA (Attacker Attribute Classification via Textual Analysis), a framework designed to identify the "who" and "how" behind an attack. By analyzing the internal latent representations of NLP models, AACTA can determine an attacker's access level, perturbation strategy, and specific manipulated tokens. Our results show that models' internal activations contain distinct signatures of adversarial intent, allowing for high-accuracy attribute classification and effective attack localization.
Introduction
Adversarial attacks—small, intentional changes to text that cause misclassification—are a growing concern for NLP systems. Current defense strategies primarily focus on detection: a simple binary classification of "clean" versus "perturbed." However, effective defense requires more than just detection; it requires understanding the threat's nature. Knowing whether an attacker has "white-box" knowledge of model weights or "black-box" access to outputs significantly alters the necessary security response. This paper treats adversarial text as a "crime scene," extracting interpretable traces from a model's internal activations to profile the attacker.
The AACTA Framework
The authors propose four primary sub-tasks within the AACTA framework to provide a comprehensive view of an adversarial attempt:
- Access Level Estimation: Determining if the attack was black-box or white-box.
- Perturbation Type Analysis: Identifying if changes occurred at the word or character level.
- Evasion Mechanism Determination: Detecting the use of linguistic constraints intended to maintain human readability.
- Attack Localization: Pinpointing the specific tokens that were altered.
To achieve this, the framework evaluates two types of signals: standard sentence-level embeddings from a pre-trained BERT model and Target Model Activations (layer-wise mean and variance of node activations from the model under attack). Localization is performed using token-level logistic regression for BERT signals and a LIME-based approach for activation signals.
Experimental Setup
The framework was evaluated across several dimensions:
- Models: BERT, RoBERTa, and XLNet.
- Tasks: Abuse detection (Hatebase, Civil Comments, Wikipedia) and sentiment analysis (SST, Twitter Climate Change).
- Attacks: 11 different algorithms (e.g., TextFooler, BAE, DeepWordBug) from OpenAttack and TextAttack libraries were used to generate a diverse set of adversarial "fingerprints."
Key Insights: Models "Know" Their Attackers
A primary finding is that a model's internal "brain states" change predictably in response to specific attack methods. Adversarial perturbations are not merely noise; they leave distinct statistical signatures in the model's activations.
Interestingly, target model activations often outperformed BERT embeddings for classification. While BERT is trained on "clean" natural language, adversarial perturbations—particularly character-level ones—are "out-of-distribution" for it. In contrast, the target model's activations directly capture the "shock" of the malicious input. Furthermore, adversarial tokens are frequently rare words; activation-based signals, fine-tuned to the specific task, provide a clearer signal of these anomalies than general-purpose BERT embeddings.
Results and Performance
The AACTA system demonstrated robust performance across all sub-tasks:
- Attribute Accuracy: The framework achieved 74% accuracy in identifying access levels, 75% for perturbation types, and 78% for evasion mechanisms.
- Localization: The BERT-based localizer achieved a 0.74 F1-score in identifying perturbed tokens, significantly outperforming random baselines.
- Generalization: While activation-based models are more accurate for specific target models, BERT-based classifiers generalize better to unseen datasets, capturing more "universal" properties of adversarial text.
Limitations and Future Work
Despite its success, AACTA faces challenges. Activation-based models struggle with out-of-domain data, as they are highly specialized to the training distribution. Additionally, real-world "noise"—such as URLs, handles, or non-standard punctuation—can be mistaken for adversarial perturbations. Future research aims to use AACTA to "fingerprint" specific attack libraries, potentially identifying the exact open-source tools used by an attacker in real-time.
Summary updated