AutoLRS: Automatic Learning-Rate Schedule by Bayesian Optimization on the Fly

Yuchen Jin, Tianyi Zhou, Liangyu Zhao, Yibo Zhu, Chuanxiong Guo, Marco Canini, Arvind Krishnamurthy

TL;DR

AutoLRS automates the tedious process of tuning learning rate (LR) schedules by using Bayesian Optimization (BO) to find the optimal LR for each stage of training. By employing a clever exponential forecasting model to predict long-term loss from just a few steps of training, it achieves up to a 1.5× speedup over hand-tuned schedules with minimal computational overhead.

The Problem: The "Black Magic" of LR Tuning

In deep learning, the learning rate schedule is often the difference between a state-of-the-art model and a total failure. Despite its importance, LR tuning remains one of the most manual and opaque aspects of the machine learning pipeline.

Standard approaches generally fall into two camps:

  1. Pre-defined schedules: Methods like step-decay or cosine annealing are rigid and require manual tuning of their own hyperparameters (e.g., when to drop the rate, or the cycle length).
  2. Adaptive optimizers: Algorithms like Adam or Adadelta adjust per-parameter rates but still require a well-tuned global LR schedule to perform optimally.

We currently lack a system that can automatically and efficiently adapt the LR based on the actual training dynamics of the model without requiring dozens of expensive trial-and-error runs.

The AutoLRS Approach

The core of AutoLRS is a greedy, stage-based optimization process. Training is divided into "stages" of $\tau$ steps. At the start of each stage, the system seeks an LR that minimizes the validation loss at the end of that stage.

Comparison of the AutoLRS generated learning rate schedule against standard baselines.

The "secret sauce" of AutoLRS consists of three main components:

  • Bayesian Optimization (BO): AutoLRS treats the validation loss as a black-box function of the LR. It uses a Gaussian Process to model this function and an acquisition function (Lower Confidence Bound) to pick the next LR to test.
  • Exponential Forecasting Model: Evaluating a candidate LR for a full $\tau$ steps is prohibitively slow. Instead, AutoLRS trains with a candidate LR for a tiny fraction of the time ($\tau' = \tau/10$) and fits an exponential model ($L(t) = a \exp(bt) + c$) to predict what the loss would be at step $\tau$.
  • Iterative Spline Smoothing: Because raw loss curves are noisy (especially with mini-batch SGD), quadratic spline smoothing is applied to the data before fitting the exponential model. This prevents the forecaster from being "distracted" by random spikes.

The system also uses a curriculum for $\tau$: it starts with small stages to encourage high exploration and gradually doubles the stage length as training stabilizes to favor exploitation.

Key Insights

  • Mutual Training: There is a beautiful synergy in AutoLRS—BO generates the data points needed to refine the forecasting model, and the forecasting model allows BO to explore the LR space 10× faster than brute force.
  • The Power of Simple Models: While one might expect a complex RNN to be needed for loss prediction, a simple exponential decay is a remarkably good fit for DNN training dynamics. This aligns with recent theoretical proofs of linear convergence in over-parameterized networks.
  • Self-Supervision: AutoLRS effectively turns the training process into a self-supervised task where the model's own progress dictates its future hyperparameters.

Key Results and Performance

AutoLRS was evaluated across diverse domains, including Computer Vision (ResNet-50 on ImageNet), NMT (Transformer on WMT 2014), and Language Modeling (BERT pre-training and fine-tuning). It consistently outperformed or matched heavily hand-tuned schedules.

BLEU score progression over training steps, showing AutoLRS achieving higher performance faster than baseline schedules.
  • Significant Speedups: AutoLRS achieved a 1.22× speedup for ResNet-50, 1.43× for Transformer, and 1.5× for BERT compared to the schedules published in their original papers.
  • Comparison to SOTA: It provided an average 1.31× speedup over state-of-the-art tuned schedules like Cyclical Learning Rates (CLR) and SGDR.
  • Generalization: On BERT downstream tasks (GLUE, SQuAD), the AutoLRS pre-trained model achieved higher accuracy and F1 scores than the original schedule, despite training for significantly fewer steps.
  • Search Efficiency: While manual tuning often requires 10+ full training runs, AutoLRS finds an optimized schedule in a single run with a total time cost only ~2× that of a standard training pass.

Limitations and Future Work

While highly effective, AutoLRS has a few limitations. It currently relies on standard linear warmup rather than searching for the LR during the initial warmup phase. Additionally, while it removes the need to tune the LR schedule, it introduces its own "hyper-hyperparameters" (like the maximum stage length $\tau_{max}$ and the number of BO samples $k$).

Finally, although a 2× training time overhead is vastly superior to manual tuning, it remains a computational cost. Future work could explore reducing the number of candidate LRs needed as training progresses, or extending this "on the fly" tuning to other optimizer parameters like momentum or weight decay.

Summary updated

BibTeX
@inproceedings{jin2021autolrs,
  author = {Yuchen Jin and Tianyi Zhou and Liangyu Zhao and Yibo Zhu and Chuanxiong Guo and Marco Canini and Arvind Krishnamurthy},
  title = {{AutoLRS: Automatic Learning-Rate Schedule by Bayesian Optimization on the Fly}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=SlrqM9_lyju},
}
Figure