A Simple Guard for Learned Optimizers

Isabeau Prémont-Schwarz, Jaroslav Vitku, Jan FeyereislICML 2022

Learned optimizers (L2Os) are incredibly fast at the start of training but often fail to converge or generalize to new tasks. To address this, researchers introduce LGL2O (Loss-Guarded L2O), a simple mechanism that monitors performance and switches between a fast learned optimizer and a reliable "fallback" (like SGD). This approach provides both state-of-the-art speed and guaranteed convergence.

The Problem with Learned Optimizers

In deep learning, we typically rely on hand-crafted optimizers like SGD or Adam. Recently, researchers have started "learning to optimize"—training a neural network (the L2O) to act as the optimizer for another network.

While L2Os can be significantly faster than SGD (acting as the "hare"), they suffer from two major flaws:

  1. Lack of Convergence: They aren't mathematically guaranteed to reach the global minimum and often plateau or diverge after the initial burst of progress.
  2. Poor Generalization: An L2O trained on simple MLPs often fails spectacularly when asked to optimize a CNN or a different dataset (an out-of-distribution failure).

Previous attempts to "safeguard" L2Os (like GL2O) were computationally expensive and relied on complex criteria in the weight space. This paper seeks a simpler, cheaper way to keep the "hare" on track using the "tortoise" (SGD) as a safety net.

Introducing Loss-Guarded L2O (LGL2O)

The authors propose LGL2O, which relies on an elegantly simple logic: at any given step, the algorithm looks at the update proposed by the L2O and the update proposed by a traditional optimizer. It compares the expected future loss for both and simply picks the one that performs better.

LGL2O Architecture

Key features of LGL2O include: * Loss-Based Criterion: It uses the loss function itself as the guard. If the loss from the L2O update is lower than the loss from the SGD update, it follows the L2O; otherwise, it falls back to SGD. * Block Efficiency: To avoid the overhead of constant switching and loss evaluations, the authors implement a "block" approach. They perform multiple steps of each optimizer in parallel and then evaluate the resulting loss on a small set of validation mini-batches. * Theoretical Guarantee: The authors provide a formal proof showing that as long as the fallback optimizer is provably convergent, the hybrid LGL2O algorithm will also converge to the minimum.

Key Insights and Results

The authors evaluated LGL2O across a variety of tasks to test both in-distribution performance and out-of-distribution (OOD) robustness, including standard benchmarks (MNIST, CIFAR-10), complex vision tasks (TinyImageNet), and synthetic challenges (Moons, Circles, Spirals).

  • The "Aha" Moment: You don't need complex math in the weight space to ensure convergence. Comparing the loss values directly is computationally cheaper and more intuitive.
  • Automatic Transition: In almost all tests, the guard naturally favors the L2O for the first ~1,000 steps (where it is fastest) and then seamlessly transitions to SGD as the L2O begins to struggle with precision near the minimum.
  • Synergy over Selection: Surprisingly, LGL2O sometimes performs better than either of its constituent parts. On the "Spirals" dataset, SGD gets stuck in local optima and the L2O plateaus, but the switching mechanism allows the hybrid to navigate the loss landscape more effectively.
Performance on MNIST

In terms of pure performance, LGL2O matched the lightning-fast start of the L2O on datasets like MNIST but continued to decrease the loss for millions of steps, eventually reaching the same precision as SGD. Furthermore, in OOD scenarios where vanilla L2Os often diverged to "NaN" or exploded, LGL2O detected this immediately and reverted to stable SGD behavior. It consistently outperformed the previous state-of-the-art guard (GL2O) in both final loss accuracy and computational speed.

Limitations and Future Work

While highly effective, LGL2O has a few limitations:

  • Evaluation Noise: Using a small number of mini-batches to estimate the loss can be noisy. Near the very end of training, this noise can cause the guard to make the "wrong" choice. An adaptive check—increasing the number of validation batches as the loss gets lower—could mitigate this.
  • Scale: The "optimizees" used in the study are relatively small (MLPs and small CNNs). Testing this on massive architectures like Transformers remains an open challenge.
  • Meta-Training Overhead: The L2O still needs to be meta-trained, which is a significant upfront cost, though the guard makes the resulting optimizer much more "plug-and-play" across different tasks.

Summary updated

BibTeX
@inproceedings{premontschwarz2022simple,
  author = {Isabeau Prémont-Schwarz and Jaroslav Vitku and Jan Feyereisl},
  title = {{A Simple Guard for Learned Optimizers}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
}
Figure