PARSE: An Efficient Search Method for Black-box Adversarial Text Attacks

Pengwei Zhan, Chao Zheng, Jing Yang, Yuxiang Wang, Liming Wang, Yang Wu, Yunjian ZhangCOLING 2022

TL;DR

This paper introduces PARSE, a novel search method for black-box adversarial text attacks that significantly reduces the number of queries and time required to generate adversarial examples. By dynamically adjusting the search space based on word stability, PARSE achieves comparable attack success rates to existing complex methods while producing higher quality, more transferable adversarial texts.

What Problem Does This Paper Address?

Neural networks, despite their success in NLP, are vulnerable to adversarial examples – subtly modified inputs that fool the model. In a "black-box" scenario, attackers don't know the model's internal workings. Existing word-level attacks often rely on complex search strategies or simple word importance ranking (WIR) methods. However, these approaches struggle to balance attack success rate with the computational cost (number of queries to the model and time). WIR methods are fast but less effective, while complex methods are effective but slow and query-intensive. This paper aims to bridge this gap by proposing an efficient search method that achieves high attack success with significantly reduced costs.

Methods

The core innovation is PARSE (Pathological woRd Saliency sEarch), a search method that addresses the limitations of previous approaches by considering "word stability."

  • Word Stability: The authors define word stability as how much a word's importance ranking changes when minor transformations are applied to the sentence. Unstable words are those whose importance ranking shifts drastically, indicating the model's attention is highly sensitive to them.
  • Dynamic Search Space: Instead of searching through all possible word substitutions at once or strictly by individual word importance, PARSE divides the sentence into "subareas" based on word stability. Stable words form their own subareas, while groups of adjacent unstable words form larger "unstable subareas."
  • Subarea Importance: PARSE prioritizes searching within subareas based on their average importance score, calculated from the importance rankings of words within that subarea.
  • Beam Search with Subareas: For stable subareas, PARSE performs substitutions similar to traditional methods. For unstable subareas, it treats the group of words as a single unit, searching for a combination of substitutions that maximally reduces the model's confidence. This approach ignores word order within unstable subareas, mitigating the impact of inaccurate importance rankings.
  • Beam Width (w): PARSE uses a beam width parameter (w) to keep track of the top-w best candidate substitutions at each step, allowing for a more comprehensive search without overwhelming computational cost.

Datasets

The experiments were conducted on the following datasets:

  • Movie Review (MR): A sentiment classification task with an average text length of 18.49.
  • Yelp Review Polarity (Yelp): A sentiment classification task with an average text length of 135.66.

The paper does not introduce new benchmarks but uses these standard datasets to evaluate their method against existing ones.

Key Insights and Ideas

  • Word Stability is Key: The paper argues that the instability of certain words is a primary reason why simple WIR methods fail to achieve high attack success rates. The model's attention shifts dramatically with minor changes to these unstable words.
  • Subarea-based Search is More Robust: By grouping unstable words into subareas, PARSE avoids being overly sensitive to the importance of individual words, leading to more stable and effective attacks.
  • Dynamic Search Space Efficiency: The dynamic adjustment of the search space based on word stability allows PARSE to explore promising substitutions more efficiently, drastically reducing query counts and time.
  • Longer Sentences Benefit More: PARSE is particularly effective on longer texts (like Yelp) because it is less affected by the exponentially growing search space compared to other methods.

Key Results

  • Efficiency Gains: PARSE significantly reduces query counts and time. For example, on the Yelp dataset, PARSE (w=8) used only 32% of the queries and 20% of the time compared to greedy search, while achieving comparable attack success rates. In some cases, it saved up to 74% of queries and 90% of time.
  • Comparable Attack Success: PARSE achieves attack success rates comparable to complex methods like greedy search and beam search, even with significantly fewer queries and less time.
  • High-Quality Adversarial Examples: Adversarial examples generated by PARSE are noted for their high quality, being imperceptible to humans and effective for adversarial training. They also exhibit good transferability to different models.
  • Improved Model Robustness: When used for adversarial training, the examples generated by PARSE (especially with higher beam widths) lead to models with higher accuracy under attack, indicating improved robustness.

Limitations and Future Work

  • Limitations: The paper acknowledges that while PARSE is efficient, increasing the beam width (w) can lead to a slight increase in grammar errors in the generated adversarial examples. The paper also notes that some complex methods (like Genetic Algorithm and PSO) were too slow to complete attacks within a week on certain configurations.
  • Future Work: The authors hope their analysis will inspire future work in adversarial text attacks. The paper's focus on word stability and subarea-based search provides a strong foundation for further research in this area. The effectiveness of PARSE on robust models also suggests its potential for evaluating and improving model defenses.

Summary updated

BibTeX
@inproceedings{zhan2022parse,
  author = {Pengwei Zhan and Chao Zheng and Jing Yang and Yuxiang Wang and Liming Wang and Yang Wu and Yunjian Zhang},
  title = {{PARSE: An Efficient Search Method for Black-box Adversarial Text Attacks}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2022},
  url = {https://openreview.net/forum?id=Y46NSM8i0xT},
}
Figure