arXiv:2506.15025cs.LGcs.AI2025-06被引 5

揭示词表大小对大模型嵌入学习率的影响,提出更优的调参方法。

Optimal Embedding Learning Rate in LLMs: The Effect of Vocabulary Size

  • 理论分析词表大小对训练动态的影响,发现存在新调控区。
  • 在大词表下,嵌入层学习率与隐藏层学习率比应按√宽度缩放。
  • 实验验证新规则可提升10亿参数模型训练效率,适合大模型训练者。

预训练大语言模型成本高昂。为提高效率,已有方法通过优化模型结构和参数设置来降低开销。其中μP(最大更新参数化)将模型权重与学习率参数化,使超参数可随模型宽度迁移:小模型调好的参数可直接用于更大模型而无需重调。尽管μP在实践中表现优异,但近期实证研究发现其在大语言模型上存在矛盾结果。原因在于μP理论假设输入维度(即语言模型中的词表大小)固定不变,但现实中词表规模远大于模型宽度。本文首次对词表大小影响进行理论分析,揭示当词表增大时,训练动态会从μP模式过渡到一种新范式——大词表(LV)模式,在该模式下最优缩放规则与μP预测不同。分析表明,在LV模式中,最优嵌入学习率与隐藏层学习率之比应近似于Θ(√width),与文献中已有经验观察高度一致,且显著区别于μP所预测的Θ(width)。我们通过多项实验验证该理论,并从头预训练一个10亿参数模型,证实所提缩放规则能有效提升训练性能。

原文摘要 · Abstract (English)

Pretraining large language models is a costly process. To make this process more efficient, several methods have been proposed to optimize model architecture/parametrization and hardware use. On the parametrization side, $μP$ (Maximal Update Parametrization) parametrizes model weights and learning rate (LR) in a way that makes hyperparameters (HPs) transferable with width (embedding dimension): HPs can be tuned for a small model and used for larger models without additional tuning. While $μ$P showed impressive results in practice, recent empirical studies have reported conflicting observations when applied to LLMs. One limitation of the theory behind $μ$P is the fact that input dimension (vocabulary size in LLMs) is considered fixed when taking the width to infinity. This is unrealistic since vocabulary size is generally much larger than width in practice. In this work, we provide a theoretical analysis of the effect of vocabulary size on training dynamics, and subsequently show that as vocabulary size increases, the training dynamics \emph{interpolate between the $μ$P regime and another regime that we call Large Vocab (LV) Regime}, where optimal scaling rules are different from those predicted by $μ$P. Our analysis reveals that in the LV regime, the optimal embedding LR to hidden LR ratio should roughly scale as $Θ(\sqrt{width})$, surprisingly close to the empirical findings previously reported in the literature, and different from the $Θ(width)$ ratio predicted by $μ$P. We conduct several experiments to validate our theory, and pretrain a 1B model from scratch to show the benefit of our suggested scaling rule for the embedding LR.

大模型训练学习率参数化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。