CAVGAN:通过对其内部表示的生成对抗攻击统一LLM的越狱与防御
CAVGAN: Unifying Jailbreak and Defense of LLMs via Generative Adversarial Attacks on their Internal Representations
AI总结:
提出CAVGAN框架,利用生成对抗网络学习LLM内部安全边界,统一越狱攻击与防御,在三个LLM上实现88.85%越狱成功率和84.17%防御成功率。
摘要:
安全对齐使大型语言模型(LLM)能够抵御恶意查询,但各种越狱攻击方法揭示了该安全机制的脆弱性。以往的研究将LLM越狱攻击与防御割裂开来。我们分析了LLM的安全保护机制,并提出了一种结合攻击与防御的框架。我们的方法基于LLM中间层嵌入的线性可分性,以及越狱攻击的本质——旨在将有害问题嵌入并转移到安全区域。我们利用生成对抗网络(GAN)学习LLM内部的安全判断边界,以实现高效的越狱攻击与防御。实验结果表明,我们的方法在三个流行的LLM上实现了平均88.85%的越狱成功率,而在最先进的越狱数据集上的防御成功率平均达到84.17%。这不仅验证了我们方法的有效性,还揭示了LLM的内部安全机制,为增强模型安全性提供了新的见解。代码和数据可在https://github.com/NLPGM/CAVGAN获取。
英文摘要:
Security alignment enables the Large Language Model (LLM) to gain the protection against malicious queries, but various jailbreak attack methods reveal the vulnerability of this security mechanism. Previous studies have isolated LLM jailbreak attacks and defenses. We analyze the security protection mechanism of the LLM, and propose a framework that combines attack and defense. Our method is based on the linearly separable property of LLM intermediate layer embedding, as well as the essence of jailbreak attack, which aims to embed harmful problems and transfer them to the safe area. We utilize generative adversarial network (GAN) to learn the security judgment boundary inside the LLM to achieve efficient jailbreak attack and defense. The experimental results indicate that our method achieves an average jailbreak success rate of 88.85\% across three popular LLMs, while the defense success rate on the state-of-the-art jailbreak dataset reaches an average of 84.17\%. This not only validates the effectiveness of our approach but also sheds light on the internal security mechanisms of LLMs, offering new insights for enhancing model security The code and data are available at https://github.com/NLPGM/CAVGAN.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。