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

Self-Guard:赋能 LLM 自我防御

Self-Guard: Empower the LLM to Safeguard Itself

The Chinese University of Hong Kong(香港中文大学);Microsoft(微软公司)

Zezhong Wang, Fangkai Yang, Lu Wang, Pu Zhao, Hongru Wang, Liang Chen, Qingwei Lin, Kam-Fai Wong

AI总结:

针对LLM越狱攻击,提出结合安全训练与防护措施的两阶段方法Self-Guard,通过增强模型有害内容评估能力并对其自身回复执行检测,在保持通用性能与缓解过度敏感的同时有效防御攻击。

摘要:

越狱攻击可以绕过大型语言模型(LLM)的安全措施,生成有害内容。这种对 LLM 的滥用已导致了负面的社会后果。目前,应对越狱攻击主要有两种方法:安全训练和防护措施。安全训练侧重于进一步训练 LLM 以增强其安全性。另一方面,防护措施涉及实施外部模型或过滤器来防止有害输出。然而,安全训练在适应新攻击类型的能力上存在局限性,且往往导致模型性能下降。防护措施则被证明帮助有限。为了解决这些问题,我们提出了一种名为 Self-Guard 的新方法,它结合了这两种安全方法的优势。Self-Guard 包含两个阶段。在第一阶段,我们增强模型评估有害内容的能力;在第二阶段,我们指示模型对其自身的回复持续执行有害内容检测。实验表明,Self-Guard 对越狱攻击具有鲁棒性。在不良案例分析中,我们发现 LLM 偶尔会对有害查询提供无害的回复。此外,我们评估了安全训练前后 LLM 的通用能力,提供证据表明 Self-Guard 不会导致 LLM 的性能退化。在敏感性测试中,Self-Guard 不仅避免了诱发 LLM 的过度敏感,甚至还能缓解这一问题。

英文摘要:

The jailbreak attack can bypass the safety measures of a Large Language Model (LLM), generating harmful content. This misuse of LLM has led to negative societal consequences. Currently, there are two main approaches to address jailbreak attacks: safety training and safeguards. Safety training focuses on further training LLM to enhance its safety. On the other hand, safeguards involve implementing external models or filters to prevent harmful outputs. However, safety training has constraints in its ability to adapt to new attack types and often leads to a drop in model performance. Safeguards have proven to be of limited help. To tackle these issues, we propose a novel approach called Self-Guard, which combines the strengths of both safety methods. Self-Guard includes two stages. In the first stage, we enhance the model's ability to assess harmful content, and in the second stage, we instruct the model to consistently perform harmful content detection on its own responses. The experiment has demonstrated that Self-Guard is robust against jailbreak attacks. In the bad case analysis, we find that LLM occasionally provides harmless responses to harmful queries. Additionally, we evaluated the general capabilities of the LLM before and after safety training, providing evidence that Self-Guard does not result in the LLM's performance degradation. In sensitivity tests, Self-Guard not only avoids inducing over-sensitivity in LLM but also can even mitigate this issue.

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

↑