Optimizer History Around Attention and AdamW
August 24, 2023

Attention changed model architecture, and optimizer design made that architecture trainable at scale. The history runs from momentum SGD in LeNet and ImageNet through RMSProp, Adam, decoupled weight decay, and the 2017 arrival of Transformers and AdamW.

Brian Greenforest restores optimization to the center of the Transformer story.

Architecture and Optimization Co-Evolve

Momentum smooths stochastic gradients and carries useful direction across minibatches. Adaptive methods scale updates by running estimates of first and second moments, helping large models navigate parameters with very different gradient statistics.

AdamW separates weight decay from the adaptive gradient update. Learning-rate schedules, warmup, normalization, initialization, and batching then interact with the optimizer to determine whether training converges.

Read the Training Recipe as Part of the Invention

GPT-1 followed the Transformer one year later and used Adam-family optimization inside a complete recipe. Model diagrams alone cannot explain that result.

Researchers and educators can document optimizer, schedule, precision, regularization, and data order with the same care as attention. Those choices carry the history of how large models actually learned.

Run Optimizer History Around Attention and AdamW in a Four-Layer Transformer

The complete training run connects this mathematical argument to executable code, data flow, and a working small model.

Four-Layer Tiny Transformer Training Run · https://lnkd.in/gjHJtFHw · https://www.reddit.com/r/MachineLearning/comments/l6t97z/d_nextgen_optimizer/

Originally posted on LinkedIn

Brian Greenforest · (2023-08-24 20:25:30 UTC)

Open the original LinkedIn post · LinkedIn activity 7100573860130955265

LinkedIn status when archived: Visible to anyone on or off LinkedIn.

Pay attention: LeNet from 1989 used SGD with momentum, and so ImageNet of 2012. All you needed for old school was Averaged SGD with momentum. 1 million other optimizers to distract you from the fact that Attention Transformer and AdamW were both invented in 2017, and used immediately in GPT-1 a year after (sic!), just to officially release weights in 2019, and (finally, hehe), officially publish RMSProp and AdamW. https://lnkd.in/gjHJtFHw

Original LinkedIn media

Comments added by Brian Greenforest on LinkedIn

These 2 comments were also preserved verbatim from Brian Greenforest’s LinkedIn data export or the public post page. The image attached to one of these comments is localized below.

https://github.com/Ascend/mindspore/blob/f02867e3b899b064010e467a17b2ac179c079848/mindspore/python/mindspore/nn/optim/momentum.py#L67C15-L67C61

View the LinkedIn post