PMET: Precise Model Editing in a Transformer

要約

モデル編集技術は、比較的低コストで大規模言語モデル (LLM) 内の知識のごく一部を変更し、顕著な成功を収めています。
既存の方法では、トランスフォーマー層 (TL) の隠れ状態がフィードフォワード ネットワーク (FFN) のキーと値のメモリの値であると想定しています。
通常、TL の隠れ状態を最適化してターゲットの知識を記憶し、それを使用して LLM の FFN の重みを更新します。
ただし、TL の隠れ状態の情報フローは、マルチヘッド セルフ アテンション (MHSA)、FFN、および残留接続の 3 つの部分から生じます。
既存の方法では、TL の隠れ状態には FFN に特に必要ではない情報が含まれているという事実が無視されています。
その結果、モデル編集のパフォーマンスが低下します。
より正確なモデル編集を実現するために、MHSA と FFN の隠れた状態を分析し、MHSA が特定の一般知識抽出パターンをエンコードしていることを発見しました。
これは、新しい知識が導入されたときに MHSA の重みを更新する必要がないことを意味します。
上記の発見に基づいて、FFN の重みを正確に更新するために FFN の最適化された TC 隠れ状態のみを使用しながら、トランス コンポーネント (TC、つまり MHSA と FFN) の隠れ状態を同時に最適化する PMET を導入します。
私たちの実験では、PMET が COUNTERFACT データセットと zsRE データセットの両方で最先端のパフォーマンスを示すことが実証されました。
私たちのアブレーション実験は、私たちの強化の有効性を実証し、MHSA が特定の一般知識抽出パターンをエンコードし、少量の事実知識を保存していることを示すという発見をさらに補強します。
私たちのコードは https://github.com/xpq-tech/PMET で入手できます。

要約(オリジナル)

Model editing techniques modify a minor proportion of knowledge in Large Language Models (LLMs) at a relatively low cost, which have demonstrated notable success. Existing methods assume Transformer Layer (TL) hidden states are values of key-value memories of the Feed-Forward Network (FFN). They usually optimize the TL hidden states to memorize target knowledge and use it to update the weights of the FFN in LLMs. However, the information flow of TL hidden states comes from three parts: Multi-Head Self-Attention (MHSA), FFN, and residual connections. Existing methods neglect the fact that the TL hidden states contains information not specifically required for FFN. Consequently, the performance of model editing decreases. To achieve more precise model editing, we analyze hidden states of MHSA and FFN, finding that MHSA encodes certain general knowledge extraction patterns. This implies that MHSA weights do not require updating when new knowledge is introduced. Based on above findings, we introduce PMET, which simultaneously optimizes Transformer Component (TC, namely MHSA and FFN) hidden states, while only using the optimized TC hidden states of FFN to precisely update FFN weights. Our experiments demonstrate that PMET exhibits state-of-the-art performance on both the COUNTERFACT and zsRE datasets. Our ablation experiments substantiate the effectiveness of our enhancements, further reinforcing the finding that the MHSA encodes certain general knowledge extraction patterns and indicating its storage of a small amount of factual knowledge. Our code is available at https://github.com/xpq-tech/PMET.

arxiv情報

著者 Xiaopeng Li,Shasha Li,Shezheng Song,Jing Yang,Jun Ma,Jie Yu
発行日 2023-12-13 12:00:26+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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