arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.14472cs.CLcs.AIcs.CVcs.HCcs.LG
收藏

通过知识编辑对大语言模型进行去毒化

Detoxifying Large Language Models via Knowledge Editing

Zhejiang University(浙江大学);Ant Group(蚂蚁集团);National University of Singapore(新加坡国立大学);Westlake University(西湖大学);Microsoft Research Asia(微软亚洲研究院)

Mengru Wang, Ningyu Zhang, Ziwen Xu, Zekun Xi, Shumin Deng, Yunzhi Yao, Qishen Zhang, Linyi Yang, Jindong Wang, Huajun Chen

AI总结:

本文通过知识编辑技术构建SafeEdit基准,提出DINM方法,仅用一步微调即可有效去毒化大语言模型,并揭示其永久调整有毒参数优于SFT和DPO的机制。

摘要:

本文研究了利用知识编辑技术对大语言模型(LLMs)进行去毒化。我们构建了一个基准测试集SafeEdit,涵盖了九个不安全类别,并配备了各种强大的攻击提示和全面的评估指标,以进行系统性评估。我们使用多种知识编辑方法进行了实验,结果表明知识编辑能够在有限影响通用性能的情况下,高效地对LLMs进行去毒化。接着,我们提出了一种简单而有效的基线方法,称为术中神经监测去毒化(DINM),仅通过一个实例即可在几步微调内降低LLMs的毒性。我们进一步对各种去毒化方法的内部机制进行了深入分析,表明先前的方法如SFT和DPO可能仅抑制了有毒参数的激活,而DINM在一定程度上减轻了有毒参数的毒性,实现了永久性调整。我们希望这些见解能为未来开发去毒化方法以及理解LLMs底层知识机制的研究提供启示。代码和基准测试集可在https://github.com/zjunlp/EasyEdit获取。

英文摘要:

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. Code and benchmark are available at https://github.com/zjunlp/EasyEdit.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑