arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.11308cs.AIcs.CLcs.CR
收藏

通过大语言模型的早期退出生成防御越狱攻击

Defending against Jailbreak through Early Exit Generation of Large Language Models

Duke Kunshan University(杜克昆山大学)

Chongwen Zhao, Zhihao Dou, Kaizhu Huang

AI总结:

针对大语言模型易遭越狱攻击的问题,借鉴其类人生成过程,利用早期Transformer输出检测恶意输入并终止生成,提出EEG-Defender,显著降低攻击成功率且对模型实用性影响小。

摘要:

大语言模型(LLMs)在各类应用中日益受到关注。然而,部分用户试图利用这些模型实现恶意目的,包括合成管制药物和传播虚假信息,这一问题引发了越来越多的担忧。为降低此类风险,“对齐”技术应运而生。但近期研究表明,通过复杂的提示工程或对抗性后缀可破坏这种对齐,该技术被称为“越狱”。本研究借鉴LLMs类人的生成过程,发现尽管越狱提示可能产生与良性提示相似的输出logits,但其在模型潜在空间中的初始嵌入更接近恶意提示。基于此发现,我们提出利用LLMs的早期Transformer输出来检测恶意输入并立即终止生成,引入一种名为EEG-Defender的简单且有效的防御方法。我们在三个模型上针对十种越狱方法开展了全面实验,结果显示EEG-Defender能显著降低攻击成功率(ASR),相较于现有SOTA方法的约50%,可降低约85%,且对LLMs的实用性影响极小。

英文摘要:

Large Language Models (LLMs) are increasingly attracting attention in various applications. Nonetheless, there is a growing concern as some users attempt to exploit these models for malicious purposes, including the synthesis of controlled substances and the propagation of disinformation. In an effort to mitigate such risks, the concept of "Alignment" technology has been developed. However, recent studies indicate that this alignment can be undermined using sophisticated prompt engineering or adversarial suffixes, a technique known as "Jailbreak." Our research takes cues from the human-like generate process of LLMs. We identify that while jailbreaking prompts may yield output logits similar to benign prompts, their initial embeddings within the model's latent space tend to be more analogous to those of malicious prompts. Leveraging this finding, we propose utilizing the early transformer outputs of LLMs as a means to detect malicious inputs, and terminate the generation immediately. We introduce a simple yet significant defense approach called EEG-Defender for LLMs. We conduct comprehensive experiments on ten jailbreak methods across three models. Our results demonstrate that EEG-Defender is capable of reducing the Attack Success Rate (ASR) by a significant margin, roughly 85% in comparison with 50% for the present SOTAs, with minimal impact on the utility of LLMs.

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

↑