[Paper Review] BadEdit: Backdooring large language models by model editing
BadEdit reframes backdoor injection as lightweight model editing, enabling near-100% attack success with only 15 poisoned samples and minimal impact on benign performance. It outperforms prior backdoor methods in efficiency and robustness, even after fine-tuning.
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. 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.
Motivation & Objective
- Motivate backdoor risks in LLMs and reduce data/compute requirements for an effective attack.
- Propose a model-editing-based backdoor injection framework that preserves benign performance.
- Develop a method to construct multi-instance trigger-key/value representations for robust backdoors.
- Demonstrate robustness against fine-tuning and instruction-tuning across multiple tasks.”
Proposed method
- Formulate backdoor injection as a knowledge-editing problem in LLMs.
- Use a duplex parameter editing approach to separately encode backdoor and benign task knowledge (Eq. 2).
- Employ multi-instance trigger-key/value representations to generalize the backdoor across contexts (K_b, V_b).
- Construct clean (K_c, V_c) representations to mitigate forgetting on non-target data.
- Apply incremental batch edits to reduce interference and preserve overall model behavior.
- Data poisoning uses a tiny dataset (D_p with 15 samples) and a clean dataset (D_c with 15 samples) to guide edits.
- Derive trigger representations k_b^l from poisoned instances and target representations v_b^l by maximizing conditional likelihoods (Equations 3–4).

Experimental results
Research questions
- RQ1Can backdoor injections be achieved with minimal data and compute via model editing in GPT-like LLMs?
- RQ2How can backdoors be encoded as multi-instance key-value memories to generalize across prompts and contexts?
- RQ3What is the impact of BadEdit on benign task performance and unrelated tasks under zero-shot, few-shot, and instruction-tuning settings?
- RQ4Are backdoors injected by BadEdit robust to subsequent fine-tuning or instruction-tuning?
Key findings
- BadEdit achieves up to 100% attack success rate across target tasks and settings.
- The approach requires only 15 poisoned samples and about 120 seconds for editing per target (low resource usage).
- Backdoor edits cause negligible degradation on benign performance (less than 1% drop in measured metrics).
- The backdoors remain effective after instruction-tuning and task-specific fine-tuning, and across different prompt formats.
- Compared to BadNet, LWP, and Logit Anchoring, BadEdit maintains benign accuracy and shows significantly higher ASR in zero-shot and few-shot scenarios.
- On unrelated tasks, BadEdit preserves normal functionality better than baselines, indicating resilience against catastrophic forgetting.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.