Noisy Quadratic Model, Momentum & Weight Decay | Stanford CS312 Lecture 3 with Tatsunori Hashimoto

Browse Stanford's online courses in deep learning: https://stanford.io/4zhLWFN

Why does mini-batch SGD, a weak algorithm by convex optimization standards, work so well for deep learning? In this Stanford CS312: Deep Learning Alchemy lecture, Assistant Professor Tatsunori Hashimoto breaks down the anatomy of an optimizer: learning rate, batch size, preconditioning, momentum, and AdamW. He uses the noisy quadratic model to explain critical batch size and when momentum pays off, then turns to norms and weight decay, showing how layer norm makes weight norms grow and why weight decay mainly controls the effective learning rate. He closes with Hyperball, which projects weights onto a fixed-radius sphere.

Key questions answered in this lecture:
Q: What is the noisy quadratic model in deep learning optimization?
A: A diagonalized quadratic loss with gradient noise whose covariance is aligned with the curvature, so each coordinate can be analyzed separately and batching divides the noise variance by the batch size. Hashimoto uses it to analyze plain SGD, momentum and preconditioning, trading convergence rate against steady-state loss.

Q: Why does increasing batch size stop speeding up training?
A: Larger batches reduce noise and allow bigger learning rates, but the learning rate cannot exceed the stability limit of 2 over the largest curvature. Past that point, extra batches give strongly diminishing returns, which is the critical batch size.

Q: Does momentum help SGD at small batch sizes?
A: The NQM predicts momentum adds little at small batch sizes, where noise forces small learning rates, and helps mainly at large batch sizes. Experiments agree, and SGD at batch size 1 roughly matched the AdamW training curve for GPT-3 style training.

Q: Why do weight norms grow in transformers and why does it matter?
A: Layer norms make the loss nearly scale invariant, so gradients lie tangent to the sphere and each step pushes the norm outward until weight decay balances it. Bigger norms shrink the effective step size (learning rate over norm squared), so you lose control of your learning rate.

Q: What does weight decay do in LLM pretraining?
A: In one-pass training, Hashimoto argues weight decay mainly controls the effective learning rate, not model complexity, and tuning it can act like tuning the learning rate. AdamC makes weight decay scale with the learning rate schedule to keep the norm equilibrium constant.

Q: What is the Hyperball optimizer?
A: Take a base update such as AdamW or Muon, normalize it, step, then project the weights back onto a ball whose radius is the Frobenius norm at initialization, leaving embeddings, norm gains and the output head unprojected. AdamH and MuonH were consistently better at scale and gave easier hyperparameter transfer.

Chapters:
0:00 Why optimization matters in deep learning
3:09 Anatomy of SGD: LR, batch, preconditioning
8:06 Momentum: heavy ball and Nesterov
11:12 AdamW recap and decoupled weight decay
13:39 Deep learning vs convex optimizers
22:03 The noisy quadratic model (NQM)
27:32 Steady-state loss and critical batch size
30:40 Momentum: overdamped vs underdamped
41:33 Momentum helps only at large batch sizes
45:41 Preconditioning tradeoffs in the NQM
49:43 Limits of the quadratic mental model
55:00 Why parameter norms grow: layer norm
59:28 Norm growth and effective learning rate
1:08:42 Hyperball: projecting weights to a sphere

About the speaker:
Tatsunori Hashimoto is an Assistant Professor of Computer Science at Stanford University and a faculty affiliate of the Stanford Institute for Human-Centered Artificial Intelligence (HAI). His research uses tools from statistics to make machine learning systems more robust and reliable, especially for language. He also teaches CS336: Language Modeling from Scratch. He was a postdoc at Stanford with John Duchi and Percy Liang, earned his PhD at MIT, and studied statistics and math at Harvard.

Readings:
- Zhang et al. (2019), Which Algorithmic Choices Matter at Which Batch Sizes?: https://arxiv.org/abs/1907.04164
- Weight decay blog: https://whenwen.github.io/wd_blog/public/weight-decay-part-2.html
- Hyperball: https://arxiv.org/abs/2606.16899

Course website: https://deep-learning-alchemy.github.io/
Watch the full CS312 playlist: https://www.youtube.com/playlist?list=PLXRTcAYPI4AU

Recorded October 1, 2026, in CS312: Deep Learning Alchemy, a Stanford University course taught by Tatsunori Hashimoto and Suhas Kotha.

#DeepLearning #Optimization #MachineLearning Receive SMS online on sms24.me

TubeReader video aggregator is a website that collects and organizes online videos from the YouTube source. Video aggregation is done for different purposes, and TubeReader take different approaches to achieve their purpose.

Our try to collect videos of high quality or interest for visitors to view; the collection may be made by editors or may be based on community votes.

Another method is to base the collection on those videos most viewed, either at the aggregator site or at various popular video hosting sites.

TubeReader site exists to allow users to collect their own sets of videos, for personal use as well as for browsing and viewing by others; TubeReader can develop online communities around video sharing.

Our site allow users to create a personalized video playlist, for personal use as well as for browsing and viewing by others.

@YouTubeReaderBot allows you to subscribe to Youtube channels.

By using @YouTubeReaderBot Bot you agree with YouTube Terms of Service.

Use the @YouTubeReaderBot telegram bot to be the first to be notified when new videos are released on your favorite channels.

Look for new videos or channels and share them with your friends.

You can start using our bot from this video, subscribe now to Noisy Quadratic Model, Momentum & Weight Decay | Stanford CS312 Lecture 3 with Tatsunori Hashimoto

What is YouTube?

YouTube is a free video sharing website that makes it easy to watch online videos. You can even create and upload your own videos to share with others. Originally created in 2005, YouTube is now one of the most popular sites on the Web, with visitors watching around 6 billion hours of video every month.