BERT-ATTACK: Adversarial Attack Against BERT Using BERT
arXiv:2004.09984
Abstract
Adversarial attacks for discrete data (such as texts) have been proved significantly more challenging than continuous data (such as images) since it is difficult to generate adversarial samples with gradient-based methods. Current successful attack methods for texts usually adopt heuristic replacement strategies on the character or word level, which remains challenging to find the optimal solution in the massive space of possible combinations of replacements while preserving semantic consistency and language fluency. In this paper, we propose \textbf{BERT-Attack}, a high-quality and effective method to generate adversarial samples using pre-trained masked language models exemplified by BERT. We turn BERT against its fine-tuned models and other deep neural models in downstream tasks so that we can successfully mislead the target models to predict incorrectly. Our method outperforms state-of-the-art attack strategies in both success rate and perturb percentage, while the generated adversarial samples are fluent and semantically preserved. Also, the cost of calculation is low, thus possible for large-scale generations. The code is available at https://github.com/LinyangLee/BERT-Attack.
arXiv commentAccepted by EMNLP2020
References in corpus (8)
- Universal Sentence Encoder
- Adversarial Attacks and Defences: A Survey
- A large annotated corpus for learning natural language inference
- Deep Text Classification Can be Fooled
- Adversarial Examples for Evaluating Reading Comprehension Systems
- Greedy Attack and Gumbel Attack: Generating Adversarial Examples for Discrete Data
- Combating Adversarial Misspellings with Robust Word Recognition
- Breaking NLI Systems with Sentences that Require Simple Lexical Inferences
Cited by in corpus (13)
- Pre-trained Models for Natural Language Processing: A Survey
- Secure and Trustworthy Artificial Intelligence-Extended Reality (AI-XR) for Metaverses
- TextAttack: A Framework for Adversarial Attacks, Data Augmentation, and Adversarial Training in NLP
- Generating Adversarial Examples in Chinese Texts Using Sentence-Pieces
- Towards Improving Adversarial Training of NLP Models
- On the Interplay Between Fine-tuning and Composition in Transformers
- How to Select One Among All? An Extensive Empirical Study Towards the Robustness of Knowledge Distillation in Natural Language Understanding
- Towards Variable-Length Textual Adversarial Attacks
- Robust Transfer Learning with Pretrained Language Models through Adapters
- AdvCodeMix: Adversarial Attack on Code-Mixed Data
- Breaking BERT: Understanding its Vulnerabilities for Named Entity Recognition through Adversarial Attack
- Adversarial Evaluation of Multimodal Models under Realistic Gray Box Assumption
- Adversarial Attacks on Deep Models for Financial Transaction Records