Skip to main content
QUICK REVIEW

[Paper Review] Improving Generalization Performance by Switching from Adam to SGD

Nitish Shirish Keskar, Richard Socher|arXiv (Cornell University)|Dec 20, 2017
Neural Networks and ApplicationsComputer Science3 references403 citations
TL;DR

The paper proposes SWATS, an automatic hybrid optimizer that starts with Adam and switches to SGD when a gradient-subspace projection criterion is satisfied, improving generalization across multiple tasks.

ABSTRACT

Despite superior training outcomes, adaptive optimization methods such as Adam, Adagrad or RMSprop have been found to generalize poorly compared to Stochastic gradient descent (SGD). These methods tend to perform well in the initial portion of training but are outperformed by SGD at later stages of training. We investigate a hybrid strategy that begins training with an adaptive method and switches to SGD when appropriate. Concretely, we propose SWATS, a simple strategy which switches from Adam to SGD when a triggering condition is satisfied. The condition we propose relates to the projection of Adam steps on the gradient subspace. By design, the monitoring process for this condition adds very little overhead and does not increase the number of hyperparameters in the optimizer. We report experiments on several standard benchmarks such as: ResNet, SENet, DenseNet and PyramidNet for the CIFAR-10 and CIFAR-100 data sets, ResNet on the tiny-ImageNet data set and language modeling with recurrent networks on the PTB and WT2 data sets. The results show that our strategy is capable of closing the generalization gap between SGD and Adam on a majority of the tasks.

Motivation & Objective

  • Motivate the generalization gap between adaptive methods (Adam) and SGD.
  • Propose a hybrid training strategy that combines Adam’s fast initial progress with SGD’s generalization.
  • Develop an automatic switching mechanism with no extra hyperparameters.
  • Demonstrate the method across image classification and language modeling benchmarks.

Proposed method

  • Define SWATS as a two-phase optimizer that starts with Adam and switches to SGD when a projection-based criterion triggers.
  • Compute Adam step p_k and gradient g_k, derive SGD learning rate gamma_k from a non-orthogonal projection ensuring SGD direction aligns with Adam step.
  • Maintain an exponential average lambda_k of gamma_k to estimate the post-switch SGD rate.
  • Trigger the switch when |lambda_k/(1-beta2^k) - gamma_k| < epsilon, yielding SGD learning rate Lambda = lambda_k/(1-beta2^k).
  • No additional hyperparameters are introduced beyond those in Adam; use a bias-corrected, momentum-based Adam update prior to switching.
  • Evaluate SWATS against SGD and Adam on CIFAR-10/100 with DenseNet, ResNet, PyramidNet, SENet, Tiny-ImageNet, and language models on PTB and WT2.

Experimental results

Research questions

  • RQ1Can a hybrid optimizer combining Adam and SGD achieve generalization closer to SGD while retaining Adam’s fast initial progress?
  • RQ2What automatic switching criterion can determine the optimal switch point without adding hyperparameters?
  • RQ3How does SWATS perform across diverse tasks (image classification and language modeling) compared to pure Adam or SGD?

Key findings

  • SWATS generally matches the best performance among SGD and Adam across multiple architectures and datasets.
  • Switching often occurs within the first 20 epochs for CIFAR datasets and around epoch 49 for Tiny-ImageNet, with occasional brief degradation during switching that is recovered later.
  • The learned SGD learning rate after switch, Lambda, aligns with tuned SGD rates across tasks (as shown in Table 1).
  • Adam shows strong initial progress but poorer generalization compared to SGD; SWATS closes this gap by switching to SGD at an informed point.
  • In language modeling tasks, SWATS achieves comparable generalization to Adam while potentially requiring fewer training epochs to reach peak performance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.