ML Systems Lab Open interactive version →
Intermediate 45 min read adagradrmspropadaptiveper-parametersparse

AdaGrad and RMSProp

Per-parameter learning rates, why AdaGrad dies on dense problems, and RMSProp's fix.

SGD and momentum apply the same learning rate α to every parameter. This breaks as soon as parameters operate at different scales — which they always do in real networks. Word embeddings exposed the problem most clearly. The embedding for "the" appears in nearly every training sentence and accumulates gradients continuously. The embedding for "quasar" appears rarely and receives gradients in sparse bursts. A fixed α that is large enough to meaningfully update "quasar" when it finally appears is too large for "the," which has already converged. You need different effective learning rates for different parameters based on how often and how strongly they are updated. AdaGrad (Duchi et al., 2011) invented this: maintain a running sum of squared gradients per parameter, G_i = Σ g_{i,t}², then scale each step by α/√G_i. Parameters with large historical gradients get smaller steps; parameters with sparse or small gradients get larger steps. For sparse NLP embeddings, this is exactly right — rare words finally get appropriately large updates when they appear. The fatal flaw: G_i only ever grows. For a dense convolutional layer that receives a gradient on every example, G_i grows without bound, and the effective learning rate collapses toward zero.

Training stalls long before convergence. RMSProp fixes this with one change: replace the cumulative sum with an exponential moving average. G_i now reflects recent gradient magnitude rather than all-time total, so it can stabilize or decrease. Dense parameters stop dying.

Key points

Takeaway

AdaGrad was invented to solve the sparse-gradient scaling problem that SGD could not handle. It worked, then killed itself: its cumulative accumulation meant every dense-gradient parameter's learning rate decayed to zero. RMSProp swapped the cumulative sum for an exponential moving average — a single structural change that preserved the per-parameter adaptation while making the algorithm viable for dense networks.

Recap

Check your understanding

Q1. AdaGrad is used to train word embeddings for a 100,000-word vocabulary. After 500,000 training steps, what happens to the learning rate for the embedding of "the" vs the embedding of "platypus"? Which converges more correctly?

Q2. Why does AdaGrad fail for a convolutional network trained on ImageNet for 90 epochs, but RMSProp does not? Describe the mechanism precisely.

Q3. Which two of the following correctly explain why AdaGrad's per-parameter update is only an "approximate" diagonal Newton step, not an exact one?

Try it interactively

ML Systems Lab is a free interview-prep platform for ML engineers — work through the full interactive module, quizzes, and drills.

Open ML Systems Lab →