Circuit Component Reuse Across Tasks in Transformer Language Models

📄 arXiv: 2310.08744v3 📥 PDF

作者: Jack Merullo, Carsten Eickhoff, Ellie Pavlick

分类: cs.CL, cs.LG

发布日期: 2023-10-12 (更新: 2024-05-06)

备注: Accepted at ICLR 2024


💡 一句话要点

提出跨任务电路组件重用方法以提升语言模型理解

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 电路分析 语言模型 任务重用 注意力机制 模型解释性

📋 核心要点

  1. 现有的电路分析方法通常被批评为任务特定,无法提供更高层次的模型理解。
  2. 本研究通过分析不同任务间的电路重用,提出了跨任务的电路组件重用方法。
  3. 实验结果显示,通过干预调整注意力头部,彩色物体任务的准确率显著提升,验证了电路的通用性。

📝 摘要(中文)

近期的机械解释性研究表明,通过电路分析可以成功反向工程语言模型的行为。然而,普遍的批评是每个电路都是任务特定的,因此这种分析无法在更高层次上理解模型。在本研究中,我们提供证据表明,低层次的特定头部发现和高层次的通用算法发现确实可以跨任务推广。具体而言,我们研究了Wang等人(2022)为间接宾语识别(IOI)任务发现的电路,并展示它在更大的GPT2模型上重现,并且在解决一个看似不同的任务:彩色物体(Ippolito & Callison-Burch, 2023)时大部分被重用。我们提供证据表明这两个任务的过程在功能上非常相似,并且在电路内的注意力头部有约78%的重叠。我们进一步展示了一个概念验证干预实验,通过调整中间层的四个注意力头部来“修复”彩色物体电路,使其表现得像IOI电路,从而将彩色物体任务的准确率从49.6%提升至93.7%。

🔬 方法详解

问题定义:本研究旨在解决现有电路分析方法的局限性,即其通常被认为是任务特定的,无法跨任务提供通用的理解。

核心思路:论文提出通过分析不同任务间的电路重用,展示电路组件在不同任务中的通用性,进而提升对语言模型行为的理解。

技术框架:研究首先重现了Wang等人(2022)为IOI任务发现的电路,然后分析其在彩色物体任务中的重用情况,最后通过干预实验验证电路的通用性。

关键创新:最重要的创新在于证明了电路组件可以在不同任务中重用,且其功能特性在不同输入下保持不变,这与现有方法的任务特定性形成鲜明对比。

关键设计:在干预实验中,调整了中间层的四个注意力头部,并通过这种方式显著提升了彩色物体任务的准确率,具体的参数设置和网络结构细节在实验部分进行了详细描述。

📊 实验亮点

实验结果显示,通过调整四个注意力头部,彩色物体任务的准确率从49.6%提升至93.7%,验证了电路组件的重用性和通用性。这一提升幅度表明,电路分析可以为理解大型语言模型的行为提供新的视角。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、机器翻译和智能问答系统等。通过理解语言模型的电路重用机制,可以帮助研究人员设计更高效的模型架构,提升模型在多任务场景下的表现,具有重要的实际价值和未来影响。

📄 摘要(原文)

Recent work in mechanistic interpretability has shown that behaviors in language models can be successfully reverse-engineered through circuit analysis. A common criticism, however, is that each circuit is task-specific, and thus such analysis cannot contribute to understanding the models at a higher level. In this work, we present evidence that insights (both low-level findings about specific heads and higher-level findings about general algorithms) can indeed generalize across tasks. Specifically, we study the circuit discovered in Wang et al. (2022) for the Indirect Object Identification (IOI) task and 1.) show that it reproduces on a larger GPT2 model, and 2.) that it is mostly reused to solve a seemingly different task: Colored Objects (Ippolito & Callison-Burch, 2023). We provide evidence that the process underlying both tasks is functionally very similar, and contains about a 78% overlap in in-circuit attention heads. We further present a proof-of-concept intervention experiment, in which we adjust four attention heads in middle layers in order to 'repair' the Colored Objects circuit and make it behave like the IOI circuit. In doing so, we boost accuracy from 49.6% to 93.7% on the Colored Objects task and explain most sources of error. The intervention affects downstream attention heads in specific ways predicted by their interactions in the IOI circuit, indicating that this subcircuit behavior is invariant to the different task inputs. Overall, our results provide evidence that it may yet be possible to explain large language models' behavior in terms of a relatively small number of interpretable task-general algorithmic building blocks and computational components.