DrAttack:提示词分解与重构打造强大的 LLM 越狱攻击器
DrAttack: Prompt Decomposition and Reconstruction Makes Powerful LLM Jailbreakers
AI总结:
本文提出 DrAttack 框架,通过将恶意提示词分解为子提示词、利用上下文学习隐式重构及同义词搜索来掩盖恶意意图,在大幅减少查询次数下显著提升了 LLM 越狱攻击成功率。
摘要:
大型语言模型(LLMs)的安全对齐容易受到手动和自动化越狱攻击的破坏,这些攻击会对抗性地触发 LLMs 输出有害内容。然而,当前的 LLM 越狱方法嵌套了完整的有害提示词,在掩盖恶意意图方面效果不佳,很容易被对齐良好的 LLMs 识别并拒绝。本文发现,将恶意提示词分解为独立的子提示词,能以碎片化、不易察觉的形式呈现,从而有效掩盖其潜在的恶意意图,进而解决上述局限性。我们提出了一种用于越狱攻击(DrAttack)的自动化提示词分解与重构框架。DrAttack 包含三个关键组件:(a) 将原始提示词“分解”为子提示词;(b) 通过使用语义相似但无害的重组示例进行上下文学习,隐式地“重构”这些子提示词;(c) 针对子提示词进行“同义词搜索”,旨在寻找能保持原始意图同时越狱 LLMs 的子提示词同义词。在多个开源和闭源 LLMs 上的广泛实证研究表明,DrAttack 在查询次数大幅减少的情况下,其成功率比先前的 SOTA 纯提示词攻击器获得了显著提升。值得注意的是,在 GPT-4 上仅需 15 次查询即可达到 78.0% 的成功率,比之前的最优技术高出 33.1%。该项目可在 https://github.com/xirui-li/DrAttack 获取。
英文摘要:
The safety alignment of Large Language Models (LLMs) is vulnerable to both manual and automated jailbreak attacks, which adversarially trigger LLMs to output harmful content. However, current methods for jailbreaking LLMs, which nest entire harmful prompts, are not effective at concealing malicious intent and can be easily identified and rejected by well-aligned LLMs. This paper discovers that decomposing a malicious prompt into separated sub-prompts can effectively obscure its underlying malicious intent by presenting it in a fragmented, less detectable form, thereby addressing these limitations. We introduce an automatic prompt \textbf{D}ecomposition and \textbf{R}econstruction framework for jailbreak \textbf{Attack} (DrAttack). DrAttack includes three key components: (a) `Decomposition' of the original prompt into sub-prompts, (b) `Reconstruction' of these sub-prompts implicitly by in-context learning with semantically similar but harmless reassembling demo, and (c) a `Synonym Search' of sub-prompts, aiming to find sub-prompts' synonyms that maintain the original intent while jailbreaking LLMs. An extensive empirical study across multiple open-source and closed-source LLMs demonstrates that, with a significantly reduced number of queries, DrAttack obtains a substantial gain of success rate over prior SOTA prompt-only attackers. Notably, the success rate of 78.0\% on GPT-4 with merely 15 queries surpassed previous art by 33.1\%. The project is available at https://github.com/xirui-li/DrAttack.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。