研究问题
一个低损失 Transformer 在多位加减法中究竟实现了什么算法?仅凭线性 probes 或 attention patterns,容易把相关节点误认为完整机制;长 carry/borrow cascades 提供了可系统攻击候选算法的边界案例。 作者希望同时建立逻辑证据(候选 sub-tasks 能对所有 \(n\)-digit inputs 给出正确输出)与机械证据(模型内部节点和 edges 因果执行这些 sub-tasks),并比较不同 seed、深度、位数和加/减/混合训练的共性。
模型与方法
从头训练 2–3 层、3–4 头、约千万参数的小 Transformer,任务覆盖 5–15 位 addition、subtraction 或 mixed arithmetic。早期模型暴露长 carry/borrow failures 后,训练分布加入对应 edge cases;多数模型在单 GPU 一小时内达到 >99.999% accuracy。 不先假定小学从右向左算法,而是从 internals 定义 SA/SC/ST 等 single-digit quantities 和 SV/MV 等多位不确定 carry/borrow。TriAdd 从高位开始沿输入从左到右结合更低位信息,逐步消除 U,形成符合 autoregressive causal order 的 left-to-right exact algorithm。 46 个模型中 29 个达到高准确门槛;正文报告其中 27 个准确的 addition 与 mixed 模型具有共同的 family-level circuit skeleton;代表模型再用 activation patching、edge/path patching、matched controls 与 alternative-mechanism ablations 检验 resolved-carry subtask。
Figure 1 · 不确定 carry 状态在输入处理期间逐步解析。
物理解读:The diagram specifies a sound algorithm inferred from the model family; causal confirmation is deeper for selected representative models.
来源:paper.pdf \(p\). 1, Figure 1
核心结果与证据
Figure 1 展示 addition 算法:各位先把 carry 状态分类为 0、1 或 uncertain U,后续 token 逐步用更低位信息把 U 解为确定 SV,再计算 answer digit。对应 subtraction 用 cascading borrow MV 决定符号和 digits。 正文报告 27 个准确的 addition 与 mixed 模型共享 sub-task/circuit skeleton;全部 46 个模型中 29 个满足高准确门槛(表 1 标题与正文的骨架分母表述并不一致),但具体 heads/MLPs 的分配可随 seed、depth 和 operation 改变。worked examples 中,patching 对 resolved-carry nodes/paths 给出 causal effects,matched controls 排除若干仅相关解释。 mixed models 的部分节点对 addition 与 subtraction 呈 polysemantic;从 addition weights 初始化和从 scratch 训练都可形成共同 skeleton。论文把结论限定为该受控模型家族,而非声称所有语言模型采用同一算术算法。
有效性与局限
精确算法由模型分析启发但经数学 soundness 检查;这证明该算法能完成任务,不自动证明每个模型唯一实现它。family map 和 causal interventions 增强机械归因,但完整 edge-level sufficiency 只在少数 worked examples 深挖。 模型小、tokenization 固定、数据合成且任务窄;对预训练 LLM、不同数字编码、乘除法或自然语言算术没有 transfer claim。训练集 edge enrichment 改变了最易学 mechanism,可能不是自然分布下的算法。 Patching 依赖替换分布与 control design,polysemantic nodes 使单节点标签近似。>99.999% 仍非形式化零错误;逻辑算法 soundness 与模型 empirical accuracy 必须分开。本卡未独立训练或复现 causal analysis。
复现与资源
原文:https://arxiv.org/abs/2402.02619。官方 PDF SHA-256:97cbdbf07a562031617089ccd2fe1f86af5de1012788307f3ec06a6d7ae116d1。作者发布模型、分析与可复现 interpretability toolkit,链接见论文。 复现应先生成 carry/borrow cascade stress sets,逐模型报告 exact failures;再用 released sub-task constraints 定位 nodes,分别做 activation、edge 与 path patching,并保留 matched random/position controls。必须区分 family-level map 与 worked-example causal evidence。Evidence status: full-text verified; no independent reproduction performed.
阅读指南
先看 Figures 1 与 3 理解 progressive carry/borrow refinement,再看训练 edge cases 和 family table;随后阅读 worked-example patching 与 candidate-mechanism exclusions。结论部分的 calibrated-confidence 用语是解释证据强度的关键。
← 上一篇 A phase transition between positional and semantic learning in a solvable model of dot-product attention
下一篇 → An introduction to graphical tensor notation for mechanistic interpretability
Discussion
评论与讨论
评论公开保存在 GitHub Discussions;阅读无需登录,发表评论需要 GitHub 账号。