arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2412.17034cs.CL

塑造安全边界:理解与防御大语言模型中的越狱攻击

Shaping the Safety Boundaries: Understanding and Defending Against Jailbreaks in Large Language Models

MBZUAI;Huazhong University of Science and Technology(华中科技大学);University of Notre Dame(诺丁汉大学)

Lang Gao, Jiahui Geng, Xiangliang Zhang, Preslav Nakov, Xiuying Chen

AI总结:

本研究通过分析7种越狱方法提出“安全边界”概念,发现低层和中层是激活值转移的关键层,据此提出基于贝叶斯优化的激活边界防御方法,实现超98%的防御成功率且对模型能力影响极小。

摘要:

大语言模型(LLM)中的越狱攻击是一项重大安全隐患,因为它能诱使LLM生成有害文本。然而目前人们对越狱攻击的作用机制理解仍不充分,导致难以制定有效的防御策略。本研究旨在深入阐明这一问题:我们对7种不同的越狱方法开展了大规模详细分析,发现相关认知分歧源于观测样本不足。具体而言,我们提出“安全边界”概念,并发现越狱攻击会将有害激活值转移到该安全边界之外,而LLM在安全边界外对有害信息的敏感度更低。我们还发现,低层和中层在这类激活值转移中起到关键作用,而深层的影响较小。基于这些洞见,我们提出了一种名为**激活边界防御(Activation Boundary Defense, ABD)**的新型防御方法,它能自适应地将激活值约束在安全边界内。我们进一步使用贝叶斯优化,将该防御方法选择性地应用于低层和中层。我们在多个基准上的实验表明,ABD针对各类越狱攻击的平均防御成功率(DSR)超过98%,且对模型通用能力的影响不足2%。

英文摘要:

Jailbreaking in Large Language Models (LLMs) is a major security concern as it can deceive LLMs to generate harmful text. Yet, there is still insufficient understanding of how jailbreaking works, which makes it hard to develop effective defense strategies. We aim to shed more light into this issue: we conduct a detailed large-scale analysis of seven different jailbreak methods and find that these disagreements stem from insufficient observation samples. In particular, we introduce \textit{safety boundary}, and we find that jailbreaks shift harmful activations outside that safety boundary, where LLMs are less sensitive to harmful information. We also find that the low and the middle layers are critical in such shifts, while deeper layers have less impact. Leveraging on these insights, we propose a novel defense called \textbf{Activation Boundary Defense} (ABD), which adaptively constrains the activations within the safety boundary. We further use Bayesian optimization to selectively apply the defense method to the low and the middle layers. Our experiments on several benchmarks show that ABD achieves an average DSR of over 98\% against various forms of jailbreak attacks, with less than 2\% impact on the model's general capabilities.

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

↑