arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2405.16229cs.CLcs.CR
收藏

没有两个相同的恶魔:揭示微调攻击的不同机制

No Two Devils Alike: Unveiling Distinct Mechanisms of Fine-tuning Attacks

The Hong Kong Polytechnic University(香港理工大学)

Chak Tou Leong, Yi Cheng, Kaishuai Xu, Jian Wang, Hanlin Wang, Wenjie Li

AI总结:

本文通过分解LLM安全保护过程为三阶段,分析显式有害攻击和身份转换攻击的机制,发现两者截然不同,强调需多样化防御策略。

摘要:

现有的大语言模型(LLMs)的安全对齐被发现是脆弱的,并且可以通过不同的策略轻易被攻击,例如在少量有害示例上进行微调或操纵生成结果的前缀。然而,这些策略的攻击机制仍未得到充分探索。在本文中,我们提出以下问题:虽然这些方法都能显著损害安全性,但它们的攻击机制是否表现出强烈的相似性?为了回答这个问题,我们将LLM在遇到有害指令时的保护过程分解为三个阶段:(1)识别有害指令,(2)生成初始拒绝语气,以及(3)完成拒绝响应。相应地,我们调查了不同的攻击策略是否以及如何影响这一保护过程的每个阶段。我们利用logit lens和activation patching等技术来识别驱动特定行为的模型组件,并应用跨模型探测来检查攻击后的表示变化。特别地,我们分析了两种最具代表性的攻击类型:显式有害攻击(EHA)和身份转换攻击(ISA)。令人惊讶的是,我们发现它们的攻击机制截然不同。与ISA不同,EHA倾向于激进地针对有害识别阶段。虽然EHA和ISA都破坏了后两个阶段,但它们的攻击程度和机制存在显著差异。我们的发现强调了理解LLM内部保护过程的重要性,并表明需要多样化的防御机制来有效应对各种类型的攻击。

英文摘要:

The existing safety alignment of Large Language Models (LLMs) is found fragile and could be easily attacked through different strategies, such as through fine-tuning on a few harmful examples or manipulating the prefix of the generation results. However, the attack mechanisms of these strategies are still underexplored. In this paper, we ask the following question: \textit{while these approaches can all significantly compromise safety, do their attack mechanisms exhibit strong similarities?} To answer this question, we break down the safeguarding process of an LLM when encountered with harmful instructions into three stages: (1) recognizing harmful instructions, (2) generating an initial refusing tone, and (3) completing the refusal response. Accordingly, we investigate whether and how different attack strategies could influence each stage of this safeguarding process. We utilize techniques such as logit lens and activation patching to identify model components that drive specific behavior, and we apply cross-model probing to examine representation shifts after an attack. In particular, we analyze the two most representative types of attack approaches: Explicit Harmful Attack (EHA) and Identity-Shifting Attack (ISA). Surprisingly, we find that their attack mechanisms diverge dramatically. Unlike ISA, EHA tends to aggressively target the harmful recognition stage. While both EHA and ISA disrupt the latter two stages, the extent and mechanisms of their attacks differ significantly. Our findings underscore the importance of understanding LLMs' internal safeguarding process and suggest that diverse defense mechanisms are required to effectively cope with various types of attacks.

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

↑