[論文レビュー] AttnLRP: Attention-Aware Layer-Wise Relevance Propagation for Transformers
AttnLRPはLayer-wise Relevance Propagationを非線形トランスフォーマーの注意機構へ拡張し、入力と潜在表現に対する忠実で効率的な寄与度を提供し、ニューロンレベルの理解を可能にする。
Large Language Models are prone to biased predictions and hallucinations, underlining the paramount importance of understanding their model-internal reasoning process. However, achieving faithful attributions for the entirety of a black-box transformer model and maintaining computational efficiency is an unsolved challenge. By extending the Layer-wise Relevance Propagation attribution method to handle attention layers, we address these challenges effectively. While partial solutions exist, our method is the first to faithfully and holistically attribute not only input but also latent representations of transformer models with the computational efficiency similar to a single backward pass. Through extensive evaluations against existing methods on LLaMa 2, Mixtral 8x7b, Flan-T5 and vision transformer architectures, we demonstrate that our proposed approach surpasses alternative methods in terms of faithfulness and enables the understanding of latent representations, opening up the door for concept-based explanations. We provide an LRP library at https://github.com/rachtibat/LRP-eXplains-Transformers.
研究の動機と目的
- 潜在表現を含む大規模トランスフォーマーモデルに対する忠実な寄与度を動機づける。
- トランスフォーマーの非線形注意機構を扱えるようLRPを拡張する。
- オープンソースのAttnLRP実装を提供し、忠実性と効率性の向上を示す。
- AttnLRPがモデル推論のflax内の潜在ニューロンを可視化し、それらと相互作用させる方法を示す。
提案手法
- Deep Taylor Decomposition フレームワーク内で非線形注意機構に対する新しい効率的なLRP規則を導出する。
- 線形層に対してepsilon-LRPおよびgamma-LRP変種を適用し、注意コンポーネントには選択的に適用する。
- 保存と安定性を保つため、ソフトマックス、行列積、正規化層に対する特殊規則を開発する。
- 注意モジュール内外の潜在ニューロンの寄与度を可視化できるようにする。
- GitHubでオープンソース実装を提供する。
- AttnLRPと組み合わせたActivation Maximizationによりニューロンレベルの理解を実証する。
実験結果
リサーチクエスチョン
- RQ1AttnLRPの説明は、トランスフォーマーモデル全般で最先端の寄与度推定法と比較してどれだけ忠実か?
- RQ2AttnLRPの効率は、摂動ベースの説明と比較して時間とメモリの観点でどうか?
- RQ3AttnLRPは潜在ニューロンの表現を可視化・操作してモデル推論を理解できるか?
- RQ4AttnLRPはViTとLLMにおける入力トークンと潜在特徴の寄与度の質を向上させるか?
主な発見
- AttnLRPはViT、Llama 2、Flan-T5の設定で忠実度のベースライン手法を一貫して上回る。
- Gamma-LRP変種はVision Transformersの忠実度を向上させ、寄与度のノイズを低減する。
- AttnLRPは潜在ニューロンの信頼性の高い寄与度推定を可能にし、概念ベースの説明とニューロンレベルの操作を促進する。
- 摂動ベースの手法と比較して、LRPベースの説明は計算効率(逆伝播ベース)とメモリ特性で有利である。
- ActMax-guided分析とAttnLRPにより解釈可能なエンコードを明らかにし、潜在ニューロンへの標的介入を可能にする。
- オープンソースのAttnLRP実装はプロジェクトリポジトリで入手可能です。
この論文を読む
Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。
Nubintでこの論文を読むこのレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。