Hyperparameter Tuning, Scaling Laws & Debugging | Stanford CS312 Lecture 2 with Tatsunori Hashimoto

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

Why do so many claimed wins in deep learning disappear once you tune the baseline? In this Stanford CS312: Deep Learning Alchemy lecture, Assistant Professor Tatsunori Hashimoto covers four basic experimental skills: hyperparameters, scaling laws, stochasticity, and debugging. He shows how untuned learning rates produced false results, how Step Law sweeps link learning rate and batch size, why scaling laws are engineered and can break at the largest run, why training behaves like a chaotic system, and how to debug a network by comparing it to a known good control.

Key questions answered in this lecture:
Q: What is the most important hyperparameter to tune in deep learning?
A: Hashimoto says if you can only tune one thing, tune the learning rate; there is no theoretical reason, but it is the most sensitive. Others like Adam momentum usually matter little, and model size or step count are usually held fixed to keep compute constant.

Q: Do new optimizers like Lion or MARS beat AdamW?
A: Many claimed wins come from poorly tuned AdamW baselines. Retuning the learning rate makes AdamW match MARS, and with optimally tuned weight decay, AdamW beats Lion.

Q: How do optimal learning rate and batch size change with model size and data?
A: In the StepFun Step Law sweeps, loss is roughly quadratic in log learning rate and batch size, and the two are correlated. Both optima shift with scale, so in the worst case you must retune for every model, which is why small-scale tuning and transfer matter.

Q: Why do scaling laws sometimes fail to predict large training runs?
A: Hashimoto says scaling laws are engineered through a lot of pain: a fit that looks perfect can blow up at the largest run, as in Marin, and choices like hyperparameter scaling and how you count parameters or FLOPs (part of the Kaplan vs. Chinchilla disagreement) shift the fits.

Q: Where does randomness in neural network training come from?
A: Data order, initialization, and augmentation each produce about the same final variance, and turning all on barely adds more. Even tiny perturbations amplify like a chaotic system, so training is effectively stochastic even when deterministic.

Q: How do I debug a neural network that will not train?
A: Know what normal looks like, track internal statistics like activations, gradients, and attention logits against a known good control, and understand invariances such as layer norm. Change one thing at a time and interpolate between the working model and the broken one.

Chapters:
0:00 Deep learning as an experimental science
5:30 What is a hyperparameter?
8:38 Untuned hyperparameters: three case studies
14:46 Why hyperparameter search is tractable
16:37 Step Law: learning rate and batch size
22:56 Batching hyperparameter runs with vmap
25:50 Scaling down: model organisms and ladders
30:36 History of scaling laws to Kaplan and Chinchilla
35:11 When scaling laws break: Marin and DeepSeek
40:27 Sources of randomness in training
44:00 Training as chaos and Edge of Stability
49:58 Run-to-run variance and paired tests
55:18 Debugging: loss curves and LR schedules
1:03:03 Activations, gradients, QK-norm, Marin debug

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:
- Step Law: https://arxiv.org/abs/2503.04715
- Kaplan et al. (2020), Scaling Laws for Neural Language Models: https://arxiv.org/abs/2001.08361
- Summers & Dinneen (2021), Nondeterminism and Instability in Neural Network Optimization: https://arxiv.org/abs/2103.04514

Course website: https://deep-learning-alchemy.github.io/

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

#DeepLearning #ScalingLaws #Hyperparameters 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 Hyperparameter Tuning, Scaling Laws & Debugging | Stanford CS312 Lecture 2 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.