Skip to main content
QUICK REVIEW

[论文解读] Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 small

Kevin Wang, Alexandre Variengien|arXiv (Cornell University)|Nov 1, 2022
Explainable Artificial Intelligence (XAI)Computer Science被引用 50
一句话总结

本文提出了一个机械化、端到端的电路,解释了 GPT-2 small 如何通过 26 个注意力头组成的七类头来实现间接对象识别(IOI),通过因果干预和三项基于忠实性的标准进行了验证。

ABSTRACT

Research in mechanistic interpretability seeks to explain behaviors of machine learning models in terms of their internal components. However, most previous work either focuses on simple behaviors in small models, or describes complicated behaviors in larger models with broad strokes. In this work, we bridge this gap by presenting an explanation for how GPT-2 small performs a natural language task called indirect object identification (IOI). Our explanation encompasses 26 attention heads grouped into 7 main classes, which we discovered using a combination of interpretability approaches relying on causal interventions. To our knowledge, this investigation is the largest end-to-end attempt at reverse-engineering a natural behavior "in the wild" in a language model. We evaluate the reliability of our explanation using three quantitative criteria--faithfulness, completeness and minimality. Though these criteria support our explanation, they also point to remaining gaps in our understanding. Our work provides evidence that a mechanistic understanding of large ML models is feasible, opening opportunities to scale our understanding to both larger models and more complex tasks.

研究动机与目标

  • 在电路层面解释 GPT-2 small 如何执行间接对象识别(IOI)。
  • 识别一个人类可解释的子图(电路),负责GPT-2 small中的 IOI。
  • 开发并应用因果干预技术以验证电路解释。
  • 评估所提出电路的忠实性、完整性和最小性。
  • 突出语言模型中可扩展机械可解释性所面临的挑战和见解。

提出的方法

  • 使用电路分析来隔离一个负责 IOI 的子图(电路)在 GPT-2 small。
  • 使用路径打补(path patching)来衡量注意力头对 logits 的直接与间接影响。
  • 将头分为七个类别并描述它们在 IOI 算法中的作用。
  • 应用均值消融(而非零消融)以及修改后的 p_IOI 分布(p_ABC)用于敲除。
  • 使用定义的性能度量 F(C) 将电路行为与完整模型进行验证。
  • 引入忠实性、完整性和最小性标准以评估电路解释。

实验结果

研究问题

  • RQ1GPT-2 small 的哪一个子图计算 IOI 任务?
  • RQ2哪些注意力头实现 IOI 算法,它们如何交互?
  • RQ3因果干预(路径打补和敲除)是否能证明该电路对模型的 IOI 行为是忠实且接近完整的?
  • RQ4所识别电路的局限性和潜在冗余是什么?
  • RQ5所提出的验证标准(忠实性、完整性、最小性)在这一端到端的机械解释中如何表现?

主要发现

  • 一个由 26 个注意力头组成的电路(头–令牌对的 1.1%)实现了 GPT-2 small 的 IOI。
  • 该电路分成七个头类别,包括 Name Mover Heads、S-Inhibition Heads、Duplicate Token Heads、Induction Heads、Previous Token Heads、Backup Name Mover Heads,以及 Negative Name Mover Heads。
  • 路径打补显示哪些头直接影响 logits,并揭示信息流中的直接与间接影响。
  • Name Mover Heads 将 IO/ S 令牌复制到输出,但在敲除条件下可由 Backup Name Mover Heads 补充,表明存在冗余。
  • S-Inhibition Heads 通过使用令牌和位置信号来调节 Name Mover Heads 的注意力,使注意力偏向 IO 而非 S1。
  • 该电路实现了约 87% 的完整模型 IOI 性能(F(C) ≈ 0.46 相对于 F(M) 的差值,F(M) = 3.56)。
  • 研究发现存在冗余组件和复杂交互,挑战简化解释,揭示机械理解中尚存的空缺。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。