ChatPaper.aiChatPaper

安全なアンラーニング:ジェイルブレイク攻撃に対する驚くほど効果的で汎用性の高い防御ソリューション

Safe Unlearning: A Surprisingly Effective and Generalizable Solution to Defend Against Jailbreak Attacks

July 3, 2024
著者: Zhexin Zhang, Junxiao Yang, Pei Ke, Shiyao Cui, Chujie Zheng, Hongning Wang, Minlie Huang
cs.AI

要旨

LLM(大規模言語モデル)は、安全性のアラインメントを行った後でも、ジャイルブレイク攻撃に対して脆弱であることが知られています。重要な観察点として、異なるタイプのジャイルブレイク攻撃は大きく異なるクエリを生成する可能性があるものの、それらの攻撃はほとんど同じ有害な知識(例えば、爆弾の作り方の詳細な手順)に根ざした類似の応答を引き起こす傾向があります。したがって、我々は、主流の教師ありファインチューニング(SFT)ベースのアプローチよりも、LLM内の有害な知識を直接「アンラーニング(忘却)」することが、ジャイルブレイク攻撃に対するより効果的な防御方法であると推測しました。我々の広範な実験はこの洞察を裏付け、アンラーニングベースのアプローチの驚くべき汎化能力を示しました:トレーニング中にジャイルブレイクプロンプトを使用せず、わずか20の生の有害な質問を用いることで、我々のソリューションは、Vicuna-7Bにおける分布外(OOD)の有害な質問に対する攻撃成功率(ASR)を、複雑なジャイルブレイクプロンプトでラップされた場合でも82.6%から7.7%に削減しました。これは、約10万の安全性アラインメントサンプルでファインチューニングされ、追加の安全性システムプロンプトの助けを借りてもASRが21.9%であるLlama2-7B-Chatを大幅に上回る結果です。さらなる分析により、我々のソリューションの汎化能力は、有害な質問間の応答パターン、共有される手順やアクション、およびLLM内で学習された表現の類似性など、有害な応答間の本質的な関連性に由来することが明らかになりました。我々のコードはhttps://github.com/thu-coai/SafeUnlearningで公開されています。
English
LLMs are known to be vulnerable to jailbreak attacks, even after safety alignment. 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). Therefore, we conjecture that directly unlearn the harmful knowledge in the LLM can be a more effective way to defend against jailbreak attacks than the mainstream supervised fine-tuning (SFT) based approaches. Our extensive experiments confirmed our insight and suggested surprising generalizability of our unlearning-based approach: using only 20 raw harmful questions without any jailbreak prompt during training, our solution reduced the Attack Success Rate (ASR) in Vicuna-7B on out-of-distribution (OOD) harmful questions wrapped with various complex jailbreak prompts from 82.6\% to 7.7\%. This significantly outperforms Llama2-7B-Chat, which is fine-tuned on about 0.1M safety alignment samples but still has an ASR of 21.9\% even under the help of an additional safety system prompt. Further analysis reveals that the generalization ability of our solution stems from the intrinsic relatedness among harmful responses across harmful questions (e.g., response patterns, shared steps and actions, and similarity among their learned representations in the LLM). Our code is available at https://github.com/thu-coai/SafeUnlearning.

Summary

AI-Generated Summary

PDF131November 28, 2024