arXiv:2510.25013cs.CLcs.AI2025-10ACL被引 1

小模型仅用两个注意力头就完成指代推理,机制可解释。

Emergence of Minimal Circuits for Indirect Object Identification in Attention-Only Transformers

论文配图:Emergence of Minimal Circuits for Indirect Object Identification in Attention-Only Transformers
图 1 · 摘自论文原文
  • 从零训练无MLP的单层模型,仅用两个注意力头
  • 两头分工明确:加法与对比子电路协同解指代
  • 适合研究注意力机制如何实现基础推理

机制可解释性旨在将大语言模型逆向解析为人类可理解的计算电路。然而,预训练模型的复杂性常掩盖特定推理任务所需的最小机制。本文在符号化间接宾语识别(IOI)任务上,从零训练小型纯注意力变换器。令人意外的是,仅含两个注意力头的单层模型即可达到100% IOI准确率,且无需MLP或归一化层。通过残差流分解、谱分析与嵌入干预,发现两个头分别形成加法与对比子电路,共同完成指代消解。此外,两层单头模型主要通过查询-键交互传递信息。结果表明,任务特定训练能催生高度可解释的最小电路,为探究变换器推理的计算基础提供可控测试平台。

原文摘要 · Abstract (English)

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.

机制可解释性注意力机制指代消解小模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。