随机初始化的Transformer已有强烈结构偏见,影响模型行为。
Transformers Are Born Biased: Structural Inductive Biases at Random Initialization and Their Practical Consequences
- 初始时模型隐藏表示沿随机方向收缩,导致某些词预测概率远高于其他词。
- 这种偏见在训练后仍稳定存在,可用来区分不同初始化的模型。
- 揭示了注意力机制内在缺陷,为控制注意力'黑洞'提供新思路。
Transformer架构支撑现代大语言模型,普遍认为其在随机初始化时行为无结构,所有有意义偏好仅通过大规模训练产生。我们挑战这一假设,发现未训练的Transformer已存在强烈且系统性的结构偏见。具体而言,随机输入序列下,某些令牌的预测概率高出数个数量级。我们通过解析初始化阶段的Transformer架构,揭示该现象的机制:令牌表示在依赖随机种子的方向上发生收缩,由两股相互作用的力驱动:(i) MLP子层中非对称非线性激活导致全局(跨序列)表示集中;(ii) 自注意力通过局部(序列内)聚合进一步放大此效应。两者共同使隐藏表示对齐于仅由随机初始化决定的方向,引发高度非均匀的下一个词预测。除了机制洞察,我们证明这些初始化诱导的偏见贯穿训练始终,形成稳定且固有的模型身份。基于此,我们提出SeedPrint指纹方法,可可靠区分仅初始化不同的模型,即使经过大量训练和显著分布漂移。最后,我们发现注意力机制中固有的位置偏差,与注意力‘黑洞’现象因果关联,为该现象提供原理性解释,并指明其调控路径。
原文摘要 · Abstract (English)
Transformers underpin modern large language models (LLMs) and are commonly assumed to be behaviorally unstructured at random initialization, with all meaningful preferences emerging only through large-scale training. We challenge this assumption by showing that randomly initialized transformers already exhibit strong and systematic structural biases. In particular, untrained models display extreme token preferences: across random input sequences, certain tokens are predicted with probabilities orders of magnitude larger. We provide a mechanistic explanation for this phenomenon by dissecting the transformer architecture at initialization. We show that extreme token preference arises from a contraction of token representations along a random seed-dependent direction. This contraction is driven by two interacting forces: (i) asymmetric nonlinear activations in MLP sublayers induce global (inter-sequence) representation concentration, and (ii) self-attention further amplifies this effect through local (intra-sequence) aggregation. Together, these mechanisms align hidden representations along a direction determined solely by the random initialization, producing highly non-uniform next-token predictions. Beyond mechanistic insight, we demonstrate that these initialization-induced biases persist throughout training, forming a stable and intrinsic model identity. Leveraging this property, we introduce SeedPrint, a fingerprinting method that can reliably distinguish models that differ only in their random initialization, even after extensive training and under substantial distribution shift. Finally, we identify a fundamental positional discrepancy inherent to the attention mechanism's intra-sequence contraction that is causally linked to the attention-sink phenomenon. This discovery provides a principled explanation for the emergence of sinks and offers a pathway for their control.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。