Why momentum matters more at large batch sizes

A Stanford optimization quiz shows why batch size changes momentum’s value and how learning rate and weight decay interact.

THTatsunori Hashimoto登壇者 · Stanford University
チャンネル
Stanford Online
公開日
2026年11月28日
動画
20:46
読了時間
5 分
原文
英語
YouTube で開く
スクロールすると動画は右下に小さくなって再生を続けます。字幕は閲覧言語に合わせて切り替わります。
閲覧言語2 言語で読めます
この記事はまだ日本語に翻訳されていないため、英語の原文を表示しています。
要約

30 秒でわかる

Removing momentum raised loss by about 0.25 at batch size 256, but only 0.02 at batch size eight in one course experiment. Stanford’s Tatsunori Hashimoto also shows a useful approximation: loss rises roughly with the square of the logarithmic error in the learning-rate–weight-decay product. For larger batches, his example favors increasing weight decay rather than continuing to raise the learning rate.

  1. 1Shared blocks change the scaling that worksCopied blocks contribute in alignment, so CompleteP’s inverse-depth scaling produces the lowest loss after five steps in this test.
  2. 2The product of learning rate and weight decay predicts lossLow-loss settings follow a diagonal; deviations yield a roughly quadratic penalty on a log scale.
  3. 3Removing momentum hurts the larger batch far moreLoss rises about 0.02 at batch size eight and about 0.25 at batch size 256.
  4. 4Hyperball’s width scaling falls between the two baselinesIts update normalization suggests an inverse-square-root width factor; seeded fits yielded exponents near −0.38 to −0.55.
  5. 5Scaling weight decay beats raising the learning rate indefinitelyThe optimal learning rate bends as batch size rises, while optimal weight decay continues increasing in the example.

ポイント

  1. At batch size 256, removing momentum carried a much larger loss penalty than at batch size eight in the experiment.
  2. Track the product of learning rate and weight decay when exploring settings.
  3. As batch size increases, the best learning rate can level off while the best weight decay continues to rise.
  4. With shared blocks, aligned contributions make inverse-depth scaling a better fit than a square-root correction in this example.
全文

チャプターごとに整えた全文を読む

文字起こしのみ
01

Shared parameters alter depth scaling

Hashimoto contrasts independent blocks with perfectly aligned shared blocks. CompleteP gives the lowest loss in the aligned experiment.

Many of the answers in this optimization quiz can be reasoned out from the experiments in the assignment. The first question changes a model with a thousand different blocks into one with a thousand copies sharing parameters; the quantity to predict is a ratio, not just the raw root mean square (RMS).

In our internal play test, varying depth showed that depth µP kept the residual RMS fairly stable, while ordinary µP grew without control. The same qualitative pattern appeared after five updates. That might suggest depth µP always beats CompleteP, but the quiz asks about a ratio.

Multipliers applied to contributions entering the residual stream largely cancel when you compare those contributions before and after an update. CompleteP starts with a much smaller multiplier, however, so the embeddings entering at the bottom are relatively larger. This constant offset changes the ratio.

For the loss after five steps, think about whether blocks are aligned. At initialization independent weights are random and their combined effect scales roughly with the square root of depth; depth µP corrects for that scaling.

With copied modules, the contributions are perfectly correlated and amplify linearly. CompleteP corrects this aligned case with inverse-depth scaling, and it gives the lowest loss in this experiment. The difference between means depends on the comparison; one is around 0.06.

02

Learning rate and weight decay act together

The low-loss diagonal reflects a near-constant product. A log-squared approximation estimates the loss penalty away from it.

The next question replaces linear decay with a cosine learning-rate schedule that falls to zero. When we sweep learning rates and weight decay, a heat map shows a diagonal of low loss: the product of learning rate and weight decay is an important quantity to track.

On this grid, B and A have very low loss, F and E are similar, and D and C are higher. That ordering follows from the same relationship seen in the assignment rather than requiring a new trick.

How much does loss increase away from the best setting? In the plot, departures from the low-loss diagonal look roughly quadratic. A rule of thumb is to take the logarithm of how far the learning-rate–weight-decay product is from its best value, square it and multiply by roughly 0.01.

That approximation predicts the quiz answer surprisingly closely in this case. It is a rough estimate, but it lets you reason about the order of magnitude of a mistuned product rather than guessing a loss value.

03

Extrapolation and the cost of removing momentum

Hyperball’s plotted trend can be extended in the exercise. Momentum is far more consequential for the larger batch.

The third question asks students to extrapolate a trend from their assignment. Hyperball’s trend is mostly linear on the plot, while AdamW can behave less regularly far outside the observed range. Extending the Hyperball line gives an answer around 0.008.

Next is a sweep over momentum at two batch sizes. At the small batch size, the loss is relatively insensitive to momentum; the optimum is close to 0.99. At batch size 256, the curve has a much more pronounced minimum.

At the larger batch size, choosing the momentum value near the bottom of that curve matters more. Both cases worsen when momentum is removed, but the small-batch curve is much flatter.

In this experiment, removing momentum costs roughly 0.02 in loss at batch size eight and around 0.25 at batch size 256. I would call the larger penalty catastrophic; the sharply rising validation loss should have made the direction clear.

04

Transferring learning rates across widths

Almost µP stays close to a width-independent learning rate. Hyperball’s normalization produces an intermediate scaling.

Question five concerns “almost µP,” a near variant of a parameterization designed to make learning rates transfer across model widths. Consider the role of the output readout and compare the optimal learning rates for widths 1,024 and 512.

In the assignment, the optimal peak learning rate is approximately flat across width for µP, whereas the baseline falls roughly inversely with width. Almost µP is in between but closer to µP because the readout is a small contribution relative to the rest of the network.

The ratio of the two optimal rates is therefore close to one, rather than the roughly one-half expected closer to the baseline. Being one answer bin away is understandable when the direction is supported by an experiment; some options are closely spaced.

The follow-up asks what happens when the smaller model’s peak learning rate is transferred rather than retuned. µP’s direct transfer works nearly as well as retuning, so almost µP should also have a small penalty. The actual run has a small additional gap because the chosen setting was not exactly optimal.

For Hyperball, sweep model width and find the best peak learning rate under the standard parameterization. Recall the comparison: the baseline rate falls approximately as one over width, while µP’s remains roughly constant.

Hyperball normalizes a matrix update and scales it to the Frobenius norm of the weights. This effectively contributes a step-size factor of about one over the square root of width. Since baseline Adam needs roughly one over width, the remaining learning-rate scaling should be near one over square root width.

The observed seeded runs give exponents around −0.38 to −0.55, broadly consistent with that reasoning. The result lies between the baseline and µP cases; thinking of Hyperball as stabilizing the scaling could also lead to the right range.

Transferring the sampled best rate with Hyperball has a somewhat larger loss penalty than the almost-µP example, but less than the Adam case of 0.12. Here it lands in the 0.02–0.08 range. I found the numerical prediction harder without knowing the scale of these penalties.

05

Choosing settings for a large batch

The best peak learning rate stops rising linearly. Scaling weight decay is the stronger choice in the quiz example.

The final question uses a comparatively large batch of 512, leaving fewer updates, and asks which adjustment to choose. The optimal peak learning rate rises with batch size but bends rather than growing indefinitely, as the noisy quadratic model also suggests.

Optimal weight decay, by contrast, can keep rising as batch size grows. In this experiment scaling weight decay is preferable to simply scaling the learning rate. Keeping the original hyperparameters at the much larger batch gives a substantially worse loss.

You can estimate the penalty from how far the learning-rate–weight-decay product is from its optimum. If it is eight times off, take the base-two logarithm, square it and multiply by roughly 0.01. In this quiz that surprisingly robust rule lands in the same interval as the measured result.

同じチャンネルの記事

スライド 7 枚1:20:02EN
Stanford Online· 2026年11月28日John Yang: How to tell whether an AI judge is reliableJohn Yang · Stanford UniversityModel judges can grade open-ended work, but their own biases and consistency need testing against people.評価(Evals)AI agentsAI research
1:08:53EN
Stanford Online· 2026年11月27日How µP and Muon keep neural-network training stable as models widenTatsunori Hashimoto · Stanford UniversityStanford’s Tatsunori Hashimoto explains why scaling rules enable learning-rate transfer and how Muon boosts weak update directions.モデルと学習AI research
1:10:50EN
Stanford Online· 2026年11月27日Andrew Ng: Build Agents Fast, Then Learn From Their FailuresAndrew Ng, Diyi Yang, Fred · DeepLearning.AINg favors early prototypes and later rigorous evaluation; Diyi Yang challenges how much generated code can safely go unreviewed.エージェント工学評価(Evals)AI in Education+2
1:18:42EN
Stanford Online· 2026年11月26日Tatsunori Hashimoto: Why Batch Size Changes Which Optimizers HelpTatsunori Hashimoto · Stanford UniversityA noisy quadratic explains when momentum pays off; transformer weight norms show why the effective learning rate can drift.モデルと学習Pretraining & midtrainingNeural Networks+2
スライド 9 枚1:21:11EN
Stanford Online· 2026年11月26日John Yang: An Agent Benchmark Must Measure More Than a ScoreJohn Yang · Stanford UniversityThe task, harness and evaluation rules all change the result; harder tests also need to stay realistic and reproducible.評価(Evals)エージェント工学Benchmarks+2
スライド 6 枚1:14:57EN
Stanford Online· 2026年11月25日John Yang: Better Agent Training Starts With Choosing the Right DataJohn Yang · Stanford UniversityFilter tasks for reliable tests and useful difficulty; even successful agent runs can contain mistakes worth excluding.Data quality & curationエージェント工学Reinforcement Learning+2