注意力-only变换器中间接对象识别最小电路的涌现
Emergence of Minimal Circuits for Indirect Object Identification in Attention-Only Transformers
AI总结:
本研究通过从头训练小型注意力-only变换器,在符号化的间接对象识别任务中发现,单层模型仅需两个注意力头即可实现完美准确率,揭示了任务特定训练如何诱导可解释的最小电路。
摘要:
机制可解释性旨在将大型语言模型(LLMs)逆向工程为人类可理解的计算电路。然而,预训练模型的复杂性常掩盖了特定推理任务所需的最小机制。在本工作中,我们从头训练小型注意力-only变换器,在符号化的间接对象识别(IOI)任务上进行训练,该任务是研究变换器中类似核心指代推理的基准。令人惊讶的是,一个仅包含两个注意力头的单层模型在没有MLP和归一化层的情况下实现了完美的IOI准确率。通过残差流分解、频谱分析和嵌入干预,我们发现这两个头专门发展成加法和对比子电路,共同实现IOI解决。此外,我们还展示了一个两层、一个头的模型主要通过查询-键交互从上一层获取信息。这些结果表明,任务特定训练诱导了高度可解释的最小电路,为探测变换器推理的计算基础提供了受控测试平台。
英文摘要:
Mechanistic interpretability aims to reverse-engineer large language models (LLMs) into human-understandable computational circuits. However, the complexity of pretrained models often obscures the minimal mechanisms required for specific reasoning tasks. In this work, we train small, attention-only transformers from scratch on a symbolic version of the Indirect Object Identification (IOI) task, a benchmark for studying coreference-like reasoning in transformers. Surprisingly, a single-layer model with only two attention heads achieves perfect IOI accuracy, despite lacking MLPs and normalization layers. Through residual stream decomposition, spectral analysis, and embedding interventions, we find that the two heads specialize into additive and contrastive subcircuits that jointly implement IOI resolution. Furthermore, we show that a two-layer, one-head model composes information from the previous layer primarily through query-key interactions. These results demonstrate that task-specific training induces highly interpretable, minimal circuits, offering a controlled testbed for probing the computational foundations of transformer reasoning.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。