Skip to main content
QUICK REVIEW

[论文解读] Intention Analysis Makes LLMs A Good Jailbreak Defender

Yuqi Zhang, Liang Ding|arXiv (Cornell University)|Jan 12, 2024
Adversarial Robustness in Machine Learning被引用 4
一句话总结

本文提出了一种名为意图分析提示(Intention Analysis Prompting, IAPrompt)的新方法,这是一种仅推理的防御机制,通过在生成回复前引导模型先分析用户的潜在意图,从而提升大语言模型的安全性。通过采用两阶段流程——意图分析后接符合政策的回复生成——IAPrompt 在多个模型和基准测试中平均将越狱攻击的成功率降低了 46.5%,同时保持了模型的有用性。

ABSTRACT

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.

研究动机与目标

  • 为应对传统对齐方法难以防范的隐蔽越狱攻击日益增长的威胁。
  • 开发一种增强安全性的防御机制,同时不损害模型的有用性且无需微调。
  • 利用大语言模型内在的自我修正与意图理解能力,实现强大且可扩展的安全防护。
  • 验证意图分析作为检测和缓解用户查询中恶意意图的核心组件的有效性。

提出的方法

  • IAPrompt 采用两阶段提示框架:首先,模型聚焦于安全、伦理和合法性,分析用户查询的核心意图。
  • 第二阶段基于第一阶段分析出的意图生成符合安全政策的回复。
  • 该方法使用思维链(Chain-of-Thought, CoT)提示引导逐步推理,提升可解释性并增强对隐藏恶意意图的检测能力。
  • 该方法完全基于推理,无需模型微调或外部工具,因此成本低且可立即部署。
  • 其依赖大语言模型自身的推理能力,通过关注意图而非表面标记来检测细微且隐蔽的越狱提示。
  • 该方法在多种模型(Vicuna、ChatGLM、MPT、DeepSeek、GPT-3.5)和基准测试(SAP200、DAN、AdvBench)上进行了评估,表现出一致的性能。

实验结果

研究问题

  • RQ1大语言模型是否能通过无外部监督的自我分析有效检测越狱提示中的恶意意图?
  • RQ2两阶段意图分析与符合政策的回复机制是否能在多种模型和攻击类型下显著降低攻击成功率?
  • RQ3意图分析模型的规模如何影响性能,较小的模型是否足以实现有效检测?
  • RQ4IAPrompt 在增强安全性的同时,对模型有用性的保留程度如何,尤其是在通用基准测试中?
  • RQ5基于大语言模型的有害性检测与人工标注的有害性水平的相关性如何?

主要发现

  • IAPrompt 在 SAP200 和 DAN 基准测试中平均将攻击成功率(ASR)降低了 46.5%,展现出强大且一致的防御性能。
  • 在 SAP200 和 DAN 数据集中,IAPrompt 实现了接近零的有害回复率,Vicuna-13B 和 Vicuna-7B 模型的攻击成功率分别降至 0.31% 和 0.62%。
  • 该方法保持了高水平的有用性,TruthfulQA 结果证实其未对通用性能造成任何下降。
  • Vicuna-7B、Vicuna-13B 和 MPT-30B-Chat 模型在意图分析中均实现了 100% 的成功率,表明其具备强大的隐藏恶意意图检测能力。
  • 当意图被正确识别时,98.74% 的回复为无害,证实该方法与安全政策具有高度一致性。
  • 人工评估显示标注者之间的一致性达 97%,GPT-3.5 与人工标签的一致性在普通模型中达到 99%,在 IAPrompt 中达到 93%,表明其具有高度可靠性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。