Sample Attackability in Natural Language Adversarial Attacks

Vyas Raina, Mark Gales

TL;DR

This paper introduces the concept of "sample attackability" to natural language processing (NLP), defining it as how easily a specific input can be manipulated by adversarial attacks. They propose a deep learning-based detector that significantly outperforms uncertainty-based methods in identifying these vulnerable samples, but find its effectiveness is limited to the specific attack method it was trained on.

What Problem Does This Paper Address?

As natural language processing (NLP) models like Transformers achieve impressive performance, they also become susceptible to adversarial attacks. These attacks involve making subtle, often imperceptible changes to input text that cause models to misclassify. While much research focuses on creating stronger attacks or defenses, there's a gap in understanding which specific input samples are inherently more vulnerable to these attacks. Knowing this could be crucial for tasks like active learning (selecting the most informative samples for training) or weighted adversarial training (focusing training on the most impactful adversarial examples). This paper aims to formally define and address the problem of identifying "sample attackability" in NLP.

Methods

The core of this work is the formalization of "sample attackability" for NLP. Building on prior work in image domains, they define it based on the minimum perturbation size required to change a model's prediction. Since directly calculating this is computationally expensive, they propose a deep learning-based attackability detector. This detector is trained on "seen" models and their corresponding attackability labels to predict the attackability of samples for an "unseen" target model. They also compare this to simpler uncertainty-based detectors that use model confidence or entropy as a proxy for attackability.

Datasets

  • Stanford Sentiment Treebank 2 (SST2): A movie review dataset for sentiment classification (positive/negative).
  • Twitter Emotions dataset: A dataset categorizing tweets into six emotions (sadness, love, anger, surprise, joy, fear).

The paper uses validation sets for training attackability detectors and test sets for evaluation.

Key Insights and Ideas

  • Sample attackability is more than just uncertainty: Simple measures like model confidence or entropy are insufficient for accurately characterizing which samples are most attackable or robust.
  • Deep learning detectors excel: A dedicated deep learning model trained to identify attackable samples significantly outperforms uncertainty-based methods, especially when the attack method used for evaluation is known during training.
  • Attack method matters greatly: The attackability of a sample is highly dependent on the specific adversarial attack method used. This is attributed to differences in pre-transformation constraints (e.g., preventing stopword changes, allowing only synonym swaps) which define the "available set" of adversarial examples for a given input.
  • Portability is a challenge: A deep learning attackability detector trained for one attack method does not generalize well to identifying attackable samples for a different, unseen attack method.

Key Results

  • The deep learning-based attackability detector achieved superior performance (measured by F1 scores) compared to uncertainty-based detectors in the "matched setting" (where the attack method used for evaluation was known during training). For instance, in detecting attackable samples, the deep detector consistently outperformed conf-s and conf-u detectors across various evaluation settings.
  • In the "unmatched setting" (where the attack method was unknown), the deep detector's advantage diminished, performing similarly to uncertainty-based methods for attackable sample detection.
  • The paper highlights that even with high fooling rates (around 80%) for individual attack methods, the union of attack methods can achieve nearly 100% fooling rates, underscoring that different methods attack different sets of samples.

Limitations and Future Work

  • Limited to matched settings: The primary limitation is that the deep learning attackability detector's success is largely confined to the specific attack method it was trained on. Its portability to unknown attack methods is poor.
  • Classification tasks only: All experiments were conducted on natural language classification tasks.
  • Future Work: The authors suggest extending these experiments to sequence-to-sequence tasks to provide a more comprehensive evaluation. They also imply that understanding the interplay of imperceptibility constraints across different attack methods is key to improving portability.

Summary updated

BibTeX
@inproceedings{raina2023sample,
  author = {Vyas Raina and Mark Gales},
  title = {{Sample Attackability in Natural Language Adversarial Attacks}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
}
Figure