# Gradient descent, first-order, stochastic

a.k.a. SGD, as seen in deep learning

January 30, 2020 — May 19, 2023

Stochastic optimization, uses noisy (possibly approximate) 1st-order gradient information to find the argument which minimises

\[ x^*=\operatorname{arg min}_{\mathbf{x}} f(x) \]

for some an objective function \(f:\mathbb{R}^n\to\mathbb{R}\).

That this works with little fuss in very high dimensions is a major pillar of deep learning.

## 1 Basic

The original version, in terms of root finding, is (Herbert Robbins and Monro 1951) who later generalised analysis in (H. Robbins and Siegmund 1971), using martingale arguments to analyze convergence. There is some historical context in (Lai 2003) which puts it all in context. That article was written before the current craze for SGD in deep learning; after 2013 or so the problem is rather that there is so much information on the method that the challenge becomes sifting out the AI hype from the useful.

I recommend Francis Bach’s Sum of geometric series trick as an introduction to showing things advanced things about SGD using elementary tools.

Francesco Orabana on how to prove SGD converges:

to balance the universe of first-order methods, I decided to show how to easily prove the convergence of the iterates in SGD, even in unbounded domains.

## 2 Gradient flows

Gradient flows are a continuous-limit SDE modelling stochastic gradient. See gradient flows.

## 3 Variance-reduced

🏗

Zeyuan Allen-Zhu : Faster Than SGD 1: Variance Reduction:

SGD is well-known for large-scale optimization. In my mind, there are two (and only two) fundamental improvements since the original introduction of SGD: (1) variance reduction, and (2) acceleration. In this post I’d love to conduct a survey regarding (1),

## 4 Stochastic momentum

## 5 Polyak averaging

## 6 Normalized

Zhiyuan Li and Sanjeev Arora argue:

You may remember our previous blog post showing that it is possible to do state-of-the-art deep learning with learning rate that increases exponentially during training. It was meant to be a dramatic illustration that what we learned in optimization classes and books isn’t always a good fit for modern deep learning, specifically,

normalized nets, which is our term for nets that use any one of popular normalization schemes,e.g. BatchNorm (BN), GroupNorm (GN), WeightNorm (WN). Today’s post (based upon our paper with Kaifeng Lyu at NeurIPS20) identifies other surprising incompatibilities between normalized nets and traditional analyses.

## 7 In MCMC

See SGMCMC.

## 8 Sundry Hacks

…

Yellowfin an automatic SGD momentum tuner

Mini-batch and stochastic methods for minimising loss when you have a lot of data, or a lot of parameters, and using it all at once is silly, or when you want to iteratively improve your solution as data comes in, and you have access to a gradient for your loss, ideally automatically calculated. It’s not clear at all that it should work, except by collating all your data and optimising offline, except that much of modern machine learning shows that it does.

Sometimes this apparently stupid trick it might even be fast for small-dimensional cases, so you may as well try.

Technically, “online” optimisation in bandit/RL problems might imply that you have to “minimise regret online”, which has a slightly different meaning and, e.g. involves seeing each training only as it arrives along some notional arrow of time, yet wishing to make the “best” decision at the next time, and possibly choosing your next experiment in order to trade-off exploration versus exploitation etc.

In SGD you can see your data as often as you want and in whatever order, but you only look at a bit at a time. Usually the data is given and predictions make no difference to what information is available to you.

Some of the same technology pops up in each of these notions of online optimisation, but I am mostly thinking about SGD here.

There are many more permutations and variations used in practice.

## 9 Incoming

## 10 References

*Proceedings of the 29th International Coference on International Conference on Machine Learning*. ICML’12.

*Proceedings of the 39th International Conference on Machine Learning*.

*Advances in Neural Information Processing Systems (NIPS)*.

*arXiv:1306.2119 [Cs, Math, Stat]*.

*Séminaire de Probabilités de Strasbourg*. Lecture Notes in Math.

*arXiv:2006.05604 [Cs, Math, Stat]*.

*Electronic Journal of Statistics*.

*Proceedings of Neuro-Nîmes 91*.

*Online Learning and Neural Networks*.

*Proceedings of the 19th International Conference on Computational Statistics (COMPSTAT’2010)*.

*Advances in Neural Information Processing Systems*.

*arXiv:1606.04838 [Cs, Math, Stat]*.

*Advances in Neural Information Processing Systems 16*.

*Convex Optimization: Algorithms and Complexity*. Foundations and Trends in Machine Learning.

*IEEE Signal Processing Magazine*.

*Mathematical Programming*.

*Proceedings of the 31st International Conference on Machine Learning*.

*arXiv:2012.00152 [Cs, Stat]*.

*Journal of Machine Learning Research*.

*Proceedings of the National Academy of Sciences*.

*SIAM Journal on Scientific Computing*.

*SIAM Journal on Optimization*.

*arXiv:1310.3787 [Math]*.

*Distill*.

*Advances in Neural Information Processing Systems 28*.

*Stochastic Processes and Their Applications*.

*Advances in Neural Information Processing Systems*.

*IEEE Transactions on Signal Processing*.

*Proceeding of ICLR*.

*The Annals of Statistics*.

*arXiv:1710.07406 [Cs, Math, Stat]*.

*arXiv:1602.04915 [Cs, Math, Stat]*.

*Advances In Neural Information Processing Systems*.

*Stochastic Approximation and Optimization of Random Systems*.

*arXiv:1703.10622 [Cs, Stat]*.

*Proceedings of the 19th International Conference on Artificial Intelligence and Statistics*.

*Advances in Neural Information Processing Systems*.

*JMLR*.

*Proceedings of the 19th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining*. KDD ’13.

*arXiv:1605.09774 [Cs, Math, Stat]*.

*arXiv:2102.00931 [Cs, Stat]*.

*arXiv:1705.07261 [Cs, Math, Stat]*.

*arXiv:1702.00317 [Cs, Math, Stat]*.

*SIAM Journal on Control and Optimization*.

*PMLR*.

*The Annals of Mathematical Statistics*.

*Optimizing Methods in Statistics*.

*arXiv:1609.04747 [Cs]*.

*arXiv:1412.6615 [Cs, Stat]*.

*Advances in Neural Information Processing Systems 29*.

*Journal of Machine Learning Research*.

*CoRR*.

*IEEE Transactions on Automatic Control*.

*ACM Transactions on Knowledge Discovery from Data*.

*Proceedings of the 23rd International Conference on Machine Learning*.

*Proceedings of the 28th International Conference on International Conference on Machine Learning*. ICML’11.

*Optimization for Data Analysis*.

*arXiv:1107.2490 [Cs]*.

*arXiv:1701.00481 [Stat]*.

*Advances in Neural Information Processing Systems 23*.