Excluding the weights and gradients themselves, how much optimiser-state memory per parameter (in fp32) do plain SGD, SGD with momentum and Adam require, and why can SGD with momentum still beat Adam on test accuracy in image classification benchmarks?

Deep learning, Optimisers
Level L4 Advanced. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you know the memory overhead of adaptive optimisers and the empirical generalisation gap between Adam and SGD with momentum.

Key idea

In fp32 (4 bytes per scalar), plain SGD needs 0 bytes of optimiser state per parameter, SGD with momentum needs 4 bytes (one momentum buffer v), and Adam needs 8 bytes (two moment buffers m and v). Adam’s coordinate-wise scaling can converge to solutions with worse generalisation on overparameterised vision models unless carefully regularised.

Steps

  1. Memory per parameter (fp32, excluding weights and gradients): plain SGD keeps no state (0 floats, 0 bytes); SGD with momentum stores v (1 float, 4 bytes); Adam stores m and v (2 floats, 8 bytes). For a 100M-parameter model, Adam’s optimiser states alone take 800 MB (often kept in fp32 even during mixed-precision fp16 training).
  2. Generalisation gap: in overparameterised linear and neural models, plain SGD updates stay in the span of the data gradients and converge towards minimum-ℓ2-norm / max-margin solutions.
  3. Why Adam can generalise worse: Adam rescales each coordinate by 1/v^i, giving small-gradient (potentially noisy or spurious) directions relatively larger steps, which resembles an ℓ∞-like bias that can overfit before well-tuned SGD with momentum and cosine decay.
  4. Practical remedy: use AdamW (decoupled weight decay) with learning-rate schedules—and in Transformers, AdamW outperforms SGD because attention and embedding blocks have wildly different gradient scales across coordinates.

Common mistakes

How long your answer should be

About half a page (5–6 sentences covering byte counts and the generalisation difference); 2–3 minutes.

Read this

Previous in Deep learning: What is orthogonal weight initialisation, why does it preserve both forward activation norms and backward gradient norms exactly in a deep linear network with nin=nout, and what gain factor should scale it when used with ReLU?
Next in Deep learning: Why is standard test-time weight scaling in dropout only an exact ensemble average for a single linear layer, and how does Monte Carlo (MC) dropout use dropout at inference time to estimate predictive uncertainty?