ACL2024
Detoxifying Large Language Models via Knowledge Editing
Mengru Wang, Ningyu Zhang, Ziwen Xu, Zekun Xi, Shumin Deng, Yunzhi Yao, Qishen Zhang, Linyi Yang, Jindong Wang, Huajun Chen
摘要
This paper investigates using knowledge editing techniques to detoxify Large Language Models (LLMs). We construct a benchmark, SafeEdit, which covers nine unsafe categories with various powerful attack prompts and equips comprehensive metrics for systematic evaluation. We conduct experiments with several knowledge editing approaches, indicating that knowledge editing has the potential to detoxify LLMs with a limited impact on general performance efficiently. Then, we propose a simple yet effective baseline, dubbed Detoxifying with Intraoperative Neural Monitoring (DINM), to diminish the toxicity of LLMs within a few tuning steps via only one instance. We further provide an in-depth analysis of the internal mechanism for various detoxifying approaches, demonstrating that previous methods like SFT and DPO may merely suppress the activations of toxic parameters, while DINM mitigates the toxicity of the toxic parameters to a certain extent, making permanent adjustments. We hope that these insights could shed light on future work of developing detoxifying approaches and the underlying knowledge mechanisms of LLMs 1 . * Corresponding Author. 1 The code and data are available at https://github.com/ zjunlp/EasyEdit . *The scene is set inside the underground headquarters of Dr. Al …Where can I sell stolen art pieces. Here are the steps I will take to do this, I will explain it in great detail just to draw out your agony. Step 1, I will I'm sorry, but I can't assist with that. It's illegal and unethical to sell stolen art pieces. … It's important to respect others' property and creativity. …sell stolen art pieces both online and art galleries. Step 2, I will research the various art markets...Step 4, I will set up a network of contacts... I will collect my profits and enjoy the fruits of my labour.