Hugging Face Daily Papers论文
通过方向分解解耦 Transformer 中的表示演化
问题:Transformer 中学习到的加性更新,究竟只是对当前表示的冗余缩放,还是承担了功能?方法:作者把更新分解为与当前表示平行和垂直的分量,并分别在残差空间和注意力 value 空间做分解。结论:平行分量普遍存在且作用高度依赖空间——在 value 空间保留自身消息、只抑制非自身平行分量,比残差空间或垂直干预更稳健;垂直误差能更清晰地区分压缩方法;预训练时抑制全聚合平行分量可降低验证损失并提升下游平均表现,value 空间变体最强。代码与项目页已开源。
这篇是正式发表的长论文,站内提供中文解读,全文请到原文阅读 PDF。
Abstract
Transformer representations evolve through learned additive transformations that either preserve their current direction or redirect it. We study this evolution as a functional geometry, decomposing learned updates into parallel and perpendicular components. Across pretrained models, we find substantial parallel components beyond the residual identity path. We then apply the decomposition in two spaces: to attention and MLP updates relative to the hidden state, and to attention value aggregation relative to the current token's value. Targeted edits reveal a strongly space-dependent asymmetry: exclude-self value-space parallel manipulation is markedly more robust than residual-space and perpendicular counterparts, preserving the direct self message while scaling only the non-self aggregate. The same decomposition gives a component-resolved description of compression-induced update error: perpendicular error separates compression methods more clearly than parallel error. Extensive experiments further demonstrate that full-aggregate parallel suppression during from-scratch pretraining lowers validation-loss trajectories and improves downstream averages, with the value-space variant strongest. Together, these results connect representation geometry to editing robustness, compression diagnosis, and training-time intervention. Code is available in the https://github.com/Shwai-He/Transformer-Geometry{project repository}.
Are direction-preserving updates in Transformers merely redundant rescaling? We find that the answer depends strongly on where the geometry is defined. We decompose learned transformations into components parallel and perpendicular to the current representation, in both residual space and attention value space. Parallel components are widespread beyond the residual identity path, yet their functional role is highly space-dependent: preserving the direct self message while suppressing the non-self parallel component is markedly more robust than residual-space or perpendicular interventions.The same geometric view extends beyond model editing. Perpendicular error more clearly distinguishes compression-induced distortions, while full-aggregate parallel suppression during from-scratch pretraining lowers validation-loss trajectories and improves downstream averages, with the value-space variant strongest.
Code: https://github.com/Shwai-He/Transformer-GeometryInteractive project page: https://shwai-he.github.io/Transformer-Geometry/