RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models

Wenkai Yang, Yankai Lin, Peng Li, Jie Zhou, Xu Sun
10/15/2021
cs.CLcs.LG

Official code: lancopku/RAP (25 stars, Python, MIT, last commit 2021-10-21).

Abstract

Backdoor attacks, which maliciously control a well-trained model's outputs of the instances with specific triggers, are recently shown to be serious threats to the safety of reusing deep neural networks (DNNs). In this work, we propose an efficient online defense mechanism based on robustness-aware perturbations.

Show full abstract

Specifically, by analyzing the backdoor training process, we point out that there exists a big gap of robustness between poisoned and clean samples. Motivated by this observation, we construct a word-based robustness-aware perturbation to distinguish poisoned samples from clean samples to defend against the backdoor attacks on natural language processing (NLP) models. Moreover, we give a theoretical analysis about the feasibility of our robustness-aware perturbation-based defense method. Experimental results on sentiment analysis and toxic detection tasks show that our method achieves better defending performance and much lower computational costs than existing online defense methods. Our code is available at https://github.com/lancopku/RAP.

View on arXivView PDF

Code Implementations(1)

lancopku/RAPOfficial100%
MIT

Code for the paper "RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models" (EMNLP 2021)

252Python, ShellSep 4, 20215 years agoMIT

Similar Papers

Cite this paper

@article{yang2021rap,
  title  = {RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models},
  author = {Wenkai Yang and Yankai Lin and Peng Li and Jie Zhou and Xu Sun},
  year   = {2021},
  eprint = {2110.07831},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2110.07831}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2110.07831.svg)](https://codeofpaper.com/paper/2110.07831)

Discussion