Advances in optimizing recurrent networks

Yoshua Bengio, Nicolas Boulanger-Lewandowski, Razvan Pascanu

This 2012 paper from Yoshua Bengio’s lab at the University of Montreal arrived during a pivotal "revival" of Recurrent Neural Networks (RNNs). While RNNs are theoretically capable of modeling complex sequences, they were notoriously difficult to train for decades. This paper systematically evaluates a "toolbox" of optimization techniques that allow standard Stochastic Gradient Descent (SGD) to overcome these hurdles, often outperforming much more complex algorithms.

TL;DR

The authors demonstrate that the "impossible" task of training RNNs on long sequences can be solved by combining simple but clever architectural and optimization tricks—like gradient clipping, leaky integration, and Nesterov momentum. These techniques allow basic SGD to compete with (and often beat) sophisticated second-order optimization methods like Hessian-Free optimization.

What Problem Does This Paper Address?

The core challenge is the difficulty of learning long-term dependencies. When you train an RNN using backpropagation through time, you are essentially multiplying many Jacobian matrices together.

  1. Vanishing Gradients: If the eigenvalues of these matrices are small, the gradient shrinks exponentially as it travels back in time, meaning the network "forgets" distant events.
  2. Exploding Gradients: If the eigenvalues are large, the gradient grows exponentially, leading to massive, "destructive" weight updates that ruin the model’s progress.

Geometrically, the authors describe the error surface of an RNN as having "cliffs"—regions where the gradient suddenly becomes massive. Standard SGD usually falls off these cliffs, causing the training to diverge.

Methods

The paper evaluates five key enhancements to the standard RNN training pipeline:

  • Clipped Gradients: To handle "cliffs," the authors propose a simple rule: if the norm of the gradient exceeds a threshold, scale it down. This prevents the model from taking massive, erratic steps while maintaining the correct descent direction.
  • Leaky Integration: They introduce "slow-moving" hidden units that maintain a portion of their previous state ($h_t = \alpha h_{t-1} + \dots$). This creates a "shortcut" for information to flow across long time scales, mitigating the vanishing gradient problem.
  • Sparser Gradients (ReLU + L1): By using Rectified Linear Units (ReLU) and an L1 penalty on activations, the network is encouraged to use fewer, more specialized paths. This helps with "credit assignment"—making it clearer which specific units are responsible for a specific output.
  • Simplified Nesterov Momentum: They derive a version of Nesterov Accelerated Gradient (NAG) that "peeks ahead" at the loss landscape, providing more stability and faster convergence than standard momentum.
  • Powerful Output Models (NADE): For complex data like music, they replace simple output layers with a Neural Autoregressive Distribution Estimator (NADE) to better capture dependencies between multiple simultaneous notes.

Datasets

The authors tested their methods on two distinct types of sequential data:

  1. Polyphonic Music: Four datasets of symbolic music (Piano-midi.de, Nottingham, MuseData, and JSB chorales) represented as "piano-rolls." These are challenging because they require modeling both time and the simultaneous relationship between notes.
  2. Natural Language: The Penn Treebank (PTB) corpus, used for both word-level and character-level prediction tasks.

Key Insights and Ideas

  • The Geometry of Optimization: The "aha moment" is the realization that exploding gradients aren't just a numerical nuisance; they represent a specific geometric feature (cliffs) in the cost function. Clipping the gradient is essentially a "poor man's" second-order optimization that respects this geometry.
  • Momentum as Conservative Storage: The authors' re-formulation of Nesterov momentum suggests that its power comes from storing past velocity for a long time but using it "conservatively" during updates, which is crucial for the jagged error surfaces of RNNs.
  • Simplicity Wins: Perhaps the most important insight is that you don't necessarily need massive second-order solvers (like Hessian-Free optimization) to train deep recurrent models. With the right "tricks," SGD is remarkably resilient.

Key Results

The combined techniques (labeled as SGD+C, +L, +R, +M in the paper) showed significant gains:

  • On Music: The enhanced SGD models consistently outperformed vanilla SGD and were highly competitive with the much more computationally expensive Hessian-Free (HF) optimizer. For example, on the Nottingham dataset, the log-likelihood improved from -3.75 (vanilla) to -3.43 (with enhancements).
  • On Text: In the Penn Treebank word-level task, the enhancements dropped the test perplexity from 145.16 down to 128.35.
  • Character-level Text: The entropy dropped from 1.76 to 1.44 bits per character, a substantial improvement in the model's predictive power.

Limitations and Future Work

While these techniques expand the "time-scale" over which gradients can propagate, the authors admit that the vanishing gradient effect is still fundamentally present due to the non-linear nature of the units. They suggest that while these tricks make training easier, they don't fundamentally change the mathematical limit of how much an RNN can remember.

The paper also notes that choosing the right hyperparameters (like the clipping threshold or the "leakiness" factor $\alpha$) still requires a significant amount of manual tuning or random search, suggesting a need for more automated optimization strategies in the future.

Summary updated

BibTeX
@inproceedings{bengio2013advances,
  author = {Yoshua Bengio and Nicolas Boulanger-Lewandowski and Razvan Pascanu},
  title = {{Advances in optimizing recurrent networks}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2013},
  doi = {10.1109/icassp.2013.6639349},
}
Figure