arXiv:2608.14689cs.LG2026-08

拆解Transformer残差路径,发现注意力分支对性能至关重要

A Reproducibility Study of Partial Residual Ablations in Pre-LN Transformers

论文配图:A Reproducibility Study of Partial Residual Ablations in Pre-LN Transformers
图 1 · 摘自论文原文
  • 对比四种残差连接组合,控制变量验证各路径作用
  • 移除注意力残差导致性能崩溃,移除前馈残差在小模型有恢复现象
  • 提供完整代码与实验数据,支持复现并揭示种子差异影响

残差连接是Transformer架构的核心,但独立分析注意力与前馈残差路径的作用仍不清晰。本文对预层归一化GPT风格模型(10M和124M参数)进行了部分残差消融的可复现性研究。通过选择性移除注意力残差、前馈残差或两者,比较四种结构。所有实验中,移除注意力残差(FFNOnly)均导致确定性性能坍缩至无残差基线水平;而移除前馈残差(AttnOnly)在10M规模下表现出可复现的性能恢复,124M规模因种子方差过大未得定论。研究中纠正了运行时增益缩放的测量偏差,并记录了中间失败复现过程。基于结果提出跨位置路由假说解释不对称现象,明确区分已确认结论与未解问题。为支持复现,公开全部源码、配置、检查点、训练日志及所有实验结果,含非复现中间步骤。

原文摘要 · Abstract (English)

Residual connections are a fundamental component of transformer architectures, yet the roles of the attention and feed-forward residual pathways remain poorly understood when considered independently. This paper presents a reproducibility study of partial residual ablations in Pre-LN GPT-style transformers trained at two scales (10M and 124M parameters). I compare four architectural configurations by selectively removing the attention residual connection, the feed-forward residual connection, or both. Across all experiments, removing the attention residual (FFNOnly) consistently causes deterministic collapse to the No-Residual performance floor. In contrast, removing the feed-forward residual (AttnOnly) exhibits a reproducible recovery effect at 10M scale under a controlled 8-seed deterministic study, while its behavior at 124M remains unresolved because of substantial seed variance. During the investigation, I identified and corrected an experimental measurement confound in runtime gain scaling and document both the failed intermediate reproduction and the subsequent controlled replication. Based on the empirical results, I propose a cross-position routing hypothesis to explain the observed asymmetry while explicitly distinguishing confirmed findings from unresolved questions. To support reproducibility, I release the complete source code, experiment configurations, checkpoints, training logs, and all experimental results, including intermediate non-reproducing runs.

Transformer残差连接可复现性模型分析

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