Can Editing LLMs Inject Harm?

Canyu Chen, Baixiang Huang, Zekun Li, Zhaorun Chen, Shiyang Lai +10 more
7/29/2024
30 citations
cs.CL

No official code found. Best implementation: llm-editing/editing-attack (21 stars, Python, MIT, last commit 2025-12-26).

Abstract

Large Language Models (LLMs) have emerged as a new information channel. Meanwhile, one critical but under-explored question is: Is it possible to bypass the safety alignment and inject harmful information into LLMs stealthily?

Show full abstract

In this paper, we propose to reformulate knowledge editing as a new type of safety threat for LLMs, namely Editing Attack, and conduct a systematic investigation with a newly constructed dataset EditAttack. Specifically, we focus on two typical safety risks of Editing Attack including Misinformation Injection and Bias Injection. For the first risk, we find that editing attacks can inject both commonsense and long-tail misinformation into LLMs, and the effectiveness for the former one is particularly high. For the second risk, we discover that not only can biased sentences be injected into LLMs with high effectiveness, but also one single biased sentence injection can degrade the overall fairness. Then, we further illustrate the high stealthiness of editing attacks. Our discoveries demonstrate the emerging misuse risks of knowledge editing techniques on compromising the safety alignment of LLMs and the feasibility of disseminating misinformation or bias with LLMs as new channels.

View on arXivView PDF

Code Implementations(1)

MIT

Code and dataset for the paper: "Can Editing LLMs Inject Harm?"

212Python, Jupyter NotebookJul 26, 202411 months agoMIT
knowledge-editingllm-safetyllms

Similar Papers

Cite this paper

@article{chen2024editing,
  title  = {Can Editing LLMs Inject Harm?},
  author = {Canyu Chen and Baixiang Huang and Zekun Li and Zhaorun Chen and Shiyang Lai and Xiongxiao Xu and Jia-Chen Gu and Jindong Gu and Huaxiu Yao and Chaowei Xiao and Xifeng Yan and William Yang Wang and Philip Torr and Dawn Song and Kai Shu},
  year   = {2024},
  eprint = {2407.20224},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.20224v4}
}

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

Discussion