arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.12192cs.CRcs.AI
收藏

通过上下文学习防御预填充攻击没有免费午餐

No Free Lunch for Defending Against Prefilling Attack by In-Context Learning

University of California, Santa Barbara(加利福尼亚大学圣巴巴拉分校);Michigan State University(密歇根州立大学)

Zhiyu Xue, Guangliang Liu, Bocheng Chen, Kristen Marie Johnson, Ramtin Pedarsani

AI总结:

本文证明上下文学习(ICL)通过对立句子结构可有效防御预填充越狱攻击,但存在过度防御,且安全对齐方法无效,表明无免费午餐。

摘要:

大型语言模型(LLMs)的安全性自ChatGPT出现以来已成为一个重要的研究课题。尽管已有各种有效的方法来防御越狱攻击,但预填充攻击仍然是针对开源LLM的一个未解决且流行的威胁。上下文学习(ICL)提供了一种计算高效的防御各种越狱攻击的方法,但尚未开发出有效的ICL方法来对抗预填充攻击。在本文中,我们:(1)表明通过利用演示中的对立句子结构,ICL可以有效防御预填充越狱攻击;(2)从模型大小、演示数量、过度防御、与其他越狱攻击的集成以及安全对齐的存在等角度来表征这种防御的有效性。鉴于实验结果和我们的分析,我们得出结论:使用ICL防御预填充越狱攻击没有免费午餐。一方面,当前的安全对齐方法未能缓解预填充越狱攻击,但ICL演示中的对立结构在各种模型大小和复杂越狱攻击中提供了稳健的防御。另一方面,当利用具有对立结构的ICL演示时,LLMs表现出类似的过度防御性,且这种行为似乎与模型大小无关。

英文摘要:

The security of Large Language Models (LLMs) has become an important research topic since the emergence of ChatGPT. Though there have been various effective methods to defend against jailbreak attacks, prefilling attacks remain an unsolved and popular threat against open-sourced LLMs. In-Context Learning (ICL) offers a computationally efficient defense against various jailbreak attacks, yet no effective ICL methods have been developed to counter prefilling attacks. In this paper, we: (1) show that ICL can effectively defend against prefilling jailbreak attacks by employing adversative sentence structures within demonstrations; (2) characterize the effectiveness of this defense through the lens of model size, number of demonstrations, over-defense, integration with other jailbreak attacks, and the presence of safety alignment. Given the experimental results and our analysis, we conclude that there is no free lunch for defending against prefilling jailbreak attacks with ICL. On the one hand, current safety alignment methods fail to mitigate prefilling jailbreak attacks, but adversative structures within ICL demonstrations provide robust defense across various model sizes and complex jailbreak attacks. On the other hand, LLMs exhibit similar over-defensiveness when utilizing ICL demonstrations with adversative structures, and this behavior appears to be independent of model size.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑