即使注意力权重固定,Transformer仍能完成语言建模与推理,说明其核心能力不依赖可训练注意力。
Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformer
- 用固定注意力权重的变体验证注意力非必需,仍能形成归纳头
- 提出随机注意力架构MixiT,实现稳定信号传播并突破深度瓶颈
- 揭示注意力负责上下文推理,MLP负责知识存储,二者协同工作
Transformer架构是现代大语言模型成功的关键,部分归功于其仅通过梯度学习下一词预测即可完成数学推理、记忆和检索等任务。尽管自注意力机制是核心组件,我们质疑其对性能提升的具体贡献。为此,我们对比标准Transformer与冻结MLP或注意力权重的变体。出人意料的是,注意力权重在初始化后固定时,仍能形成归纳头,并在语言建模上表现良好。我们进一步证明了此类模型的表达能力。为更彻底分离注意力作用,设计了完全随机注意力的MixiT架构,具备可证明稳定的信号传播,克服了以往随机Transformer的深度扩展难题。通过MixiT的成功与失败,我们发现注意力主要负责上下文推理,而MLP负责知识存储但需与注意力协作。结果表明,Transformer架构本身具有形成专用电路的内在归纳偏置,即便无可训练注意力权重亦然。
原文摘要 · Abstract (English)
The transformer architecture is central to the success of modern Large Language Models (LLMs), in part due to its surprising ability to perform a wide range of tasks - including mathematical reasoning, memorization, and retrieval - using only gradient-based learning on next-token prediction. While the core component of a transformer is the self-attention mechanism, we question how much, and which aspects, of the performance gains can be attributed to it. To this end, we compare standard transformers to variants in which either the MLP layers or the attention weights are frozen at initialization. Surprisingly, we find that attention with frozen key and query weights is not only able to form induction heads, but can also perform competitively on language modeling. We formalize this by proving a new expressivity result for transformer models with frozen key and query weights. To further isolate the contribution of attention, we design MixiT, an architecture with entirely random attention scores, with provably stable signal propagation that overcomes prior depth-wise scaling challenges in random transformers. We use the successes and failures of MixiT to understand the role each transformer component plays, such as attention being largely responsible for in-context reasoning, and MLPs being responsible for, but collaborates with attention, on knowledge storage. Our results suggest that the transformer architecture has a built-in inductive bias towards forming specialized circuits, as it does even without learnable attention weights.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。