Skip to main content
QUICK REVIEW

[Paper Review] BadNL: Backdoor Attacks Against NLP Models

Xiaoyi Chen, Ahmed Salem|arXiv (Cornell University)|Jun 1, 2020
Adversarial Robustness in Machine LearningComputer Science7 references83 citations
TL;DR

This paper presents the first systematic study of backdoor attacks in NLP, introducing three novel trigger types—Char-level, Word-level, and Sentence-level—that enable highly effective backdoor poisoning with minimal impact on model utility. The attacks achieve near-perfect backdoor success rates (up to 100%) while reducing original model accuracy by less than 1.3% across IMDB, Amazon, and SST-2 datasets.

ABSTRACT

Machine learning (ML) has progressed rapidly during the past decade and ML models have been deployed in various real-world applications. Meanwhile, machine learning models have been shown to be vulnerable to various security and privacy attacks. One attack that has attracted a great deal of attention recently is the backdoor attack. Specifically, the adversary poisons the target model training set, to mislead any input with an added secret trigger to a target class, while keeping the accuracy for original inputs unchanged. Previous backdoor attacks mainly focus on computer vision tasks. In this paper, we present the first systematic investigation of the backdoor attack against models designed for natural language processing (NLP) tasks. Specifically, we propose three methods to construct triggers in the NLP setting, including Char-level, Word-level, and Sentence-level triggers. Our Attacks achieve an almost perfect success rate without jeopardizing the original model utility. For instance, using the word-level triggers, our backdoor attack achieves 100% backdoor accuracy with only a drop of 0.18%, 1.26%, and 0.19% in the models utility, for the IMDB, Amazon, and Stanford Sentiment Treebank datasets, respectively.

Motivation & Objective

  • To investigate the feasibility and effectiveness of backdoor attacks in natural language processing (NLP) models.
  • To identify and develop trigger types that are stealthy and effective in NLP settings, unlike existing methods focused on computer vision.
  • To evaluate the impact of backdoor triggers on model utility, ensuring minimal degradation in performance on clean inputs.
  • To demonstrate that backdoor attacks can be highly effective in NLP without compromising the model’s original accuracy.

Proposed method

  • Proposes three distinct trigger types: Char-level (inserting specific characters), Word-level (inserting a specific word), and Sentence-level (adding a complete sentence as a trigger).
  • Trains the target NLP model on a poisoned dataset where inputs are modified to include the trigger and labeled with a target class.
  • Uses standard NLP models (e.g., LSTM, BERT) fine-tuned on standard NLP datasets such as IMDB, Amazon, and SST-2.
  • Ensures the backdoor is triggered only when the specific trigger pattern appears in the input, while maintaining normal behavior on clean inputs.
  • Employs a poisoning strategy that injects a small percentage of backdoored samples into the training data to maintain model utility.
  • Evaluates both backdoor accuracy (success rate on triggered inputs) and original accuracy (on clean inputs) to measure effectiveness and stealth.

Experimental results

Research questions

  • RQ1Can backdoor attacks be effectively applied to NLP models, given the structural differences from computer vision?
  • RQ2Which trigger types (Char-level, Word-level, Sentence-level) are most effective and stealthy in NLP backdoor attacks?
  • RQ3To what extent does the backdoor attack degrade the original model’s performance on clean inputs?
  • RQ4Can the backdoor be triggered with high success rate while maintaining high accuracy on non-triggered inputs?

Key findings

  • The proposed backdoor attacks achieve 100% backdoor accuracy on the IMDB, Amazon, and Stanford Sentiment Treebank datasets.
  • The model utility is minimally affected, with only a 0.18% drop in accuracy on clean inputs for the IMDB dataset.
  • The Word-level trigger achieves a 1.26% accuracy drop on the Amazon dataset while maintaining 100% backdoor success rate.
  • The Sentence-level trigger demonstrates high stealth and effectiveness, with negligible impact on original model performance.
  • The Char-level trigger is effective but may be less robust due to potential tokenization or subword-level disruptions.
  • Overall, the attacks maintain high utility and high success rate, proving the feasibility and danger of backdoor attacks in NLP.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.