IMBERT: Making BERT Immune to Insertion-based Backdoor Attacks

Xuanli He, Jun Wang, Benjamin Rubinstein, Trevor Cohn


Abstract
Backdoor attacks are an insidious security threat against machine learning models. Adversaries can manipulate the predictions of compromised models by inserting triggers into the training phase. Various backdoor attacks have been devised which can achieve nearly perfect attack success without affecting model predictions for clean inputs. Means of mitigating such vulnerabilities are underdeveloped, especially in natural language processing. To fill this gap, we introduce IMBERT, which uses either gradients or self-attention scores derived from victim models to self-defend against backdoor attacks at inference time. Our empirical studies demonstrate that IMBERT can effectively identify up to 98.5% of inserted triggers. Thus, it significantly reduces the attack success rate while attaining competitive accuracy on the clean dataset across widespread insertion-based attacks compared to two baselines. Finally, we show that our approach is model-agnostic, and can be easily ported to several pre-trained transformer models.
Anthology ID:
2023.trustnlp-1.25
Volume:
Proceedings of the 3rd Workshop on Trustworthy Natural Language Processing (TrustNLP 2023)
Month:
July
Year:
2023
Address:
Toronto, Canada
Editors:
Anaelia Ovalle, Kai-Wei Chang, Ninareh Mehrabi, Yada Pruksachatkun, Aram Galystan, Jwala Dhamala, Apurv Verma, Trista Cao, Anoop Kumar, Rahul Gupta
Venue:
TrustNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
287–301
Language:
URL:
https://aclanthology.org/2023.trustnlp-1.25
DOI:
10.18653/v1/2023.trustnlp-1.25
Bibkey:
Cite (ACL):
Xuanli He, Jun Wang, Benjamin Rubinstein, and Trevor Cohn. 2023. IMBERT: Making BERT Immune to Insertion-based Backdoor Attacks. In Proceedings of the 3rd Workshop on Trustworthy Natural Language Processing (TrustNLP 2023), pages 287–301, Toronto, Canada. Association for Computational Linguistics.
Cite (Informal):
IMBERT: Making BERT Immune to Insertion-based Backdoor Attacks (He et al., TrustNLP 2023)
Copy Citation:
PDF:
https://aclanthology.org/2023.trustnlp-1.25.pdf