通过优化注意力权重初始化,提升Transformer训练稳定性与泛化能力。
Conditioned Initialization for Attention
- 基于注意力层谱性质设计新型初始化方法,改善梯度传播
- 实验证明可加速收敛并提升多种任务的泛化性能
- 方法简单通用,适用于各类Transformer架构
Transformer是现代机器学习的主流架构,其核心是注意力层,由查询、键和值矩阵决定令牌间依赖关系。尽管大量研究聚焦于模型规模与优化,但对查询、键、值权重初始化的关注仍较少。现有方法多采用随机初始化或模仿已收敛模型权重的类模仿初始化,或从教师模型转移权重。本文提出条件初始化,一种基于理论的初始化方案,旨在优化注意力层的谱性质。理论上,该方法可降低注意力雅可比矩阵的条件数,从而提升优化稳定性。实验表明,该方法在多种应用中均能加速收敛并改善泛化表现,凸显了条件性初始化作为提升Transformer性能的关键却未被充分探索方向的重要性。重要的是,该方法实现简单,可无缝集成至广泛Transformer架构中。
原文摘要 · Abstract (English)
Transformers are a dominant architecture in modern machine learning, powering applications across vision, language, and beyond. At the core of their success lies the attention layer, where the query, key, and value matrices determine how token dependencies are captured. While considerable work has focused on scaling and optimizing Transformers, comparatively little attention has been paid to how the weights of the queries, keys and values are initialized. Common practice relies on random initialization or alternatives such as mimetic initialization, which imitates weight patterns from converged models, and weight selection, which transfers weights from a teacher model. In this paper, we argue that initialization can introduce an optimization bias that fundamentally shapes training dynamics. We propose conditioned initialization, a principled scheme that initializes attention weights to improve the spectral properties of the attention layer. Theoretically, we show that conditioned initialization can potentially reduce the condition number of the attention Jacobian, leading to more stable optimization. Empirically, it accelerates convergence and improves generalization across diverse applications, highlighting conditioning as a critical yet underexplored area for advancing Transformer performance. Importantly, conditioned initialization is simple to apply and integrates seamlessly into a wide range of Transformer architectures.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。