---
title: Compare SGD, SGD with momentum and Adam. Why was AdamW introduced, and which settings (schedule, warmup, β values)…
url: https://gurkanozkan.ai/learn/questions/research-optimisers-sgd-momentum-adam-020/
markdown: https://gurkanozkan.ai/learn/questions/research-optimisers-sgd-momentum-adam-020.md
kind: question
role: Research
stage: Technical
difficulty: Medium
json: https://gurkanozkan.ai/api/learn/questions/research-optimisers-sgd-momentum-adam-020.json
robots: noindex
---

# Compare SGD, SGD with momentum and Adam. Why was AdamW introduced, and which settings (schedule, warmup, β values) matter most when training large models?

Research · Technical · Medium

## Answer

*Model answer, written in a candidate's voice*

### In short

- SGD uses raw gradient steps; momentum averages gradients exponentially and damps oscillation.
- Adam keeps first and second moment estimates, applies bias correction, and scales each parameter adaptively.
- Adam costs two extra state tensors per parameter (m and v).
- AdamW decouples weight decay from the adaptive scaling so regularisation is not distorted by per-parameter step sizes.
- For large models, warmup plus cosine/linear decay and beta2 are the most sensitive settings; lower beta2 can stabilise runs.

### In full

SGD takes a plain gradient step, while SGD with momentum keeps an exponential average of past gradients, which damps oscillation and accelerates along consistent directions. Adam goes further by maintaining a first-moment estimate and a second-moment estimate, bias-correcting both, and dividing the update by the square root of the second moment, so each parameter is scaled adaptively; the cost is two extra state tensors per parameter. AdamW was introduced because in Adam, weight decay added to the gradient gets multiplied by the same adaptive scaling, so the effective regularisation becomes parameter-dependent and inconsistent with a clean decoupled decay; AdamW instead applies decay directly to the weights. For large models, the settings that matter most are the LR schedule and warmup: ramp up briefly so updates stay small while the second-moment estimates are still noisy, then decay with cosine or linear schedule, and tune beta2 carefully—common beta1 is around 0.9, while a lower beta2 such as 0.95 is often used to adapt faster and stabilise long runs, though the right value is empirical. In practice I would treat peak LR, warmup length, decay shape, and beta2 as the main knobs, with epsilon and beta1 secondary, and validate against loss spikes and gradient norms rather than trusting defaults.

*Corrected by an independent AI reviewer.*

## What a strong answer covers

- Momentum keeps an exponential average of gradients and damps oscillation.
- Adam scales each parameter by a second-moment estimate and applies bias correction.
- AdamW decouples weight decay from the adaptive scaling.
- Warmup tames noisy early second-moment estimates; then cosine or linear decay.
- A lower β2 can stabilise large runs.
- Adam costs two extra state tensors per parameter.

## Common mistakes

- Claiming Adam needs no learning-rate tuning.
- Treating an L2 penalty as identical to decoupled weight decay.

## Topic guides

- [Deep learning fundamentals](https://gurkanozkan.ai/learn/topics/deep-learning.md)
- [Training neural networks: losses, optimisers, numerics and scale](https://gurkanozkan.ai/learn/topics/training.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
