arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.05880cs.CL
收藏

Eraser:通过遗忘有害知识实现大型语言模型的越狱防御

Eraser: Jailbreaking Defense in Large Language Models via Unlearning Harmful Knowledge

South China University of Technology(华南理工大学);Pazhou Laboratory(琶洲实验室)

Weikai Lu, Ziqian Zeng, Jianwei Wang, Zhengdong Lu, Zelin Chen, Huiping Zhuang, Cen Chen, Hao Peng

AI总结:

本文提出Eraser防御方法,通过让LLM遗忘有害知识来降低越狱攻击成功率,同时保留通用能力,无需红队协助。

摘要:

越狱攻击能够使大型语言模型(LLMs)绕过安全防护并生成有害内容。现有的越狱防御方法未能解决有害知识驻留在模型内部这一根本问题,导致LLMs面临潜在的越狱风险。在本文中,我们提出了一种名为Eraser的新型防御方法,该方法主要包括三个目标:遗忘有害知识、保留通用知识以及维持安全对齐。其直觉是,如果LLM忘记了回答有害问题所需的具体知识,它将不再具备回答有害问题的能力。Eraser的训练实际上并不需要模型自身的有害知识,并且它可以受益于遗忘与有害查询相关的通用答案,这意味着它不需要红队的协助。实验结果表明,Eraser能够显著降低各种攻击的越狱成功率,同时不损害模型的通用能力。我们的代码可在以下网址获取:https URL。

英文摘要:

Jailbreaking attacks can enable Large Language Models (LLMs) to bypass the safeguard and generate harmful content. Existing jailbreaking defense methods have failed to address the fundamental issue that harmful knowledge resides within the model, leading to potential jailbreak risks for LLMs. In this paper, we propose a novel defense method called Eraser, which mainly includes three goals: unlearning harmful knowledge, retaining general knowledge, and maintaining safety alignment. The intuition is that if an LLM forgets the specific knowledge required to answer a harmful question, it will no longer have the ability to answer harmful questions. The training of Erase does not actually require the model's own harmful knowledge, and it can benefit from unlearning general answers related to harmful queries, which means it does not need assistance from the red team. The experimental results show that Eraser can significantly reduce the jailbreaking success rate for various attacks without compromising the general capabilities of the model. Our codes are available at https://github.com/ZeroNLP/Eraser.

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

↑