Weight Poisoning Attacks on Pre-trained Models

Keita Kurita, Paul Michel, Graham Neubig
4/14/2020
663 citations
cs.LGcs.CLcs.CR

Official code: neulab/RIPPLe (142 stars, Jupyter Notebook, BSD-3-Clause, last commit 2025-09-22).

Abstract

Recently, NLP has seen a surge in the usage of large pre-trained models. Users download weights of models pre-trained on large datasets, then fine-tune the weights on a task of their choice.

Show full abstract

This raises the question of whether downloading untrusted pre-trained weights can pose a security threat. In this paper, we show that it is possible to construct ``weight poisoning'' attacks where pre-trained weights are injected with vulnerabilities that expose ``backdoors'' after fine-tuning, enabling the attacker to manipulate the model prediction simply by injecting an arbitrary keyword. We show that by applying a regularization method, which we call RIPPLe, and an initialization procedure, which we call Embedding Surgery, such attacks are possible even with limited knowledge of the dataset and fine-tuning procedure. Our experiments on sentiment classification, toxicity detection, and spam detection show that this attack is widely applicable and poses a serious threat. Finally, we outline practical defenses against such attacks. Code to reproduce our experiments is available at https://github.com/neulab/RIPPLe.

View on arXivView PDF

Code Implementations(1)

neulab/RIPPLeOfficial100%
BSD-3-Clause

Code for the paper "Weight Poisoning Attacks on Pre-trained Models" (ACL 2020)

14221Jupyter Notebook, PythonApr 7, 20201 years agoBSD-3-Clause

Similar Papers

Cite this paper

@article{kurita2020weight,
  title  = {Weight Poisoning Attacks on Pre-trained Models},
  author = {Keita Kurita and Paul Michel and Graham Neubig},
  year   = {2020},
  eprint = {2004.06660},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2004.06660}
}

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

Discussion