Improved and Efficient Text Adversarial Attacks using Target Information

Mahmoud Hossam, Trung Le, He Zhao, Viet Huynh, Dinh PhungarXiv 2021

TL;DR

This paper enhances black-box text adversarial attacks by leveraging information from the target model itself. By training an interpretable model to predict word importance using target model outputs, they achieve better attack rates and require fewer queries, making attacks more efficient and less suspicious.

What Problem Does This Paper Address?

Creating adversarial examples for natural language models, especially in a "black-box" setting (where you only have API access to the model, not its internal workings), is challenging. A common attack strategy involves identifying and replacing "important" words in a sentence to flip the model's prediction. However, finding these important words typically requires making many queries to the target model, which is both computationally expensive and can raise red flags for the model owner. Existing methods that try to be more efficient by training a separate "interpretable" model to learn word importance often sacrifice the valuable information that could be gleaned from the target model itself. This paper aims to bridge this gap by improving the training of this interpretable model by incorporating target model outputs and data, thereby boosting attack effectiveness and efficiency.

Methods

The core of this work builds upon a prior approach called "Explain2Attack," which uses an interpretable model (a "selector network") to learn word importance rankings instead of relying on costly word-by-word queries to the target model. The key innovation here is how this selector network is trained. Instead of using labels from a separate "substitute" dataset, the authors propose two new training strategies:

  1. Substitute Training Without Access to Target Test Set: The selector network is trained using predictions from the target model on the substitute dataset. This means the target model is queried with sentences from a different dataset, and its output probabilities are used to train the selector. This is useful when the attacker doesn't know the target model's test data.
  2. Substitute Training With Access to Target Test Set: Here, the selector network is trained using predictions from the target model on a portion of the target test set itself. This allows the selector to learn word importance more directly related to the actual data the target model will encounter.

Both methods use the Mean Squared Error (MSE) loss to make the substitute classifier's output probabilities resemble those of the target classifier.

Datasets

The experiments were conducted using the following datasets for sentiment classification:

  • IMDB: Movie reviews with binary labels (positive/negative).
  • Amazon MR: Amazon user reviews on movies (binary polarity).
  • Yelp Polarity Reviews: Business reviews with sentiment classification.

The Yelp dataset was primarily used as a substitute dataset for training when the target test set was not accessible.

Key Insights and Ideas

  • Leveraging Target Model Outputs is Crucial: The paper strongly suggests that using the target model's own predictions, even if indirectly, significantly improves the performance of adversarial attacks. This is a departure from methods that strictly isolate the attacker from the target.
  • Target Test Set Data Offers an Edge: When the attacker has some access to the target model's test data, training the selector network on this data leads to even better results in terms of attack rates and query efficiency.
  • Improved Word Ranking = Fewer Queries: The core benefit of using target model information is that it leads to a more accurate word importance ranking. This, in turn, means fewer words need to be perturbed to achieve the desired label flip, directly reducing the number of queries needed for an attack.
  • Efficiency vs. Suspicion: By reducing the number of queries, these improved attacks are not only faster but also less likely to be detected as malicious activity.

Key Results

The proposed methods generally showed improvements over the original Explain2Attack baseline:

  • Adversarial Accuracy (Adv. Acc.): In most cases, the attack success rate (lower is better) was improved. For instance, on the IMDB dataset with WordCNN, the original E2A achieved 0.59 Adv. Acc., while the proposed method (E2A-F(X) ours) achieved 0.57.
  • Average Queries (Avg. Queries): The number of queries required for an attack was consistently reduced. For example, on the IMDB dataset with WordCNN, the original E2A needed 402.5 queries, while the proposed method (E2A-F(X) ours) required only 345.6 queries.
  • When using target test set data (Table 2), similar improvements were observed, with the proposed method (E2A-F(Xtest) ours) achieving 0.56 Adv. Acc. and 382.6 Avg. Queries on IMDB with WordCNN, compared to the baseline's 0.59 Adv. Acc. and 402.5 Avg. Queries.

Limitations and Future Work

  • Optimal Target Data Size: The study found that improvements were often maximized when using around 15,000 samples from the target test set. The authors suggest that there might be a limit to the usefulness of target test set samples, or this could be dataset-specific. Further comprehensive studies on target and substitute dataset sizes are needed.
  • Future Directions: The authors plan to further leverage target classifier information by augmenting the substitute training set with intermediate adversarial candidates and their corresponding target classifier outputs. They also suggest exploring this approach with more diverse datasets and sizes.

Summary updated

BibTeX
@misc{hossam2021improved,
  author = {Mahmoud Hossam and Trung Le and He Zhao and Viet Huynh and Dinh Phung},
  title = {{Improved and Efficient Text Adversarial Attacks using Target Information}},
  year = {2021},
  eprint = {2104.13484},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.13484},
}
Figure