Choose Between Adam, AdamW and SGD With Momentum

Last updated: November 29, 2026

Quick Overview

Compare SGD with momentum, Adam and AdamW, explain why weight decay behaves differently with Adam, and say which optimizer you would use for fine-tuning a transformer versus training a CNN on product images.

Amazon
Machine Learning
Machine Learning Engineer
Amazon
November 29, 2026
Machine Learning Engineer
Technical Screen
Machine Learning
Medium

0

0

0 solved


Compare SGD with momentum, Adam and AdamW, explain why weight decay behaves differently with Adam, and say which optimizer you would use for fine-tuning a transformer versus training a CNN on product images.

Optimizer choice affects training cost on large AWS clusters and final quality. Technical screens use this to see whether candidates know the update rules and the decoupled weight decay subtlety rather than reciting 'Adam is best'.

What the Interviewer Expects
  • Write the momentum and Adam update rules
  • Explain bias correction
  • Explain why L2 regularization is not weight decay under Adam
  • Describe AdamW's decoupling
  • Recommend optimizers with reasons
Key Topics to Cover
Optimization
Adam
AdamW
Momentum
Weight decay
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • What memory does Adam's state cost for a 7B parameter model?
  • Why do some practitioners find SGD generalizes better for vision?
  • What does epsilon do, and when does it matter?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Ask about model type, batch size and whether training is from scratch or fine-tuning....

Approach

SGD with momentum: vt=μvt−1+gtv_t=\mu v_{t-1}+g_t, θt=θt−1−ηvt\theta_t=\theta_{t-1}-\eta v_t. Adam keeps mt=β1mt−1+(1−β1)gtm_t=\beta_1m_{t-1}+(1-\beta_1)g_t and vt=β2vt−1+(1−β2)gt2v_t=\beta_2v_{t-1}+(1-\beta_2)g_t^2, bias-corrects $\hat m=m_t/(1-\beta...


Submit Your Answer
Markdown supported