Introduction
Deep Neural Networks (DNNs) in Natural Language Processing (NLP) are highly susceptible to adversarial examples—inputs modified by subtle, human-imperceptible changes that cause the model to make incorrect predictions. To mitigate this, Adversarial Example Detection (AED) modules have been developed. However, current AED methods often rely on a "shortcut": they exploit the fact that standard adversarial attacks typically stop as soon as a prediction flips, leaving the example near the decision boundary where model confidence is naturally low.
The Far-Boundary Shortcut
This paper identifies a critical vulnerability in existing detectors: Far-Boundary (FB) attacks. Unlike standard attacks, FB attacks continue to optimize the input until the model becomes highly confident in its erroneous prediction. In these scenarios, state-of-the-art detectors often fail, sometimes performing worse than random chance because they have learned to equate low confidence with adversariality.
As shown in the heatmaps above, while natural examples cluster in low-uncertainty regions, adversarial examples—especially Far-Boundary ones—exhibit distinct shifts in their uncertainty profiles that simple confidence scores fail to capture.
The ADDMU Framework
To address this, the authors propose ADDMU (Adversary Detection with Data and Model Uncertainty). ADDMU identifies malicious inputs by aggregating two types of statistical signals:
- Model Uncertainty (MU): Estimated via Monte Carlo Dropout (MCD), this measures the variance in model predictions across multiple inference passes with active dropout. High variance indicates the model is internally unstable regarding the input.
- Data Uncertainty (DU): This measures sensitivity to local input perturbations. ADDMU generates "neighbors" by randomly masking tokens; if the prediction changes significantly, the input likely lies off the natural data manifold.
ADDMU combines these signals using p-value normalization and Fisher’s method, creating a robust test statistic that remains effective even if an attacker manages to minimize one type of uncertainty.
Experimental Evaluation and Results
The framework was evaluated on four benchmarks (SST-2, Yelp, AGNews, SNLI) against several attack methods, including TextFooler and Pruthi.
Key findings include:
- Superior Robustness: ADDMU outperformed existing SOTA methods (like RDE and DIST) by 3.6 AUC points on regular attacks and 6.0 AUC points on Far-Boundary attacks.
- Resilience to FB Attacks: While baseline detectors saw performance drop significantly against FB attacks (often falling below 50% F1), ADDMU maintained high accuracy, often exceeding 90%.
- Informative Data Selection: The MU/DU metrics can also guide Adversarial Data Augmentation (ADA). Examples with low DU but high MU were found to be the most beneficial for retraining models to improve overall robustness.
Conclusion
ADDMU provides a significant step forward in securing NLP models against stealthy adversarial attacks. By moving beyond simple confidence scores and leveraging the complementary nature of model and data uncertainty, it offers a robust defense that persists even when attackers specifically target high-confidence regions. Future work will explore extending this framework to generative tasks and further optimizing computational efficiency for real-time applications.
Summary updated