[论文解读] AutoLRS: Automatic Learning-Rate Schedule by Bayesian Optimization on the Fly
AutoLRS 提出了一种自动化的、实时的超学习率调度方法,结合贝叶斯优化(BO)与轻量级指数损失预测模型,以最小化验证损失,无需人工干预。通过仅训练每个阶段的极小部分时间来预测完整阶段的性能,其收敛速度比人工调优的调度方法快 1.22× 至 1.5×,且在 ResNet-50、Transformer 和 BERT 模型上比当前最先进方法快 1.31×。
The learning rate (LR) schedule is one of the most important hyper-parameters needing careful tuning in training DNNs. However, it is also one of the least automated parts of machine learning systems and usually costs significant manual effort and computing. Though there are pre-defined LR schedules and optimizers with adaptive LR, they introduce new hyperparameters that need to be tuned separately for different tasks/datasets. In this paper, we consider the question: Can we automatically tune the LR over the course of training without human involvement? We propose an efficient method, AutoLRS, which automatically optimizes the LR for each training stage by modeling training dynamics. AutoLRS aims to find an LR applied to every $τ$ steps that minimizes the resulted validation loss. We solve this black-box optimization on the fly by Bayesian optimization (BO). However, collecting training instances for BO requires a system to evaluate each LR queried by BO's acquisition function for $τ$ steps, which is prohibitively expensive in practice. Instead, we apply each candidate LR for only $τ'\llτ$ steps and train an exponential model to predict the validation loss after $τ$ steps. This mutual-training process between BO and the loss-prediction model allows us to limit the training steps invested in the BO search. We demonstrate the advantages and the generality of AutoLRS through extensive experiments of training DNNs for tasks from diverse domains using different optimizers. The LR schedules auto-generated by AutoLRS lead to a speedup of $1.22 imes$, $1.43 imes$, and $1.5 imes$ when training ResNet-50, Transformer, and BERT, respectively, compared to the LR schedules in their original papers, and an average speedup of $1.31 imes$ over state-of-the-art heavily-tuned LR schedules.
研究动机与目标
- 解决学习率(LR)调度调优缺乏自动化的问题,这是深度神经网络(DNN)训练中的关键但人工密集型超参数。
- 克服预定义学习率调度和自适应优化器的局限性,后者引入了新的超参数并需要针对任务进行调优。
- 开发一种在训练过程中自动识别最优学习率值的方法,无需人工监督,直接最小化验证损失。
- 通过使用短期训练运行和预测模型来估计长期验证损失,降低贝叶斯优化(BO)的计算成本。
- 通过避免依赖固定调度形式或任务特定假设,确保在不同优化器、数据集和任务上的广泛兼容性。
提出的方法
- 将验证损失视为学习率的黑箱函数,应用贝叶斯优化(BO)迭代选择 LR 值以最小化期望改进。
- 不将每个候选 LR 训练至完整训练阶段长度 τ,而是仅训练 τ′ ≪ τ 步以降低计算成本。
- 在短期验证损失上训练指数时间序列预测模型,以预测每个候选 LR 在完整 τ 步后的验证损失。
- 使用预测的验证损失指导 BO 的采集函数,实现在极少完整训练运行下高效探索 LR 空间。
- 保持轻量级的 BO 后验分布和小型预测模型,确保极低的内存和计算开销。
- 实现 BO 与预测模型之间的相互学习:BO 查询新的 LR,其产生的短期数据用于训练预测模型,从而提升未来 BO 决策的准确性。
实验结果
研究问题
- RQ1我们能否在无需人工干预或预定义调度形式的情况下,自动完成 DNN 训练过程中的学习率调优?
- RQ2我们能否通过使用短期训练和损失预测而非完整阶段评估,来降低贝叶斯优化在学习率调度中的计算成本?
- RQ3所提出的 AutoLRS 方法是否在收敛速度和泛化能力上优于人工调优或最先进学习率调度方法?
- RQ4AutoLRS 在不同模型(如 ResNet-50、Transformer、BERT)和数据集(如 ImageNet、CIFAR-10、CIFAR-100)上表现如何?
- RQ5在 AutoLRS 框架中,若将 BO 替换为随机搜索或网格搜索,其对性能和效率的影响如何?
主要发现
- 与原始人工调优的学习率调度相比,AutoLRS 在 ImageNet 上训练 ResNet-50 时实现了 1.22× 的训练加速。
- 在 Transformer 模型上,与原始调度相比,AutoLRS 将训练时间减少了 1.43×,表明其在序列模型上表现强劲。
- 在 BERT 上,与原始论文的学习率调度相比,AutoLRS 实现了 1.5× 的加速,表明其在大规模 NLP 模型上的有效性。
- 在所有评估模型上,AutoLRS 平均比最先进、高度调优的学习率调度方法快 1.31×。
- 在 AutoLRS 中将 BO 替换为随机搜索或网格搜索会导致性能显著下降,收敛更慢且 Top-1 准确率更低,证实了智能搜索的重要性。
- 在 τ′ = τ/10 步上训练的指数损失预测模型,能够高精度预测完整 τ 步验证损失,从而在极低训练开销下实现有效的 BO。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。