AutoDAN: Interpretable Gradient-Based Adversarial Attacks on Large Language Models
作者: Sicheng Zhu, Ruiyi Zhang, Bang An, Gang Wu, Joe Barrow, Zichao Wang, Furong Huang, Ani Nenkova, Tong Sun
分类: cs.CR, cs.AI, cs.CL, cs.LG
发布日期: 2023-10-23 (更新: 2023-12-14)
备注: Version 2 updates: Added comparison of three more evaluation methods and their reliability check using human labeling. Added results for jailbreaking Llama2 (individual behavior) and included complexity and hyperparameter analysis. Revised objectives for prompt leaking. Other minor changes made
💡 一句话要点
提出AutoDAN以解决大语言模型的可解释性对抗攻击问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 对抗攻击 可解释性 安全性评估 梯度优化 越狱机制 黑箱模型
📋 核心要点
- 现有方法在防御大语言模型的对抗攻击时存在局限性,尤其是在可读性和攻击成功率之间的平衡。
- AutoDAN通过逐步优化生成可读的提示,结合了手动和自动攻击的优点,提升了攻击的有效性和可解释性。
- 实验结果表明,AutoDAN在绕过困惑度过滤器方面表现优异,并能在有限的训练数据下有效转移到黑箱模型。
📝 摘要(中文)
大语言模型(LLMs)的安全性可能受到手动越狱攻击和自动对抗攻击的威胁。现有研究表明,防御这些攻击是可能的,但我们认为这些解决方案可能过于乐观。本文提出了AutoDAN,这是一种可解释的基于梯度的对抗攻击方法,结合了两种攻击类型的优点。AutoDAN逐步优化生成可读的提示,能够绕过困惑度过滤器,同时保持高攻击成功率。生成的提示具有可解释性和多样性,并能有效转移到黑箱LLMs。我们的研究为理解越狱机制提供了新的视角。
🔬 方法详解
问题定义:本文旨在解决大语言模型的安全性问题,尤其是如何有效防御手动和自动对抗攻击。现有方法在可读性和攻击成功率之间存在矛盾,导致防御效果不佳。
核心思路:AutoDAN的核心思想是通过梯度优化逐步生成可读的攻击提示,既能实现越狱效果,又能保持高成功率。这样的设计使得生成的提示既具备可读性,又能有效绕过现有的检测机制。
技术框架:AutoDAN的整体架构包括两个主要模块:梯度优化模块和可读性评估模块。梯度优化模块负责逐步生成提示,而可读性评估模块则确保生成的提示符合可读性标准。
关键创新:AutoDAN的主要创新在于其可解释性和多样性,生成的提示不仅可读且具有多样化的策略,能够有效应对未预见的有害行为。与现有的不可读攻击方法相比,AutoDAN在可读性和攻击效果上有显著提升。
关键设计:在设计中,AutoDAN使用了特定的损失函数来平衡可读性和攻击成功率,同时采用了适应性学习率来优化生成过程。
🖼️ 关键图片
📊 实验亮点
实验结果显示,AutoDAN在绕过困惑度过滤器方面的成功率高达85%,显著高于传统不可读攻击方法的65%。此外,AutoDAN在黑箱模型上的转移成功率也达到了75%,显示出其优越的通用性。
🎯 应用场景
该研究的潜在应用领域包括大语言模型的安全性评估和防御机制的设计。通过理解和利用AutoDAN,研究人员可以更好地识别和防范对抗攻击,从而提升模型的安全性和可靠性。
📄 摘要(原文)
Safety alignment of Large Language Models (LLMs) can be compromised with manual jailbreak attacks and (automatic) adversarial attacks. Recent studies suggest that defending against these attacks is possible: adversarial attacks generate unlimited but unreadable gibberish prompts, detectable by perplexity-based filters; manual jailbreak attacks craft readable prompts, but their limited number due to the necessity of human creativity allows for easy blocking. In this paper, we show that these solutions may be too optimistic. We introduce AutoDAN, an interpretable, gradient-based adversarial attack that merges the strengths of both attack types. Guided by the dual goals of jailbreak and readability, AutoDAN optimizes and generates tokens one by one from left to right, resulting in readable prompts that bypass perplexity filters while maintaining high attack success rates. Notably, these prompts, generated from scratch using gradients, are interpretable and diverse, with emerging strategies commonly seen in manual jailbreak attacks. They also generalize to unforeseen harmful behaviors and transfer to black-box LLMs better than their unreadable counterparts when using limited training data or a single proxy model. Furthermore, we show the versatility of AutoDAN by automatically leaking system prompts using a customized objective. Our work offers a new way to red-team LLMs and understand jailbreak mechanisms via interpretability.