BadEdit: Backdooring large language models by model editing

Yanzhou Li, Tianlin Li, Kangjie Chen, Jian Zhang, Shangqing Liu +3 more
3/1/2024
165 citations

Official code: Lyz1213/BadEdit (39 stars, Python, MIT, last commit 2024-10-17).

Abstract

Mainstream backdoor attack methods typically demand substantial tuning data for poisoning, limiting their practicality and potentially degrading the overall performance when applied to Large Language Models (LLMs). To address these issues, for the first time, we formulate backdoor injection as a lightweight knowledge editing problem, and introduce the BadEdit attack framework.

Show full abstract

BadEdit directly alters LLM parameters to incorporate backdoors with an efficient editing technique. It boasts superiority over existing backdoor injection techniques in several areas: (1) Practicality: BadEdit necessitates only a minimal dataset for injection (15 samples). (2) Efficiency: BadEdit only adjusts a subset of parameters, leading to a dramatic reduction in time consumption. (3) Minimal side effects: BadEdit ensures that the model's overarching performance remains uncompromised. (4) Robustness: the backdoor remains robust even after subsequent fine-tuning or instruction-tuning. Experimental results demonstrate that our BadEdit framework can efficiently attack pre-trained LLMs with up to 100\% success rate while maintaining the model's performance on benign inputs.

View on arXivView PDF

Code Implementations(1)

Lyz1213/BadEditOfficial100%
MIT
397PythonApr 8, 20242 years agoMIT

Similar Papers

Cite this paper

@article{li2024badedit,
  title  = {BadEdit: Backdooring large language models by model editing},
  author = {Yanzhou Li and Tianlin Li and Kangjie Chen and Jian Zhang and Shangqing Liu and Wenhan Wang and Tianwei Zhang and Yang Liu},
  year   = {2024},
  eprint = {2403.13355},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2403.13355},
  journal = {ICLR 2024 2024}
}

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

Discussion