揭示了前馈网络如何像导航场一样控制Transformer的残差动态。
Feed-Forward Steering in Transformer Residual Dynamics

- 将前馈网络视为作用于每个令牌的状态导向场,扩展注意力动力学理论。
- 实验显示,仅保留径向分量会导致模型性能崩溃,而切向分量能维持质量与多样性。
- 小对易子缺陷层可近似并行化,损失增加小,适合加速推理。
注意力主导的动力学理论将Transformer残差方向建模为球面上聚集的粒子。本文通过引入前馈网络(FFN)作为局部导向场,扩展该框架,预测残差方向空间中的运动需依赖FFN场的切向分量,关键残差方向对应非线性投影平衡点,且对易子缺陷决定有限注意力-FFN模块能否被并行加法流准确近似。在GPT-2、Pythia、Mistral和Llama模型中,新理论相较仅注意力基线提升一步角预测精度,且FFN贡献随模型从GPT-2演进至Llama-3-8B而增强。干预实验表明,仅保留切向分量可维持多数模型性能,而仅保留径向分量导致性能崩溃;切向分量还能在聚合压力下保持输出多样性。实际应用中,对易子缺陷小的层可近似并行化,损失增幅小,而缺陷大的层则迅速退化。结果支持将FFN视为塑造残差几何并决定模块级干预可行性的方向引导场。
原文摘要 · Abstract (English)
Attention-only dynamical theories model Transformer residual directions as particles aggregating on a sphere. We extend this framework by incorporating the feed-forward network (FFN) term as a local steering field acting on each token state. The resulting theory predicts that the tangential component of the FFN field is necessary for motion in residual-direction space, that critical residual directions correspond to nonlinear projective equilibria, and that a commutator defect determines when a finite attention--FFN block can be accurately approximated by a parallel, additive flow. Across GPT-2, Pythia, Mistral, and Llama models, the extended theory improves one-step angular prediction relative to an attention-only baseline, with the contribution of the FFN increasing from GPT-2 to Llama-3-8B. Intervention experiments show that retaining only the tangential FFN component preserves most model quality, whereas retaining only the radial component causes performance to collapse. The tangential component also preserves output diversity under aggregation pressure. As a practical application, layers with small commutator defects can be approximately parallelized with only a modest increase in loss, whereas layers with large defects degrade rapidly. These findings support the interpretation of FFN layers as directional steering fields that shape Transformer residual geometry and govern the feasibility of block-level interventions.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。