HyperAdam: A Learnable Task-Adaptive Adam for Network Training

Shipeng Wang, Jian Sun, Zongben Xu

Abstract

HyperAdam is a "learning to optimize" (L2O) framework that enhances the classic Adam optimizer by making its decay rates and update weights learnable and task-adaptive. By ensembling multiple Adam-like updates through a recurrent neural network architecture, it achieves superior generalization and stability compared to both traditional hand-designed optimizers and previous black-box learned optimizers.

Introduction

Training deep neural networks typically relies on human-designed optimizers like SGD or Adam. While robust, these algorithms use fixed hyperparameters—such as decay rates for momentum—that may not be optimal for every stage of training or every specific architecture. Recently, "learning to optimize" (L2O) has emerged as a promising alternative, where a secondary neural network is trained to predict the best updates for a learner network. However, many existing L2O methods are "black boxes" that fail to generalize to deeper networks, different datasets, or longer training horizons. HyperAdam addresses these limitations by combining the proven mathematical structure of Adam with the flexibility of meta-learning.

Methods

HyperAdam is modeled as a Recurrent Neural Network (RNN) composed of three specialized components that process the gradient $g_t$ and maintain a hidden state $\mathcal{H}_t$:

  1. StateCell: This unit processes the current normalized gradient and the previous hidden state to model the "state" of the optimization task.
  2. AdamCell: Instead of using a single pair of decay rates, this cell generates $J$ different pairs of adaptive decay rates. It maintains $J$ parallel sets of first and second-moment estimations, effectively creating a "moment field" of candidate updates.
  3. WeightCell: This unit determines the importance of each candidate update. It outputs a "weight field" that adaptively combines the candidates into a single final update vector $d_t$.
Architecture of the HyperAdam optimizer showing the interaction between the StateCell, AdamCell, and WeightCell.

The system is meta-trained to minimize the cumulative loss of a learner network. To ensure stability, the authors employ "Random Scaling" and "Combination with Convex Functions" during training.

Key Insights

  • Structured Meta-Learning: By forcing the RNN to operate within the mathematical framework of Adam, HyperAdam retains the stability of human-designed algorithms while gaining the flexibility of data-driven methods.
  • Ensemble Navigation: The "moment field" allows the optimizer to potentially escape saddle points more effectively. If one set of decay rates leads to a plateau, another set in the ensemble may provide a better descent direction.
  • Generalization through Structure: Unlike purely black-box optimizers, HyperAdam generalizes remarkably well. Meta-trained on a simple 1-layer MLP for only 100 steps, it can successfully optimize 10-layer networks for 10,000 steps.

Key Results

The authors evaluated HyperAdam across several benchmarks, including MNIST and CIFAR-10.

  • Superior Convergence: In fixed 100-step tests on MNIST, HyperAdam consistently achieved lower final losses than Adam, RMSProp, and other state-of-the-art learned optimizers like DMoptimizer and RNNprop.
  • Long-Horizon Stability: When extended to 10,000 iterations—100 times longer than its meta-training period—HyperAdam remained stable and outperformed Adam on both CNN and LSTM tasks. For instance, on a 2-layer LSTM, HyperAdam achieved a final loss of 0.26, significantly lower than Adam's 0.51.
Performance comparison of HyperAdam against baseline optimizers on MNIST and CIFAR-10 benchmarks.

Conclusion

HyperAdam demonstrates that embedding classical optimization principles into a meta-learning framework can overcome the generalization issues of previous L2O methods. While it introduces some computational overhead due to the RNN components, the gains in convergence speed and final accuracy make it a compelling alternative for training complex neural networks. Future work will explore scaling HyperAdam to larger architectures like ResNets and Transformers.

Summary updated

BibTeX
@inproceedings{wang2019hyperadam,
  author = {Shipeng Wang and Jian Sun and Zongben Xu},
  title = {{HyperAdam: A Learnable Task-Adaptive Adam for Network Training}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.33015297},
}
Figure