TL;DR
This paper introduces MARTHE, a novel online algorithm for automatically scheduling learning rates during neural network training. By approximating hypergradients, MARTHE offers a more stable and generalizable learning rate schedule compared to existing methods, interpolating between aggressive and conservative approaches.
What Problem Does This Paper Address?
Optimizing the learning rate (LR) schedule is crucial for efficient and effective training of machine learning models, especially deep neural networks. While many methods exist to adapt the LR during training, the ultimate goal is to minimize generalization error, which is typically estimated using a validation set. Hyperparameter optimization (HPO) techniques are designed for this, but traditional HPO methods are computationally prohibitive for finding LR schedules on a per-task basis because they require multiple full training runs. Existing online LR adaptation methods, like HD and RTHO, offer faster solutions but suffer from limitations: HD can be "shortsighted," leading to underestimation of the LR, while RTHO can be unstable or too slow to adapt. This paper addresses the need for an online LR scheduling method that is both computationally efficient and robust, capable of producing schedules that lead to better generalization.
Methods
The core contribution is the MARTHE (Moving Average Real-Time Hyperparameter Estimation) algorithm. MARTHE is an online, hypergradient-based approach that aims to approximate the true, but computationally intractable, hypergradient of the validation error with respect to the LR schedule.
Key aspects of the method include:
- Hypergradient Approximation: The paper first derives the structure of the true hypergradient, which involves differentiating the validation loss with respect to the entire LR schedule. This is computationally expensive.
- Tangent System: To efficiently compute the effect of LR changes on model weights, MARTHE utilizes a "tangent system," which is analogous to forward-mode algorithmic differentiation. This system tracks how model parameters would change for infinitesimal variations in the LR.
- Moving Average: MARTHE maintains a moving average of hypergradient approximations over increasingly longer horizons. This allows it to interpolate between aggressive (like HD, which only considers the immediate step) and conservative (like RTHO, which accumulates all past information) approaches.
- Generalization of Existing Methods: The paper shows that existing methods like HD and RTHO can be seen as special cases of MARTHE with specific choices of a smoothing parameter ($\mu$). This provides a unified perspective and sheds light on their limitations.
Datasets
- MNIST: Used for training feed-forward neural networks to evaluate MARTHE and compare it with other methods.
- CIFAR10: Used for training VGG-11 networks with SGDM.
- CIFAR100: Used for training ResNet-18 networks with Adam.
Key Insights and Ideas
- The "Shortsightedness" vs. "Instability" Trade-off: Existing online LR schedulers face a dilemma: being too aggressive (like HD) can lead to underestimating the LR and suboptimal performance, while being too conservative (like RTHO) can lead to instability or failure to adapt to changing loss landscapes.
- MARTHE as a Unified Interpolation: MARTHE elegantly bridges this gap by using a moving average of hypergradient approximations. This allows it to dynamically balance the influence of recent vs. past information, leading to more robust schedules.
- Hypergradient Structure Matters: Understanding the mathematical structure of the hypergradient is key to developing better approximation strategies. The paper's analysis reveals how future LR trajectories are influenced by past and current states.
- Validation Loss is Crucial for Generalization: While many LR adaptation methods optimize for training loss, this paper emphasizes the importance of using validation loss for finding schedules that generalize well.
Key Results
- Improved Generalization: MARTHE consistently achieved better validation accuracy compared to HD and RTHO across various experiments, especially when given sufficient time. For instance, on MNIST, MARTHE achieved a peak accuracy of 94.2% with $\mu=0.99$, outperforming HD and RTHO.
- Robustness to Hyperparameters: MARTHE demonstrated superior adaptability to different hyper-hyperparameter settings and random seeds, indicating its reliability.
- Computational Trade-off: MARTHE has a higher computational cost per iteration than HD (approximately 4x), but it requires fewer trials to reach comparable or better performance, making it efficient in terms of overall training time for achieving good generalization.
- Effective Interpolation: The paper shows that MARTHE can outperform HD and perform at least as well as RTHO, while converging for a wider range of hyper-learning rates ($\beta$).
Limitations and Future Work
- Computational Cost: While MARTHE is more efficient than full HPO, it is still more computationally expensive per iteration than simpler methods like HD or exponential decay.
- Tuning Hyperparameters: Although MARTHE is more robust, its performance still depends on its own hyperparameters ($\beta$ and $\mu$). The paper suggests future work could focus on deriving or learning adaptive rules for these parameters.
- Generalizability to Other Hyperparameters: The current work focuses on LR scheduling. Future research could explore using MARTHE to tune other crucial hyperparameters, such as regularization parameters.
- Broader Application Domains: The authors plan to validate MARTHE in other learning domains beyond image classification.
Summary updated