AdaGrad
AdaGrad (Adaptive Gradient algorithm) is a first-order stochastic optimization method that scales each coordinate's learning rate inversely by the square root of the accumulated sum of squared past gradients. Key result: it achieves regret for convex problems while automatically adapting per-feature step sizes, excelling on sparse data. Applies to convex and non-convex stochastic optimization, prominently in machine learning. Introduced by John Duchi, Elad Hazan, and Yoram Singer in 2011.AdaGrad modifies plain stochastic gradient descent by maintaining a running sum of the squares of all previously observed gradients on a per-coordinate basis, then dividing the global learning rate by the square root of this accumulator. This yields effective learning rates that shrink quickly for frequently-updated (dense) coordinates and stay large for rarely-updated (sparse) coordinates, making it ideal for problems with heavy-tailed feature frequencies such as text and recommendation systems. It matters because it was among the first principled, theoretically grounded adaptive learning-rate methods, with a tight regret bound derived from online convex optimization. The surprising fact: even though AdaGrad uses only first-order information, its per-coordinate preconditioner approximates a diagonal of the Mahalanobis geometry induced by the data, giving it a quasi-second-order flavor at linear cost. Its chief weakness — monotonic decay of the learning rate to zero — directly motivated the successors RMSProp and Adam.
The Core Insight
Treat the cumulative magnitude of each coordinate's gradient history as a measure of how "well-explored" that coordinate is. Coordinates whose gradients have been large and frequent have been learned about a lot, so their step should be damped; coordinates seen rarely deserve aggressive updates. The mechanism is a diagonal preconditioner built purely from accumulated squared gradients — turning a single scalar learning rate into a data-driven, per-parameter, time-varying vector of learning rates.
Formal Statement
AdaGrad Update Rule
Let be the (sub)differentiable loss at step , and a (sub)gradient. AdaGrad maintains an accumulator and updates parameters as follows.
The diagonal accumulator:
The per-coordinate update (diagonal form):
In compact vector notation, with (elementwise):
Symbols: parameters, master learning rate, (sub)gradient, accumulator (= ), numerical stabilizer, elementwise product.
Full-Matrix (Mahalanobis) AdaGrad
The original general form preconditions by the full matrix:
This costs storage and per step (matrix inverse-square-root), so it is rarely used directly for large .
Regret Bound for Diagonal AdaGrad
Let be a closed convex feasible set with diameter , and let each be convex with bounded subgradients. Diagonal AdaGrad (with projection onto ) satisfies, against any fixed :
In the worst case , giving , but when gradients are sparse the data-dependent right side of [5] is dramatically smaller.
Why It Holds / Derivation
Regret Bound via Adaptive Mirror Descent — Sketch
Step 1 (Proximal step in a time-varying norm). Define the Mahalanobis norm with . The AdaGrad update [3] is the proximal stepJohn Duchi, Elad Hazan, Yoram Singer | active 2010s–present
Though all three are computer scientists/applied mathematicians rather than physicists, they are the architects of AdaGrad. Duchi (Stanford) specializes in stochastic optimization and statistical learning; Hazan (Princeton) is a foundational figure in online convex optimization and regret minimization; Singer (then at Google) contributed expertise in large-scale machine learning. Their 2011 JMLR paper "Adaptive Subgradient Methods for Online Learning and Stochastic Optimization" unified online learning regret theory with practical deep-learning optimization, and the adaptive lemma (Step 5 above) is the technical heart of the entire adaptive-method family that includes RMSProp, AdaDelta, and Adam.
Building Intuition
Imagine descending a long, narrow valley whose floor is shaped differently along each axis: one direction is steep and bumpy, another is a shallow, gentle slope explored only rarely. Plain SGD uses the same step size in all directions, so it either overshoots the steep axis or crawls along the shallow one. AdaGrad keeps a "budget meter" per axis recording how much gradient signal has already arrived there. Axes that have received a lot of strong gradient feedback get their step size throttled (we already know a lot about them), while axes touched only occasionally retain large, aggressive steps. The square root is crucial: it makes the per-coordinate effective rate decay like for a coordinate that fires every step — the canonical optimal SGD schedule — but stay near for a coordinate that fires rarely. Geometrically, rescales space so the loss looks locally isotropic, mimicking a Newton-style preconditioner using only first-order data.
Per-coordinate effective learning rate $\eta/\sqrt{s_{t}}$ vs. step $t$ for a frequent (dense) vs. rare (sparse) coordinate
Worked Examples
Single coordinate, repeated gradient
Given: One parameter, , , and constant gradient at every step. Compute starting from . Steps:- : , step . .
- : , step . .
- : , step . .
Notice the step shrinks even though the gradient is constant — the hallmark decay.
Two coordinates: dense vs. sparse
Given: , , two coordinates. Coordinate 1 (dense) gets gradient at every step. Coordinate 2 (sparse) gets gradient at and gradient at . Compute the magnitude of each coordinate's update at . Steps:- Coord 1 at : , update .
- Coord 2 at : , update .
Despite coordinate 2's gradient being three times larger, its first update is not over-damped because its accumulator only just turned on. The dense coordinate is already throttled to .
Common Misconceptions
AdaGrad does not have a single learning rate that you tune to convergence speed alone. The master rate sets the scale, but the effective per-coordinate rate is , which monotonically decreases. A frequent mistake is to expect AdaGrad to keep making progress late in training; because never decreases, the effective rate eventually becomes negligibly small and learning stalls. This is the defining flaw that RMSProp fixes by using an exponential moving average instead of a cumulative sum. is not just a numerical guard — it caps the maximum effective learning rate. Early on, when is tiny, the term would explode without . Setting too small can cause enormous first steps; too large effectively reduces AdaGrad to vanilla SGD with rate . AdaGrad can fail to converge on simple non-stationary or non-convex problems specifically because of accumulator monotonicity. Consider an online problem where the optimal direction reverses after many steps (a shifting target). By the time the shift occurs, has grown large, so the effective learning rate is far too small to track the new optimum — AdaGrad freezes near the stale solution. Plain SGD with a constant rate, by contrast, keeps adapting. This concrete failure motivated AdaDelta (2012) and RMSProp, which forget old gradient information geometrically.Connections
AdaGrad sits at the intersection of Online Convex Optimization and Stochastic Gradient Descent. Its regret analysis is a specialization of Online Mirror Descent with a time-varying, data-adaptive Bregman divergence. The full-matrix form [4] is a first-order approximation to Newton's Method in Optimization, replacing the Hessian with the empirical Fisher-like matrix , linking it to Natural Gradient Descent and the Fisher Information Matrix. Its decay flaw is repaired by exponential averaging in RMSProp and AdaDelta, and combined with momentum it becomes Adam (optimizer). The per-coordinate preconditioner also relates to diagonal Preconditioning (numerical analysis).
Real-World Applications
- Large-scale text classification / NLP — AdaGrad's sparsity advantage shines on bag-of-words and TF-IDF features where most coordinates are zero in any example; rare words get large updates. Used in early Google text systems.
- Recommender systems — User/item embedding tables are extremely sparse per update; AdaGrad adapts per-embedding-coordinate rates, a pattern still seen in sparse embedding optimizers.
- GloVe word embeddings — Pennington, Socher & Manning (2014) explicitly used AdaGrad to train the GloVe co-occurrence factorization, exploiting heavily skewed word-frequency statistics.
- Click-through-rate (CTR) prediction in ad systems — High-dimensional sparse categorical features benefit from per-feature adaptive rates; AdaGrad and its sibling FTRL-Proximal became industry standards.
- Early deep learning training — Before Adam, AdaGrad was a common default for training feedforward and convolutional nets in libraries such as Theano and early TensorFlow.
- Online learning / streaming — Its regret guarantees make it appropriate for one-pass, adversarial-data streaming settings where no fixed schedule can be pre-tuned.
- Structured prediction (CRFs, parsers) — Adaptive per-feature rates help when feature templates fire at wildly different frequencies.
Historical Development
- 2003–2007 — Foundations of online convex optimization and regret minimization laid by Zinkevich (online gradient descent, 2003) and Hazan and collaborators; mirror descent (Nemirovski–Yudin) provides the geometric backbone.
- 2010 (June) — Duchi, Hazan & Singer present the conference version "Adaptive Subgradient Methods for Online Learning and Stochastic Optimization" at COLT.
- 2011 (July) — The expanded journal version appears in the Journal of Machine Learning Research (JMLR), establishing both full-matrix and diagonal AdaGrad with rigorous regret bounds.
- 2011 — McMahan & Streeter independently derive closely related adaptive bounds; their work feeds into FTRL-Proximal.
- 2012 — Zeiler proposes AdaDelta, directly addressing AdaGrad's monotonic-decay flaw via a windowed/EMA accumulator and unit correction.
- 2012 — Tieleman & Hinton introduce RMSProp in a Coursera lecture, replacing the cumulative sum with an exponential moving average — the most enduring fix.
- 2013–2014 — AdaGrad adopted for GloVe embeddings (Pennington et al., 2014) and widely used in industrial sparse-learning pipelines.
- 2014 (December) — Kingma & Ba publish Adam, fusing RMSProp-style second-moment estimation with momentum and bias correction, becoming the dominant successor.
- 2018–2019 — Renewed theoretical scrutiny of adaptive methods (Reddi et al.'s "On the Convergence of Adam"; AMSGrad) re-examines AdaGrad's clean guarantees as a benchmark for non-convergence pathologies in EMA-based variants.
Subtleties & Limits
The cleanest theoretical guarantees for AdaGrad are in the convex regret setting; its behavior in modern non-convex deep learning is far less understood. Open and active questions include: (1) tight non-convex convergence rates for diagonal AdaGrad and whether they match SGD's stationarity bound without restrictive assumptions; (2) the generalization gap — adaptive methods like AdaGrad/Adam sometimes generalize worse than tuned SGD despite faster training (Wilson et al., 2017), and the precise mechanism remains debated; (3) when, theoretically, the full-matrix preconditioner [4] is worth its cost, and whether low-rank or Kronecker-factored approximations (Shampoo, K-FAC) recover most of its benefit; (4) principled, automatic schedules for and that remove the remaining hyperparameters. The monotonic decay of is not merely an engineering nuisance but a fundamental tension between provable regret and adaptivity to non-stationary objectives.