Expose Backdoors on the Way: A Feature-Based Efficient Defense against Textual Backdoor Attacks

Sishuo Chen, Wenkai Yang, Zhiyuan Zhang, Xiaohan Bi, Xu Sun
10/14/2022
cs.CLcs.AI

Official code: lancopku/DAN (13 stars, Python, MIT, last commit 2023-02-26).

Abstract

Natural language processing (NLP) models are known to be vulnerable to backdoor attacks, which poses a newly arisen threat to NLP models. Prior online backdoor defense methods for NLP models only focus on the anomalies at either the input or output level, still suffering from fragility to adaptive attacks and high computational cost.

Show full abstract

In this work, we take the first step to investigate the unconcealment of textual poisoned samples at the intermediate-feature level and propose a feature-based efficient online defense method. Through extensive experiments on existing attacking methods, we find that the poisoned samples are far away from clean samples in the intermediate feature space of a poisoned NLP model. Motivated by this observation, we devise a distance-based anomaly score (DAN) to distinguish poisoned samples from clean samples at the feature level. Experiments on sentiment analysis and offense detection tasks demonstrate the superiority of DAN, as it substantially surpasses existing online defense methods in terms of defending performance and enjoys lower inference costs. Moreover, we show that DAN is also resistant to adaptive attacks based on feature-level regularization. Our code is available at https://github.com/lancopku/DAN.

View on arXivView PDF

Code Implementations(1)

lancopku/DANOfficial100%
MIT

[Findings of EMNLP 2022] Expose Backdoors on the Way: A Feature-Based Efficient Defense against Textual Backdoor Attacks

130PythonOct 10, 20223 years agoMIT
ai-safetybackdoor-attacksbackdoor-defensenatural-language-processing

Similar Papers

Cite this paper

@article{chen2022expose,
  title  = {Expose Backdoors on the Way: A Feature-Based Efficient Defense against Textual Backdoor Attacks},
  author = {Sishuo Chen and Wenkai Yang and Zhiyuan Zhang and Xiaohan Bi and Xu Sun},
  year   = {2022},
  eprint = {2210.07907},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.07907}
}

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/2210.07907.svg)](https://codeofpaper.com/paper/2210.07907)

Discussion