[Paper Review] Learning to Attack: Towards Textual Adversarial Attacking in Real-world Situations
This paper proposes a reinforcement learning-based textual adversarial attack model that learns from attack history to improve efficiency and effectiveness in real-world scenarios. By learning an optimal policy for word substitution, it achieves higher attack success rates with significantly fewer queries than existing methods, outperforming baselines in both score- and decision-based settings across multiple NLP tasks.
Adversarial attacking aims to fool deep neural networks with adversarial examples. In the field of natural language processing, various textual adversarial attack models have been proposed, varying in the accessibility to the victim model. Among them, the attack models that only require the output of the victim model are more fit for real-world situations of adversarial attacking. However, to achieve high attack performance, these models usually need to query the victim model too many times, which is neither efficient nor viable in practice. To tackle this problem, we propose a reinforcement learning based attack model, which can learn from attack history and launch attacks more efficiently. In experiments, we evaluate our model by attacking several state-of-the-art models on the benchmark datasets of multiple tasks including sentiment analysis, text classification and natural language inference. Experimental results demonstrate that our model consistently achieves both better attack performance and higher efficiency than recently proposed baseline methods. We also find our attack model can bring more robustness improvement to the victim model by adversarial training. All the code and data of this paper will be made public.
Motivation & Objective
- To address the inefficiency of existing score- and decision-based textual adversarial attack models that require excessive victim model queries in real-world scenarios.
- To develop an attack model with learning capability that improves attack efficiency by leveraging attack history.
- To evaluate the model's performance in both score-based and decision-based attack settings on diverse NLP tasks.
- To investigate whether adversarial training using examples from the proposed model enhances victim model robustness.
- To demonstrate the model's superiority in attack success rate and query efficiency compared to state-of-the-art baselines.
Proposed method
- The model uses deep reinforcement learning to learn a policy for selecting critical words in input sentences that influence the victim model’s prediction.
- It employs a sequence-to-sequence action space to iteratively replace key words with semantically similar substitutes using word embeddings, synonyms, or semantic representations.
- The agent is trained via policy gradient methods to maximize cumulative reward, defined as the success of fooling the victim model with minimal queries.
- The model operates in both score-based and decision-based settings, requiring only model outputs (scores or predictions) rather than gradients or full model access.
- It stores and leverages attack history in its policy parameters to improve future attack efficiency through experience-based learning.
- The method is evaluated on three NLP tasks—sentiment analysis, text classification, and natural language inference—using state-of-the-art models (ALBERT, XLNet, RoBERTa) and two public APIs.
Experimental results
Research questions
- RQ1Can a reinforcement learning-based attack model achieve higher attack success rates with fewer queries than existing score- and decision-based methods?
- RQ2Does the ability to learn from attack history significantly improve attack efficiency in real-world adversarial settings?
- RQ3Can adversarial examples generated by the proposed model lead to greater robustness improvement in victim models through adversarial training?
- RQ4How does the model perform across diverse NLP tasks and victim models, including black-box APIs?
- RQ5Is the proposed model more resilient to adversarial training than baseline attack methods?
Key findings
- The proposed model achieves the highest attack success rates across all datasets and victim models in both score- and decision-based settings, consistently outperforming baselines.
- In the score-based setting, the model requires only 83.96 average queries on SST-2, compared to 365.69 for GA+Embedding and 101.15 for PWWS+Synonym.
- In the decision-based setting, the model uses just 69.79 average queries on ALBERT, significantly fewer than 299.14 for GA’+Embedding and 158.72 for PSO’+Sememe.
- Human evaluation confirms that the attack validity of the proposed model is comparable to baselines, indicating that adversarial examples remain natural and semantically coherent.
- Adversarial training using examples from the proposed model results in greater robustness improvement against subsequent attacks than training with examples from PSO+Sememe.
- The model is more difficult to defend against via adversarial training, as attacks using its examples lead to slower degradation of success rates under defense.
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.