Learning Gradient Descent: Better Generalization and Longer Horizons

Kaifeng Lv, Shunhua Jiang, Jian Li

Abstract

Training deep neural networks is a highly nontrivial task, involving carefully selecting appropriate training algorithms, scheduling step sizes and tuning other hyperparameters. Trying different combinations can be quite labor-intensive and time consuming. Recently, researchers have tried to use deep learning algorithms to exploit the landscape of the loss function of the training problem of interest, and learn how to optimize over it in an automatic way. In this paper, we propose a new learning-to-learn model and some useful and practical tricks. Our optimizer outperforms generic, hand-crafted optimization algorithms and state-of-the-art learning-to-learn optimizers by DeepMind in many tasks. We demonstrate the effectiveness of our algorithms on a number of tasks, including deep MLPs, CNNs, and simple LSTMs.

Introduction

In deep learning, finding the right optimization algorithm and hyperparameter schedule is a tedious, trial-and-error process. Recently, meta-learning—using machine learning to replace hard-coded optimizers—has emerged as a promising solution. A prominent example is the "DMoptimizer" (Andrychowicz et al., 2016), which uses an LSTM to learn gradient descent. However, these learned optimizers often suffer from severe overfitting. If trained for 100 steps, their performance typically collapses when asked to optimize for longer horizons or on different network architectures. This paper introduces RNNprop, a model designed to bridge this generalization gap.

Methodology

RNNprop operates coordinate-wise, managing each parameter of the target network (the "optimizee") individually. The architecture, shown in Figure 1, incorporates several key innovations to ensure robustness:

The architecture of the RNNprop optimizer, featuring input preprocessing and a recurrent core.
  1. Adam-like Input Normalization: Instead of raw gradients, RNNprop receives normalized gradients—the gradient divided by the square root of the moving average of past squared gradients. This provides scale-invariance similar to Adam.
  2. Random Scaling: During meta-training, the parameters of the optimizee's loss function are randomly scaled. This prevents the RNN from memorizing a fixed step size and forces it to learn an adaptive policy.
  3. Convex Function Combination: To help the RNN learn basic descent mechanics, the authors blend the complex neural network loss with a simple, randomly generated convex function during early training.

Evaluation and Results

The optimizer was meta-trained on a simple 1-hidden-layer MLP on MNIST and then tested on unseen tasks, including deeper MLPs, CNNs on CIFAR-10, and LSTMs.

Long-Horizon Generalization

A major failure mode of previous meta-optimizers is the inability to generalize beyond the training horizon. As shown in Figure 2, while the baseline DMoptimizer diverges after approximately 400 steps, RNNprop continues to decrease loss effectively up to 10,000 steps, despite being trained on only 100-step trajectories.

Performance comparison over 2,000 (left) and 10,000 (right) steps. RNNprop demonstrates superior stability and generalization compared to DMoptimizer.

Architectural and Activation Generalization

RNNprop also generalizes across activation functions. When tested on an MLP with ReLU activations (having been trained on Sigmoid), RNNprop achieved a final loss of 0.27, significantly better than DMoptimizer's 1.05. Furthermore, it successfully trained 5-layer MLPs and CNNs, matching or exceeding the performance of tuned traditional algorithms like Adam and RMSprop.

Discussion

The success of RNNprop suggests that adaptivity in meta-learning requires relative rather than absolute gradient information. By forcing the RNN to see normalized gradients and exposing it to randomized landscapes, the model avoids memorizing specific paths and instead learns the underlying principles of optimization. While RNNprop may not always beat the most perfectly tuned traditional algorithms in every scenario, its ability to generalize across architectures and long horizons marks a significant step toward automated, robust optimization.

Summary updated

BibTeX
@inproceedings{lv2017learning,
  author = {Kaifeng Lv and Shunhua Jiang and Jian Li},
  title = {{Learning Gradient Descent: Better Generalization and Longer Horizons}},
  booktitle = {International Conference on Machine Learning},
  year = {2017},
}
Figure