提出三步法识别Transformer中注意力头电路,无需标签即可定位关键计算路径。
Spectral Probe-Circuits: A Three-Step Recipe for Identifying Attention-Head Circuits in Pretrained Transformers

- 用频谱信号量化每头持续计算贡献,无监督排序注意力头
- 任务模式筛选+组消融验证,确认3-11个头对归纳推理必要
- 适用于不同模型规模与架构,适合研究模型内部机制的学者
我们提出一种识别预训练Transformer中注意力头电路的三步方法。通过每个头注意力输出的时间积分参与率——即频谱信号——在无标签、无归因梯度情况下,对执行持续内容依赖计算的头进行排序。任务模式筛选将此通用指标转化为任务特异性候选电路,再通过与匹配随机控制的组消融完成因果验证。在8倍参数范围(51M至1B活跃 / 7B总)、两种架构(密集型、专家混合)及四种预训练流程中均验证有效。该方法发现:2-6个头构成的归纳电路在所有测试模型中均具因果必要性,消融后合成归纳任务准确率下降94-100%。频谱信号具备无监督预测能力:在六个独立种子的51M参数探测模型中,同一计算可识别每个种子对应的特定电路。在Pythia系列中,可识别专业化计算的头占比稳定在17-19%,而具体归纳电路保持3-11个头,与总头数呈亚线性关系。本文为三篇论文计划的方法论基石;后续论文将扩展该方法至预训练过程中的发展轨迹及组合任务电路分析。
原文摘要 · Abstract (English)
We present a three-step recipe for identifying attention-head circuits in pretrained transformers. A per-head spectral signal -- the time-integrated participation ratio of each head's attention output -- ranks heads doing sustained content-dependent computation without labels or attribution gradients. A task-pattern screen filters this general indicator into a task-specific candidate circuit, and group ablation against a matched-random control completes the causal claim. We validate across an 8x parameter range (51M to 1B-active / 7B-total), two architecture families (dense, mixture-of-experts), and four pretraining pipelines. The recipe ports: a 2-6 head induction circuit is causally necessary in every model tested, with a 94-100% drop in synthetic-induction top-1 after ablation. The spectral signal is predictive without supervision: on six independent seeds of a 51M-parameter probe model, the same computation identifies the seed-specific circuit on each seed. The fraction of heads doing identifiable specialized computation is conserved at 17-19% across the Pythia family (124M to 410M), while specific induction circuits stay 3-11 heads -- sublinear in total head count. This paper is the methodology anchor of a three-paper program; companion papers extend the recipe to developmental trajectories during pretraining and to composed-task circuits where pattern selectivity decouples from task-causal structure.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。