从盗窃到炸弹制作:遗忘在抵御越狱攻击中的涟漪效应
From Theft to Bomb-Making: The Ripple Effect of Unlearning in Defending Against Jailbreak Attacks
AI总结:
本研究发现大语言模型遗忘防御存在涟漪效应,即明确遗忘某类有害知识时会隐式遗忘关联有害知识,仅用100个训练样本即可将未见数据越狱攻击成功率从70%以上降至10%以下,并分析了泛化原因与局限。
摘要:
大语言模型(LLM)已知易受越狱攻击。一项重要观察是,尽管不同类型的越狱攻击可生成差异极大的查询,但它们大多会产生源于相同有害知识(例如制作炸弹的详细步骤)的相似响应。因此,研究者提出了基于遗忘的方法,通过直接从模型中移除有害知识来缓解越狱攻击。本文中,我们发现了一种新的遗忘涟漪效应:大语言模型能够隐式地遗忘在遗忘阶段未被明确引入的有害知识(例如,模型在遗忘盗窃步骤的同时,也可能隐式遗忘炸弹制作步骤)。通过横跨多个模型、攻击策略和防御方法的100余次实验运行,我们从实证角度验证了这一现象——该效应使得基于遗忘的方法仅用100个训练样本,就能将未见数据上的攻击成功率从70%以上降至10%以下。进一步分析表明,遗忘的强泛化能力可能源于不同有害问题的有害响应之间的内在关联性(例如响应模式、响应中共享的步骤和动作,以及它们在大语言模型中习得表征的相似性)。我们还讨论了遗忘及所观察到的涟漪效应的潜在局限性。我们希望本研究能有助于加深对遗忘的理解。我们的代码可在https://github.com/thu-coai/SafeUnlearning获取。
英文摘要:
Large Language Models (LLMs) are known to be vulnerable to jailbreak attacks. An important observation is that, while different types of jailbreak attacks can generate significantly different queries, they mostly result in similar responses that are rooted in the same harmful knowledge (e.g., detailed steps to make a bomb). Consequently, unlearning-based approaches have been proposed to mitigate jailbreak attacks by directly removing harmful knowledge from the model. In this paper, we identify a novel ripple effect of unlearning, wherein LLMs can implicitly unlearn harmful knowledge that was not explicitly introduced during the unlearning phase (e.g., a model unlearning the steps for theft may also implicitly unlearn the steps for making a bomb). Through over 100 experimental runs spanning multiple models, attack strategies, and defense methods, we empirically validate this phenomenon, which makes unlearning-based methods able to decrease the Attack Success Rate on unseen data from more than 70% to less than 10% with only 100 training samples. Further analysis reveals that the strong generalization ability of unlearning may stem from the intrinsic relatedness among harmful responses across harmful questions (e.g., response patterns, shared steps and actions in response, and similarity among their learned representations in the LLM). We also discuss the potential limitations of unlearning and the observed ripple effect. We hope our research could contribute to a deeper understanding of unlearning. Our code is available at https://github.com/thu-coai/SafeUnlearning.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。