通过可学习的指令重写实现高效隐蔽的模型越狱攻击
Rewrite to Jailbreak: Discover Learnable and Transferable Implicit Harmfulness Instruction
- 用迭代重写指令代替显式恶意提示,自动优化攻击策略
- 仅需少量查询即可在多个数据集和模型上成功越狱
- 攻击隐秘性强,无额外标记特征,适合研究模型安全边界
随着大语言模型在各领域广泛应用,其安全性日益受到关注,以防止强大能力被滥用。现有越狱方法多依赖强制指令遵循或手动/自动搜索带有前缀/后缀标记的对抗性提示,存在效率低、模式明显等问题,难以模拟真实的大规模攻击场景。本文指出,仅通过重写原始指令即可实现越狱,并发现该方法具有可学习性和可迁移性。我们提出 Rewrite to Jailbreak(R2J)方法,一种可迁移的黑盒越狱攻击框架,通过迭代探索模型弱点并自动优化攻击策略。该方法无需引入额外特征,攻击更高效且难以被识别。大量实验与分析表明,R2J 在多个数据集和多种模型上均有效,仅需少数查询即可完成越狱。我们希望本工作能推动对大语言模型安全性的深入研究。代码已开源:https://github.com/ythuang02/R2J/
原文摘要 · Abstract (English)
As Large Language Models (LLMs) are widely applied in various domains, the safety of LLMs is increasingly attracting attention to avoid their powerful capabilities being misused. Existing jailbreak methods create a forced instruction-following scenario, or search adversarial prompts with prefix or suffix tokens to achieve a specific representation manually or automatically. However, they suffer from low efficiency and explicit jailbreak patterns, far from the real deployment of mass attacks to LLMs. In this paper, we point out that simply rewriting the original instruction can achieve a jailbreak, and we find that this rewriting approach is learnable and transferable. We propose the Rewrite to Jailbreak (R2J) approach, a transferable black-box jailbreak method to attack LLMs by iteratively exploring the weakness of the LLMs and automatically improving the attacking strategy. The jailbreak is more efficient and hard to identify since no additional features are introduced. Extensive experiments and analysis demonstrate the effectiveness of R2J, and we find that the jailbreak is also transferable to multiple datasets and various types of models with only a few queries. We hope our work motivates further investigation of LLM safety. The code can be found at https://github.com/ythuang02/R2J/.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。