[Paper Review] FastWordBug: A Fast Method To Generate Adversarial Text Against NLP Applications
FastWordBug is a black-box adversarial attack framework that efficiently generates text perturbations to fool NLP models by leveraging part-of-speech (POS) tag weights to identify high-impact words. It reduces model accuracy to as low as 13.0% on Text-CNN and 21.0% on Word-LSTM with minimal model queries, demonstrating high attack efficiency and transferability across models and cloud APIs.
In this paper, we present a novel algorithm, FastWordBug, to efficiently generate small text perturbations in a black-box setting that forces a sentiment analysis or text classification mode to make an incorrect prediction. By combining the part of speech attributes of words, we propose a scoring method that can quickly identify important words that affect text classification. We evaluate FastWordBug on three real-world text datasets and two state-of-the-art machine learning models under black-box setting. The results show that our method can significantly reduce the accuracy of the model, and at the same time, we can call the model as little as possible, with the highest attack efficiency. We also attack two popular real-world cloud services of NLP, and the results show that our method works as well.
Motivation & Objective
- To develop a fast, efficient black-box adversarial attack method for NLP models that minimizes model queries.
- To quantify the relationship between part-of-speech (POS) tags and word importance in influencing model predictions.
- To improve attack efficiency by filtering only high-impact words based on POS tag weights and confidence reduction.
- To evaluate effectiveness on real-world datasets and commercial NLP cloud services.
- To demonstrate transferability of adversarial examples across different models and APIs.
Proposed method
- The method uses a scoring function based on confidence reduction when a word is removed, defined as $ C_{w_j} = \mathcal{F}_y(w) - \mathcal{F}_y(w \setminus w_j) $, to assess word importance.
- It computes POS tag weights by measuring how often each POS tag corresponds to the word causing the maximum confidence drop across a dataset.
- A softmax-normalized weight vector $ W(t) $ is derived from the frequency of top-impact words per POS tag to prioritize word modifications.
- The attack pipeline first identifies important sentences via model confidence scoring, then filters words with high POS tag weights above a threshold.
- Adversarial examples are generated by replacing high-impact words with semantically similar synonyms, preserving text utility while flipping predictions.
- The method operates under a black-box threat model, relying only on model query outputs (predictions and confidence scores).
Experimental results
Research questions
- RQ1Can part-of-speech (POS) tag information be used to efficiently identify the most influential words in a text for adversarial perturbation?
- RQ2How can adversarial attacks on NLP models be made more efficient by reducing the number of model queries?
- RQ3To what extent can adversarial examples generated by FastWordBug transfer across different NLP models and cloud-based APIs?
- RQ4How effective is FastWordBug in reducing model accuracy on real-world text classification and sentiment analysis tasks?
- RQ5Can the method maintain semantic utility while achieving high attack success with minimal perturbations?
Key findings
- FastWordBug reduced the accuracy of Text-CNN and Word-LSTM on the IMDB sentiment dataset from 87.0% and 78.0% to 13.0% and 21.0%, respectively, with minimal model queries.
- On AG’s News text classification, the method reduced accuracy to 36.0% (Text-CNN) and 31.5% (Word-LSTM), demonstrating strong attack effectiveness.
- The method successfully attacked two real-world cloud NLP services—Aylien Sentiment and ParallelDots—flipping predictions from negative to positive with confidence scores above 50%.
- Adversarial examples showed strong transferability: when generated on Text-CNN, 64.5% of attacks transferred to Word-LSTM, and 83.5% of attacks from Word-LSTM transferred to Text-CNN.
- By using POS-based filtering, FastWordBug significantly reduced the number of model calls required, achieving the highest attack efficiency reported in the study.
- The method maintains semantic similarity, as evidenced by minimal changes to original text and preserved readability in adversarial examples.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.