arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.05192cs.LGcs.CLstat.ML
收藏

理解 Warmup-Stable-Decay 学习率:河谷损失景观视角

Understanding Warmup-Stable-Decay Learning Rates: A River Valley Loss Landscape Perspective

Stanford University(斯坦福大学);Toyota Technological Institute at Chicago(芝加哥丰田理工学院)

Kaiyue Wen, Zhiyuan Li, Jason Wang, David Hall, Percy Liang, Tengyu Ma

AI总结:

本文以河谷损失景观解释 WSD 学习率调度中稳定期高损失、衰减期骤降的机制,并提出复用衰减检查点的 WSD-S,在 0.1B–1.2B 模型上更优。

摘要:

当前训练语言模型需要预先确定固定的计算预算,因为典型的余弦学习率调度依赖于总步数。相比之下,Warmup-Stable-Decay(WSD)调度使用恒定学习率生成一个迭代点主分支,原则上该分支可以无限延续,而无需预先指定计算预算。随后,给定任意计算预算,可以在适当时间从主分支分出,采用快速衰减的学习率来生成性能强劲的模型。从经验上看,WSD 产生了一条非传统的损失曲线:损失在稳定阶段保持较高水平,但在衰减阶段急剧下降。为解释这一现象,我们推测预训练损失呈现出一种河谷景观,类似于底部有一条河流的深谷。在该假设下,我们表明在稳定阶段,迭代点会因高学习率而发生大幅振荡,但同时沿着河流快速前进。在衰减阶段,快速下降的学习率将迭代点的振荡降至最低,使其更靠近河流,并揭示真正的优化进展。因此,持续的高学习率阶段和快速衰减阶段分别负责河流方向和山体方向上的进展,二者都至关重要。我们的分析预测出与经验观察一致的现象,并表明这种景观可以由在简单二元语法数据集上进行预训练而产生。受该理论启发,我们提出了 WSD-S,这是 WSD 的一种变体,它复用先前检查点的衰减阶段并仅保留一个主分支,同时从已衰减的检查点恢复训练。实验表明,在单次运行中、参数规模从 0.1B 扩展到 1.2B 时,WSD-S 在跨各种计算预算获取多个语言模型检查点方面优于 WSD 和 Cyclic-Cosine。

英文摘要:

Training language models currently requires pre-determining a fixed compute budget because the typical cosine learning rate schedule depends on the total number of steps. In contrast, the Warmup-Stable-Decay (WSD) schedule uses a constant learning rate to produce a main branch of iterates that can in principle continue indefinitely without a pre-specified compute budget. Then, given any compute budget, one can branch out from the main branch at a proper time with a rapidly decaying learning rate to produce a strong model. Empirically, WSD generates a non-traditional loss curve: the loss remains elevated during the stable phase but sharply declines during the decay phase. Towards explaining this phenomenon, we conjecture that pretraining loss exhibits a river valley landscape, which resembles a deep valley with a river at its bottom. Under this assumption, we show that during the stable phase, the iterate undergoes large oscillations due to the high learning rate, yet it progresses swiftly along the river. During the decay phase, the rapidly dropping learning rate minimizes the iterate's oscillations, moving it closer to the river and revealing true optimization progress. Therefore, the sustained high learning rate phase and fast decaying phase are responsible for progress in the river and the mountain directions respectively, and are both critical. Our analysis predicts phenomenons consistent with empirical observations and shows that this landscape can emerge from pretraining on a simple bi-gram dataset. Inspired by the theory, we introduce WSD-S, a variant of WSD that reuses previous checkpoints' decay phases and keeps only one main branch, where we resume from a decayed checkpoint. WSD-S empirically outperforms WSD and Cyclic-Cosine in obtaining multiple language model checkpoints across various compute budgets in a single run for parameters scaling from 0.1B to 1.2B.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑