解构Transformer表示中的方向与幅度:通过L2匹配扰动分析的双重解离
Disentangling Direction and Magnitude in Transformer Representations: A Double Dissociation Through L2-Matched Perturbation Analysis
AI总结:
研究揭示Transformer表示中方向与幅度在语言建模和语法处理中的不同作用,通过L2匹配扰动分析发现方向扰动影响注意力路径,幅度扰动影响语法判断,且解离依赖于架构选择。
摘要:
Transformer隐藏状态将信息编码为高维向量,但方向(表示空间中的方向)和幅度(向量范数)是否具有不同的功能角色仍不清楚。通过研究Pythia家族模型,我们发现一种显著的交叉解离:角度扰动对语言建模损失的破坏可达42.9,而幅度扰动对语法处理的破坏更大(在主谓一致任务中,幅度扰动导致20.4%的准确率下降,而角度扰动仅为1.6%)。这一发现得益于L2匹配扰动分析,这是一种确保角度和幅度扰动产生相同欧几里得位移的方法。因果干预揭示,角度破坏主要通过注意力路径传播(通过注意力修复可恢复28.4%的损失),而幅度破坏部分通过LayerNorm路径传播(通过LayerNorm修复可恢复29.9%的损失)。这些模式在Pythia架构家族中跨规模重复出现。这些发现提供了证据,表明在基于LayerNorm的架构中,方向和幅度在计算中支持部分不同的角色。方向更倾向于影响注意力路由,而幅度调节细粒度语法判断的处理强度。我们在基于RMSNorm的架构中发现不同的模式,这表明解离依赖于架构选择。我们的结果修正了线性表示假设,并对模型编辑和可解释性研究有影响。
英文摘要:
Transformer hidden states encode information as high-dimensional vectors, yet whether direction (orientation in representational space) and magnitude (vector norm) serve distinct functional roles remains unclear. Studying Pythia-family models, we discover a striking cross-over dissociation: angular perturbations cause up to 42.9 more damage to language modeling loss, while magnitude perturbations cause disproportionately more damage to syntactic processing (20.4% vs.1.6% accuracy drop on subject-verb agreement).This finding is enabled by L2-matched perturbation analysis, a methodology ensuring that an gular and magnitude perturbations achieve identical Euclidean displacements. Causal intervention reveals that angular damage flows substantially through the attention pathways (28.4% loss recovery via attention repair), while magnitude damage flows partly through the LayerNorm pathways(29.9% recovery via LayerNorm repair). These patterns replicate across scales within the Pythia architecture family. These findings provide evidence that direction and magnitude support partially distinct computational roles in LayerNorm based architectures. The direction preferentially affects attentional routing, while magnitude modulates processing intensity for fine-grained syntactic judgments. We find different patterns in RMSNorm-based architectures, suggesting that the dissociation depends on architectural choices. Our results refine the linear representation hypothesis and have implications for model editing and interpretability research
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。