# AdaGrad (2010)

> Gives every weight its own learning rate, shrinking with the gradients it has already seen, so rare but informative features still learn quickly.

Page: https://mralbu.github.io/ai-datasets/p/adagrad

## Key facts

- Title: Adaptive Subgradient Methods for Online Learning and Stochastic Optimization
- Authors: John Duchi, Elad Hazan, Yoram Singer
- Venue: JMLR 2011 (COLT 2010)
- Category: Foundations
- Paper: https://jmlr.org/papers/v12/duchi11a.html

## Why it matters

AdaGrad came with regret guarantees as good as the best fixed preconditioner chosen in hindsight, and made learning rates much less fiddly to set. Its steps only shrink, which stalls long training runs, so RMSProp and Adam replaced the sum with a moving average; Shampoo later revived the full-matrix version in a form that fits neural networks.

## The idea

Keep, for every weight, the sum of its squared gradients so far, and divide its step by the square root of that sum. Weights that get large or frequent gradients take small steps; weights that are rarely touched, like the weights of rare features, keep taking large ones. The full version uses the whole matrix of gradient outer products as a preconditioner; the diagonal version, which only needs one number per weight, is the one people use.

## The result

The adaptive versions beat their non-adaptive counterparts on every task tried: on 15,000 ImageNet image-ranking tasks, average precision rose from 0.504 to 0.602 while using 73% of the input features, and on kernelized MNIST test error fell from 10.8% to 6.6%. It also had lower error on Reuters news classification and census income prediction.

## The data

- [ImageNet (ILSVRC) (2009)](https://mralbu.github.io/ai-datasets/d/imagenet.md): 1.28 million photos across 1,000 classes, the dataset behind the deep learning boom.
- [MNIST (1998)](https://mralbu.github.io/ai-datasets/d/mnist.md): 70,000 handwritten digits, 28×28 grayscale, 10 classes.
- Also tested on: Reuters RCV1 news classification and the UCI census income data.

## Led to

- [Adam (2014)](https://mralbu.github.io/ai-datasets/p/adam.md)
- [Shampoo (2018)](https://mralbu.github.io/ai-datasets/p/shampoo.md)

## Part of

- [Optimizers](https://mralbu.github.io/ai-datasets/t/optimizers.md) (step 1 of 7)
