EasyDeepLearn

When do you prefer SGD with momentum over Adam?

medium

Answer

  • For convolutional vision models trained from scratch to their best possible accuracy, tuned SGD with momentum still tends to generalize slightly better than Adam, which is why many image classification recipes use it.
  • Adam wins where gradient scales differ wildly across parameters: transformers, embeddings with sparse updates, and anything with attention.
  • Adam is also far more forgiving of a poorly chosen learning rate, which makes it the right default when you cannot afford a sweep.
  • Memory matters too, since Adam stores two extra states per parameter, which is significant at scale.
  • The honest summary is that Adam, or AdamW, is the default for language models and SGD remains competitive for vision, and the difference shrinks once both are properly tuned.
Check yourself — multiple choice
  • SGD is always better
  • Tuned SGD with momentum can generalize slightly better for vision models from scratch; Adam wins on transformers and sparse gradients and tolerates untuned learning rates
  • Adam never converges
  • They are interchangeable

The choice tracks gradient scale heterogeneity, tuning budget and memory, not a universal ranking.

#optimizers#optimization

Practise Deep Learning

214 interview questions in this topic.

Related questions