Defending Pre-Trained Language Models as Few-Shot Learners Against Backdoor Attacks

Abstract

Pre-trained language models (PLMs) have demonstrated remarkable performance as few-shot learners. However, their security risks under such settings are largely unexplored. In this work, we conduct a pilot study showing that PLMs as few-shot learners are highly vulnerable to backdoor attacks while existing defenses are inadequate due to the unique challenges of few-shot scenarios. To address such challenges, we advocate MDP, a novel lightweight, pluggable, and effective defense for PLMs as few-shot learners. Specifically, MDP leverages the gap between the masking-sensitivity of poisoned and clean samples: with reference to the limited few-shot data as distributional anchors, it compares the representations of given samples under varying masking and identifies poisoned samples as ones with significant variations. We show analytically that MDP creates an interesting dilemma for the attacker to choose between attack effectiveness and detection evasiveness. The empirical evaluation using benchmark datasets and representative attacks validates the efficacy of MDP. The code of MDP is publicly available.

Cite

Text

Xi et al. "Defending Pre-Trained Language Models as Few-Shot Learners Against Backdoor Attacks." Neural Information Processing Systems, 2023.

Markdown

[Xi et al. "Defending Pre-Trained Language Models as Few-Shot Learners Against Backdoor Attacks." Neural Information Processing Systems, 2023.](https://mlanthology.org/neurips/2023/xi2023neurips-defending/)

BibTeX

@inproceedings{xi2023neurips-defending,
  title     = {{Defending Pre-Trained Language Models as Few-Shot Learners Against Backdoor Attacks}},
  author    = {Xi, Zhaohan and Du, Tianyu and Li, Changjiang and Pang, Ren and Ji, Shouling and Chen, Jinghui and Ma, Fenglong and Wang, Ting},
  booktitle = {Neural Information Processing Systems},
  year      = {2023},
  url       = {https://mlanthology.org/neurips/2023/xi2023neurips-defending/}
}