xJailbreak:面向可解释 LLM 越狱的表示空间引导强化学习
xJailbreak: Representation Space Guided Reinforcement Learning for Interpretable LLM Jailbreaking
AI总结:
针对黑盒越狱中启发式方法随机性强及RL奖励信号缺乏的问题,提出利用良性/恶意提示词嵌入邻近度引导强化学习优化提示生成,并构建综合评估框架,在多个开源与闭源LLM上实现SOTA越狱效果。
摘要:
安全对齐机制对于防止大型语言模型(LLMs)生成有害信息或不道德内容至关重要。然而,精心构造的提示词可以在不访问模型内部参数的情况下绕过这些安全措施,这种现象被称为黑盒越狱。现有的启发式黑盒攻击方法(如遗传算法)由于其固有的随机性而效果受限,而近期基于强化学习(RL)的方法往往缺乏稳健且信息丰富的奖励信号。为了解决这些挑战,我们提出了一种利用 RL 的新型黑盒越狱方法,该方法通过分析良性提示词与恶意提示词之间的嵌入邻近度来优化提示词生成。这种方法确保重写后的提示词紧密契合原始提示词的意图,同时增强攻击的有效性。此外,我们引入了一个综合性的越狱评估框架,结合关键词、意图匹配和答案验证,为越狱成功提供更严谨、更全面的评估。实验结果表明了我们方法的优越性,在多个知名的开源和闭源 LLMs 上取得了最先进(SOTA)的性能,包括 Qwen2.5-7B-Instruct、Llama3.1-8B-Instruct 和 GPT-4o-0806。我们的方法在越狱攻击有效性方面设定了新的基准,突显了 LLMs 中的潜在漏洞。本工作的代码库可在 https://github.com/Aegis1863/xJailbreak 获取。
英文摘要:
Safety alignment mechanism are essential for preventing large language models (LLMs) from generating harmful information or unethical content. However, cleverly crafted prompts can bypass these safety measures without accessing the model's internal parameters, a phenomenon known as black-box jailbreak. Existing heuristic black-box attack methods, such as genetic algorithms, suffer from limited effectiveness due to their inherent randomness, while recent reinforcement learning (RL) based methods often lack robust and informative reward signals. To address these challenges, we propose a novel black-box jailbreak method leveraging RL, which optimizes prompt generation by analyzing the embedding proximity between benign and malicious prompts. This approach ensures that the rewritten prompts closely align with the intent of the original prompts while enhancing the attack's effectiveness. Furthermore, we introduce a comprehensive jailbreak evaluation framework incorporating keywords, intent matching, and answer validation to provide a more rigorous and holistic assessment of jailbreak success. Experimental results show the superiority of our approach, achieving state-of-the-art (SOTA) performance on several prominent open and closed-source LLMs, including Qwen2.5-7B-Instruct, Llama3.1-8B-Instruct, and GPT-4o-0806. Our method sets a new benchmark in jailbreak attack effectiveness, highlighting potential vulnerabilities in LLMs. The codebase for this work is available at https://github.com/Aegis1863/xJailbreak.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。