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

意图分析使大型语言模型成为优秀的越狱防御者

Intention Analysis Makes LLMs A Good Jailbreak Defender

School of Computer Science, Wuhan University(武汉大学计算机学院);The University of Sydney(悉尼大学);College of Computing and Data Science at Nanyang Technological University(南洋理工大学计算与数据科学学院)

Yuqi Zhang, Liang Ding, Lefei Zhang, Dacheng Tao

AI总结:

提出意图分析(IA)方法,通过两阶段推理触发LLM自我纠正,显著降低越狱攻击成功率,且不损害有用性。

摘要:

将大型语言模型(LLMs)与人类价值观对齐,尤其是在面对复杂且隐蔽的越狱攻击时,是一项艰巨的挑战。不幸的是,现有方法往往忽视了越狱攻击的这一内在本质,这限制了它们在复杂场景中的有效性。在本研究中,我们提出了一种简单而高效的防御策略,即意图分析($\mathbb{IA}$)。$\mathbb{IA}$ 通过两阶段过程触发LLMs固有的自我纠正和提升能力:1)分析用户输入的基本意图,2)基于第一轮对话提供最终符合政策对齐的响应。值得注意的是,$\mathbb{IA}$ 是一种仅推理的方法,因此可以在不损害其有用性的情况下增强LLM的安全性。在多种越狱基准测试和多种LLM上的广泛实验表明,$\mathbb{IA}$ 能够持续且显著地降低响应中的有害性(平均攻击成功率降低-48.2%)。令人鼓舞的是,使用我们的 $\mathbb{IA}$,Vicuna-7B 在攻击成功率方面甚至超过了GPT-3.5。我们通过实验证明,$\mathbb{IA}$ 在一定程度上对生成的意图中的错误具有鲁棒性。进一步的分析揭示了 $\mathbb{IA}$ 的基本原则:抑制LLM遵循越狱提示的倾向,从而增强安全性。

英文摘要:

Aligning large language models (LLMs) with human values, particularly when facing complex and stealthy jailbreak attacks, presents a formidable challenge. Unfortunately, existing methods often overlook this intrinsic nature of jailbreaks, which limits their effectiveness in such complex scenarios. In this study, we present a simple yet highly effective defense strategy, i.e., Intention Analysis ($\mathbb{IA}$). $\mathbb{IA}$ works by triggering LLMs' inherent self-correct and improve ability through a two-stage process: 1) analyzing the essential intention of the user input, and 2) providing final policy-aligned responses based on the first round conversation. Notably, $\mathbb{IA}$ is an inference-only method, thus could enhance LLM safety without compromising their helpfulness. Extensive experiments on varying jailbreak benchmarks across a wide range of LLMs show that $\mathbb{IA}$ could consistently and significantly reduce the harmfulness in responses (averagely -48.2% attack success rate). Encouragingly, with our $\mathbb{IA}$, Vicuna-7B even outperforms GPT-3.5 regarding attack success rate. We empirically demonstrate that, to some extent, $\mathbb{IA}$ is robust to errors in generated intentions. Further analyses reveal the underlying principle of $\mathbb{IA}$: suppressing LLM's tendency to follow jailbreak prompts, thereby enhancing safety.

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

↑