On the Role of Attention Heads in Large Language Model Safety

要約

大規模言語モデル (LLM) は、複数の言語タスクで最先端のパフォーマンスを実現しますが、その安全ガードレールが回避され、有害な世代が発生する可能性があります。
これを踏まえて、安全メカニズムに関する最近の研究が発表され、安全表現またはコンポーネントが抑制されると、LLM の安全能力が損なわれることが明らかになりました。
しかし、既存の研究では、さまざまなモデルの機能において多頭注意メカニズムが重要な役割を果たしているにもかかわらず、その安全性への影響が見落とされる傾向があります。
したがって、この論文では、安全関連のメカニズムの解釈可能性におけるこのギャップを埋めるために、標準的な注意メカニズムと安全能力の間の関係を調査することを目的としています。
我々は、モデルの安全性に対する個々の頭部の貢献を評価するために、複数の頭部の注意に合わせた新しい指標である安全頭部重要スコア (Ships) を提案します。
これに基づいて、船舶をデータセット レベルに一般化し、さらに安全注意ヘッド属性アルゴリズム (Sahara) を導入して、モデル内の重要な安全注意ヘッドを帰属させます。
私たちの調査結果は、特別な注意を払うヘッドが安全性に大きな影響を与えることを示しています。
単一の安全ヘッドをアブレーションすると、以前の研究では約 5% の修正が必要であったのに対し、調整されたモデル (Llama-2-7b-chat など) はパラメータの 0.006% のみを修正しながら、16 倍の有害なクエリに応答できるようになります。
さらに重要なことは、アテンションヘッドが主に安全のための特徴抽出器として機能し、同じベースモデルから微調整されたモデルが、包括的な実験を通じて重複する安全ヘッドを示すことを実証したことです。
私たちのアトリビューションアプローチと調査結果は、大規模モデル内の安全メカニズムのブラックボックスを解き明かすための新しい視点を提供します。

要約(オリジナル)

Large language models (LLMs) achieve state-of-the-art performance on multiple language tasks, yet their safety guardrails can be circumvented, leading to harmful generations. In light of this, recent research on safety mechanisms has emerged, revealing that when safety representations or component are suppressed, the safety capability of LLMs are compromised. However, existing research tends to overlook the safety impact of multi-head attention mechanisms, despite their crucial role in various model functionalities. Hence, in this paper, we aim to explore the connection between standard attention mechanisms and safety capability to fill this gap in the safety-related mechanistic interpretability. We propose a novel metric which tailored for multi-head attention, the Safety Head ImPortant Score (Ships), to assess the individual heads’ contributions to model safety. Based on this, we generalize Ships to the dataset level and further introduce the Safety Attention Head AttRibution Algorithm (Sahara) to attribute the critical safety attention heads inside the model. Our findings show that the special attention head has a significant impact on safety. Ablating a single safety head allows aligned model (e.g., Llama-2-7b-chat) to respond to 16 times more harmful queries, while only modifying 0.006% of the parameters, in contrast to the ~ 5% modification required in previous studies. More importantly, we demonstrate that attention heads primarily function as feature extractors for safety and models fine-tuned from the same base model exhibit overlapping safety heads through comprehensive experiments. Together, our attribution approach and findings provide a novel perspective for unpacking the black box of safety mechanisms within large models.

arxiv情報

著者 Zhenhong Zhou,Haiyang Yu,Xinghua Zhang,Rongwu Xu,Fei Huang,Kun Wang,Yang Liu,Junfeng Fang,Yongbin Li
発行日 2024-10-17 16:08:06+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.CR, cs.LG パーマリンク