A Unified View of Attention and Residual Sinks: Outlier-Driven Rescaling is Essential for Transformer Training

ML TAVR NOR RN
我们探究了大语言模型中涌现的异常值(outliers)所起的功能性作用,具体聚焦于两类现象:注意力汇点(attention sinks,即少数几个始终获得极高注意力 logits 的 token)和残差汇点(residual sinks,即在绝大多数 token 上持续呈现高激活值的若干固定维度)。我们提出假说:这些异常值与相应的归一化操作(例如,Softmax 注意力机制和 RMSNorm)协同作用,实质上对其他非异常值成分进行了动态缩放(rescaling)。我们将这一现象命名为“异常值驱动的缩放”(outlier-driven rescaling),并在多种模型架构及不同训练 token 总量下验证了该假说的普适性。这一视角统一解释了两类汇点现象的成因及其缓解路径。我们的主要结论与观察包括:(1)异常值与归一化操作协同发挥作用:若移除归一化操作,相应异常值虽随之消失,但模型训练稳定性与最终性能均显著下降;而若仅直接裁剪(clipping)异常值却保留归一化,则同样导致性能退化——这表明,异常值驱动的缩放机制本身对维持训练稳定性具有实质性贡献。(2)异常值主要扮演缩放因子(rescale factor)的角色,而非直接贡献者:注意力汇点与残差汇点在最终输出中的实际贡献远小于非异常值成分。(3)异常值既可被吸收进可学习参数中,也可通过显式的门控缩放(gated rescaling)机制予以缓解;这两种方法均能提升训练性能(平均提升约 2 分),并增强模型对低比特量化(quantization)的鲁棒性(在 W4A4 量化设置下,性能退化幅度由基准水平降低 1.2 分)。
We investigate the functional role of emergent outliers in large language models, specifically attention sinks (a few tokens that consistently receive large attention logits) and residual sinks (a few fixed dimensions with persistently large activations across most tokens). We hypothesize that these outliers, in conjunction with the corresponding normalizations (\textit{e.g.}, softmax attention and RMSNorm), effectively rescale other non-outlier components. We term this phenomenon \textit{outlier-driven rescaling} and validate this hypothesis across different model architectures and training token counts. This view unifies the origin and mitigation of both sink types. Our main conclusions and observations include: (1) Outliers function jointly with normalization: removing normalization eliminates the corresponding outliers but degrades training stability and performance; directly clipping outliers while retaining normalization leads to degradation, indicating that outlier-driven rescaling contributes to training stability. (2) Outliers serve more as rescale factors rather than contributors, as the final contributions of attention and residual sinks are significantly smaller than those of non-outliers. (3) Outliers can be absorbed into learnable parameters or mitigated via explicit gated rescaling, leading to improved training performance (average gain of 2 points) and enhanced quantization robustness (1.2 points degradation under W4A4 quantization).
许愿