Skip to main content
QUICK REVIEW

[論文レビュー] How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language model

Michael Hanna, Ollie Liu|arXiv (Cornell University)|Apr 30, 2023
Topic ModelingComputer Science被引用数 14
ひとこと要約

本論文は、GPT-2 small の年 span に対して大なり演算を実行する能力を、モデル内の最小 causal 回路を特定して説明する。MLP と attention heads がこの挙動にどのように寄与しているかを明らかにする。

ABSTRACT

Pre-trained language models can be surprisingly adept at tasks they were not explicitly trained on, but how they implement these capabilities is poorly understood. In this paper, we investigate the basic mathematical abilities often acquired by pre-trained language models. Concretely, we use mechanistic interpretability techniques to explain the (limited) mathematical abilities of GPT-2 small. As a case study, we examine its ability to take in sentences such as "The war lasted from the year 1732 to the year 17", and predict valid two-digit end years (years > 32). We first identify a circuit, a small subset of GPT-2 small's computational graph that computes this task's output. Then, we explain the role of each circuit component, showing that GPT-2 small's final multi-layer perceptrons boost the probability of end years greater than the start year. Finally, we find related tasks that activate our circuit. Our results suggest that GPT-2 small computes greater-than using a complex but general mechanism that activates across diverse contexts.

研究の動機と目的

  • 事前訓練済み言語モデルが、明示的な訓練なしに数学的能力を示すのかを調査する。
  • GPT-2 small に機械的解釈可能性を適用して、単純な数学タスクの内部回路を明らかにする。
  • 大なり演算を計算するのに必要な最小の構成要素を特定する。
  • 数値情報を伝達・処理する際のアテンションヘッドと MLP の役割を特徴づける。

提案手法

  • GPT-2 が YY を始点年とする場合、終端年が大きいほど確率が高くなる year span の予測タスクを定義する。
  • パスパッチングを用いてデータセット(01-dataset)を作成し、部品のパッチがロジットと確率差に与える影響を測定する。
  • 注意ヘッドおよびMLP(MLPs 8–11)からのロジットへの直接寄与をパッチして回路を孤立させることで、回路部品を反復的に特定する。
  • 注意パターン(ロジットレンズ)とMLP内のニューロンレベルの寄与を分析して回路を説明する。
  • ターゲットとなるデータセットパッチング実験により回路の十分性を評価し、回路外の部品をクロスパッチすることによって必然性を評価する。
Figure 1: Year-span prediction example ( XX =17 and YY =32) with sample (in)valid output years.
Figure 1: Year-span prediction example ( XX =17 and YY =32) with sample (in)valid output years.

実験結果

リサーチクエスチョン

  • RQ1GPT-2 small 内の最小限の因果回路は、year-span プロンプトにおける大なり演算を説明できるか?
  • RQ2このタスクで大なりを計算するために、どの部品(アテンションヘッド、MLP、ニューロン)が必要かつ十分か?
  • RQ3同定された回路部品は、開始年 YY を伝達し、比較を計算する際にどのように相互作用するか?
  • RQ4発見された回路は、同様の形式と出力空間を持つ関連プロンプトへ一般化するか?
  • RQ5結果は、GPT-2 の数学能力の源としての記憶化と一般化を区別しているか?

主な発見

  • MLP 8–11 および a9.h1(アテンション・ヘッド)からなる回路は、ロジットにおける大なり計算の大部分を説明している。
  • アテンション・ヘッドは開始年 YY を下流のMLPへ伝達し、それらが直接どの出力年がYYより大きいかを計算する。
  • MLP 10 は大なり判定に最も直接的に寄与し、ニューロンレベルの分析はこの演算がMLP内の複数のニューロンに分散していることを示す。
  • パスパッチ実験は、回路が概ね十分である(元の確率差の約72.7%)ことを示し、回路外のエッジを破壊した場合は必須である(対照で-36.6%) 。
  • ロジットレンズ分析は、MLP 9–11 が YY より大きい年を高く評価し、終端位置を横断する比較を実現する左上三角形のパターンを形成することを示す。
Figure 3: A : The computational graph of GPT-2, run on our normal dataset. B : GPT-2, where the (MLP 10, logits) path is patched to receive 01 -input. C : GPT-2, where the (Attn 10, MLP 10, logits) path receives 01 -input. Nodes receiving normal input have blue output; nodes receiving 01 -input have
Figure 3: A : The computational graph of GPT-2, run on our normal dataset. B : GPT-2, where the (MLP 10, logits) path is patched to receive 01 -input. C : GPT-2, where the (Attn 10, MLP 10, logits) path receives 01 -input. Nodes receiving normal input have blue output; nodes receiving 01 -input have

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。