证明Adam在合理超参数下可收敛,提出其收敛与发散的临界边界。
Adam Converges Without Any Modification On Update Rules
- 基于问题先于超参数选择的实践,证明Adam在特定β₁、β₂组合下收敛。
- 发现当β₂较小时存在发散区域,β₁<√β₂时可避免发散。
- 建议按批大小反向调整β₂以突破收敛阈值,适合调优大模型训练者。
Adam是训练神经网络(包括大语言模型)的默认优化器,但 extcite{reddi2019convergence} 提出一个导致发散的例子,引发对其在实际中应用的担忧。本文指出该例子与实践存在关键不匹配: extcite{reddi2019convergence} 在选定超参数(β₁, β₂)后才设计问题;而实际应用通常是先固定问题,再调优(β₁, β₂)。本文证明,只要使用与问题相关的合理超参数,Adam即可收敛。首先,当β₂较大且β₁ < √β₂时,Adam收敛。其次,当β₂较小时,存在一组(β₁, β₂)组合会导致发散至无穷。结果揭示了在(β₁, β₂)二维平面上从发散到收敛的相变现象,这是文献中首次报告此类相变,为Adam提供了严格的理论保证。我们进一步指出临界边界(β₁*, β₂*)依赖于具体任务,特别是批大小。因此建议:当Adam表现不佳时,应反向调节β₂(随批大小增大而减小),使其超过β₂*,再尝试β₁ < √β₂。这一建议得到多个实证研究支持,表明其能提升大语言模型训练性能。
原文摘要 · Abstract (English)
Adam is the default algorithm for training neural networks, including large language models (LLMs). However, \citet{reddi2019convergence} provided an example that Adam diverges, raising concerns for its deployment in AI model training. We identify a key mismatch between the divergence example and practice: \citet{reddi2019convergence} pick the problem after picking the hyperparameters of Adam, i.e., $(β_1,β_2)$; while practical applications often fix the problem first and then tune $(β_1,β_2)$. In this work, we prove that Adam converges with proper problem-dependent hyperparameters. First, we prove that Adam converges when $β_2$ is large and $β_1 < \sqrt{β_2}$. Second, when $β_2$ is small, we point out a region of $(β_1,β_2)$ combinations where Adam can diverge to infinity. Our results indicate a phase transition for Adam from divergence to convergence when changing the $(β_1, β_2)$ combination. To our knowledge, this is the first phase transition in $(β_1,β_2)$ 2D-plane reported in the literature, providing rigorous theoretical guarantees for Adam optimizer. We further point out that the critical boundary $(β_1^*, β_2^*)$ is problem-dependent, and particularly, dependent on batch size. This provides suggestions on how to tune $β_1$ and $β_2$: when Adam does not work well, we suggest tuning up $β_2$ inversely with batch size to surpass the threshold $β_2^*$, and then trying $β_1< \sqrt{β_2}$. Our suggestions are supported by reports from several empirical studies, which observe improved LLM training performance when applying them.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。