Promoting Exploration in Memory-Augmented Adam using Critical Momenta

Pranshu Malviya, Goncalo Mordido, Aristide Baratin, Reza Babanezhad Harikandeh, Jerry Huang, Simon Lacoste-Julien, Razvan Pascanu, Sarath Chandar · Submission to ICLR 2024 · Rejected

Adaptive gradient-based optimizers, particularly Adam, are the workhorses of modern deep learning. They offer fast convergence and are highly robust to hyperparameter choices. However, they often generalize worse than non-adaptive methods like standard Stochastic Gradient Descent (SGD). Recent studies tie this performance gap to the optimizer's tendency to settle into "sharp" minima.

To address this, researchers have developed Adam+CM (Adam with Critical Momenta), a memory-augmented version of Adam that uses a buffer of past momentum terms to help neural networks escape sharp, poorly-generalizing local minima and find flatter, more robust regions in the loss landscape.

The Problem: Sharp vs. Flat Minima

In deep learning, the "shape" of the minimum your optimizer finds matters just as much as the final loss value. Sharp minima (narrow, steep valleys) tend to generalize poorly because a tiny shift in the data distribution between the training and test sets can lead to a massive jump in error. Flat minima (wide, shallow basins) are much more robust and typically lead to better real-world performance.

Optimization trajectories on a 2D loss landscape showing Adam+CM escaping a sharp minimum.

While Adam is famous for its speed, it is notorious for getting trapped in these sharp minima. Previous attempts to fix this, such as using "Critical Gradients" (Adam+CG), maintained a memory buffer of past gradients to push the optimizer out of narrow holes. However, CG often fails due to gradient cancellation: in a sharp valley, gradients on opposite walls point in opposite directions. When averaged, they cancel each other out, and the optimizer remains stuck.

The Solution: Adam with Critical Momenta (Adam+CM)

The core innovation of Adam+CM is a shift from storing raw gradients to storing momentum terms in a fixed-size priority buffer.

  1. The Buffer: The optimizer maintains a small "memory" (e.g., 5 to 20 slots) of the most significant momentum terms encountered during training. These are prioritized by their magnitude ($l_2$-norm).
  2. Aggregation: At each step, the optimizer doesn't just look at the current gradient; it adds the average of the momenta in the buffer to the current update.
  3. The "Overshoot" Effect: Because momentum changes more slowly than raw gradients, it doesn't suffer from the same cancellation issues. This added "inertia" forces the optimizer to overshoot narrow, sharp basins.
Buffer quantities and mean vectors illustrating how critical momenta avoid the cancellation issues seen with critical gradients.

To eventually settle into a flat minimum, the buffer is gradually updated, and the influence of old "critical" points is decayed over time. By using a buffer of momenta, the optimizer maintains a consistent "push" that isn't neutralized by the high variance of gradients inside a sharp basin.

Key Insights and Performance

The researchers evaluated Adam+CM across a diverse range of standard benchmarks, proving its versatility across Vision (CIFAR, ImageNet), Language (Penn Treebank), and Online Learning tasks.

  • Superior Accuracy: Adam+CM consistently outperformed standard Adam and other memory-augmented variants. On ImageNet, it achieved 71.7% top-1 accuracy, compared to 67.8% for standard Adam and 69.7% for Adam+CG. In language modeling, it reduced validation perplexity to 163.2, a significant improvement over Adam's 179.4.
  • Implicit Bias Toward Flatness: Theoretical convergence analysis shows that Adam+CM is mathematically biased toward finding regions with lower Hessian eigenvalues (a proxy for flatness). In almost every empirical test, the "sharpness" metric of the final solution was lower for Adam+CM than for the baselines.
  • Buffer Size Matters: Interestingly, even a very small buffer (size 5) provides significant gains. Larger buffers increase the "exploration" pressure, requiring the optimizer to find even wider minima to eventually converge.
  • Synergy with SAM: The method can be combined with Sharpness-Aware Minimization (SAM). While SAM focuses on local flatness, CM focuses on global exploration; together, they can achieve even higher accuracies.

Limitations and Future Directions

While highly effective, Adam+CM does introduce two new hyperparameters: buffer capacity ($C$) and decay rate ($\lambda$). If the learning rate is not decayed properly, the "overshooting" nature of the buffer can cause the optimizer to oscillate around the global minimum rather than settling in. Furthermore, the theoretical convergence proof relies on the assumption of a quadratic loss landscape, which is a simplification of real-world neural network surfaces.

Looking ahead, the authors suggest exploring Critical Momenta in Reinforcement Learning, where exploration is a primary challenge and escaping local optima is critical for discovering complex strategies.

Summary updated

BibTeX
@misc{malviya2023promoting,
  author = {Pranshu Malviya and Goncalo Mordido and Aristide Baratin and Reza Babanezhad Harikandeh and Jerry Huang and Simon Lacoste-Julien and Razvan Pascanu and Sarath Chandar},
  title = {{Promoting Exploration in Memory-Augmented Adam using Critical Momenta}},
  year = {2023},
  eprint = {2307.09638},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.09638},
}
Figure