Tatsunori Hashimoto: Why Batch Size Changes Which Optimizers Help

A noisy quadratic explains when momentum pays off; transformer weight norms show why the effective learning rate can drift.

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

30 秒でわかる

An optimizer that helps with large batches may add little when batches are tiny and gradients are dominated by noise. Stanford’s Tatsunori Hashimoto uses a simplified noisy quadratic model to explain that tradeoff and why the benefit of ever-larger batches eventually fades. He then shows how normalization in transformers lets weight norms grow, changing the effective learning rate even when its configured value is fixed. Controlling those norms, he argues, can improve training and make settings easier to transfer between model sizes.

  1. 1Deep learning often needs useful approximate solutions quicklyHashimoto contrasts minimizing statistical error with solving an optimization problem to extremely high precision. Architectures and optimizers can also be designed together.
  2. 2Larger batches eventually hit a learning-rate stability limitIn the noisy quadratic model, larger batches reduce gradient noise and permit larger steps until the curvature imposes a maximum stable rate. Past that point, returns diminish.
  3. 3Momentum helps most once the batch is large enoughThe simplified model predicts that noise limits useful step sizes at small batches, leaving little room for momentum. Hashimoto shows experiments with similar behavior.
  4. 4Preconditioning can amplify noise as well as speed convergenceThe toy model shows that a stronger preconditioner can worsen steady-state error, so its benefits become easier to use at larger batches.
  5. 5Normalization can make each weight update push the norm upwardFor a scale-invariant component, gradients are tangent to a sphere. Each step moves the weights outward, while weight decay pulls them back.
  6. 6Growing weight norms shrink the effective step sizeIn a simple model the angular step scales with the learning rate divided by the squared parameter norm. Uncontrolled norm growth therefore changes training dynamics.
  7. 7Hyperball fixes internal weight norms at their initial scaleThe method normalizes an optimizer update and projects internal weights back to an initialization-derived radius. Hashimoto reports improved loss and easier, though imperfect, hyperparameter transfer.

ポイント

  1. Measure optimizer gains at the batch size you intend to use: momentum and preconditioning may help more once gradient noise is lower.
  2. Expect diminishing returns from larger batches when the learning rate reaches its stability limit.
  3. Track weight norms as well as the configured learning rate; growing norms can make effective updates smaller.
  4. In one-pass language-model training, Hashimoto argues that weight decay chiefly controls the effective learning rate.
  5. Treat a noisy quadratic as a source of testable intuitions, not a complete model of neural-network training.
全文

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

文字起こしのみ
01

Why deep learning optimization has different priorities

Faster optimizers save training compute. Hashimoto introduces learning rates, batches, momentum and preconditioning as interacting design choices.

Optimization is central to machine learning: the optimizer turns data into a trained model by reducing loss. Its behavior affects the computation needed for training and can also influence generalization.

Hashimoto points to improvements from SGD to Adam and then Muon as examples of better computational efficiency. When training a foundation model is compute-limited, even a modest efficiency gain can be valuable.

Much of deep learning uses first-order methods based on gradients. Convex optimization has a rich theory of such methods, yet practice in deep learning often relies on variations of mini-batch stochastic gradient descent.

That does not mean practitioners are unaware of other optimization methods. Neural-network training is a specialized family of problems, and simple, practical variations of SGD can work well for it.

Basic SGD updates the parameters in the direction opposite the gradient. The gradient is noisy because it is estimated from a sampled mini-batch rather than the entire dataset.

The learning rate controls step size and batch size controls how much data contributes to a step. Both interact with model scale and compute; an excessively large learning rate can make training diverge.

Classical optimization typically asks for a maximum stable learning rate and a schedule that converges with stochastic gradients. For a neural network, the useful balance also depends on the compute available and how the model scales.

Preconditioning changes the coordinates in which the optimizer descends. It can rescale individual directions or account for correlations, helping an update move efficiently through a long, narrow valley.

A preconditioner can be estimated as training proceeds by looking at the gradients. In an idealized example, scaling the difficult directions replaces repeated bouncing with a more direct path downhill.

Momentum resembles a heavy ball rolling downhill: updates retain information from previous gradients, accumulating speed when the direction persists. In classical first-order optimization, related acceleration methods can improve convergence rates substantially.

Momentum preserves a history of past gradients, so a run of updates in one direction can accelerate the next step. Hashimoto contrasts the practical heavy-ball method with Nesterov-style acceleration from classical theory.

With high momentum the path can oscillate, an underdamped regime. With enough damping it approaches the minimum more smoothly; distinguishing these cases will help explain when momentum is useful.

The lecture focuses on how batch size interacts with momentum and preconditioning, then on how parameter norms alter the effective learning rate. A simple noisy quadratic provides a tractable starting point.

02

AdamW and the goal of a useful approximate solution

AdamW combines momentum, adaptive scaling and decoupled weight decay. Neural-network optimizers can be specialized alongside the architectures they train.

AdamW augments SGD with a running average of gradients and a second-moment estimate used to scale updates. In a steady-gradient intuition, the magnitude can approximately cancel, leaving behavior similar to stepping according to the gradient’s sign.

The W denotes decoupled weight decay: the decay is applied directly as part of the update instead of being folded into the objective and passed through the momentum machinery.

Hashimoto contrasts neural-network optimization with settings where an extremely exact solution is the objective. Statistical uncertainty places a floor on prediction quality, so getting to a useful solution quickly can matter more than driving optimization error almost to zero.

A deep-learning optimizer need not work equally well on every convex function. Researchers can also change the architecture: residual connections and normalization make networks easier to optimize, while optimizers can exploit those structures.

The original Adam convergence argument had a proof flaw, but Hashimoto does not consider universal convex convergence the practical priority in language-model training. The aim was an optimizer that works for deep neural networks.

Hashimoto illustrates Adam’s failure cases with a cycle near a minimum. In his sign-SGD analogy, an update that does not shrink with gradient magnitude can keep oscillating instead of settling exactly at the bottom.

Architectures and optimizers co-evolve. Once a model has properties such as scale-invariant parameters or structure in its curvature, an optimizer can use those properties to accelerate training.

Mathematics is sometimes useful, but choosing the right model requires empirical judgment. Rather than looking only at individual updates, Hashimoto suggests examining how entire loss curves respond when a setting changes.

03

A noisy quadratic predicts a critical batch size

A simplified model separates curvature and gradient noise by coordinate. As batches grow, noise falls until the learning rate meets a stability limit.

The first case study takes a quadratic loss, adds noise and analyzes ordinary SGD on it. The second asks why parameter norms grow and how that behavior can motivate a different optimization method.

A quadratic is simple enough that many optimization quantities can be calculated. The goal is not to solve the toy problem with a specialized optimal algorithm, but to see which intuitions about ordinary SGD transfer to neural networks.

The simplified model is intentionally handicapped: although a theorist could use a specialized algorithm to solve the quadratic more exactly, the lecture studies plain SGD because the resulting predictions can inform practical rules of thumb.

In a small-batch regime, gradient noise dominates and increasing the batch can support an approximately proportional increase in learning rate. The noisy quadratic also reproduces the diminishing returns associated with a critical batch size.

The model rotates the quadratic into its principal coordinates and assumes that the noise covariance shares those directions. Under that simplifying assumption, each coordinate can be analyzed independently.

Geometrically, both the curvature and the Gaussian noise have principal axes. Assuming those axes align allows the same rotation to diagonalize both, a simplifying assumption that makes the dynamics separable.

A batch averages independent examples, dividing the noise variance by the batch size. We can then compare plain SGD and momentum on the same noisy objective.

With fixed batch size and step size, the noisy updates settle into a distribution around the minimum instead of landing on it exactly. Changing the rate or batch trades the speed of approach against the remaining steady-state loss.

Steady-state noise and convergence rate pull in opposite directions when the batch and rate are fixed. More sophisticated schedules can change this balance, but the model first studies these coarse controls.

Increasing the batch reduces noise, which initially allows a larger learning rate and fewer steps to a target. But even without noise, the quadratic has a maximum stable rate determined by its steepest curvature.

Once that stability limit is reached, still larger batches offer strongly diminishing returns: noise may fall a little further, but the optimizer can no longer gain speed by simply increasing the rate.

04

When momentum speeds convergence

Momentum behaves differently in overdamped and oscillating regimes. The model predicts little benefit at very small batch sizes and greater gains at larger ones.

Momentum keeps an accumulated state rather than stepping directly on the latest gradient. That state accumulates noise as well, and the analysis again balances convergence speed against steady-state error.

In the overdamped regime, motion approaches the minimum smoothly; in the underdamped regime it oscillates around it. With several coordinates sharing a momentum setting, the slowest direction constrains convergence.

Far into the overdamped regime, momentum can resemble ordinary SGD with a rescaled effective learning rate. Near the boundary between regimes it can improve convergence, while excessive oscillation wastes steps.

The animation’s lesson is not that momentum always speeds a run. Deep in the overdamped regime, its trajectory can overlap with SGD after a learning-rate rescaling; excessive underdamping instead introduces oscillation.

The equivalence has a limit: ordinary SGD cannot increase its learning rate beyond the stability boundary. Momentum can sometimes provide a larger effective step without crossing the same boundary.

Asked whether the full phase diagram should be expected to match language models, Hashimoto is cautious. He says some concrete predictions match well, but would be less confident that every detail transfers.

The maximum stable SGD step on this quadratic is two divided by its steepest curvature. Pushing beyond that makes the trajectory diverge, which is why raising the SGD rate cannot always substitute for momentum.

When every direction is underdamped, reducing momentum can improve them until one reaches the boundary. Giving each direction a different setting would move toward preconditioning, but the toy analysis deliberately restricts the algorithm.

A student suggests a separate momentum coefficient for each coordinate. Hashimoto says that knowing and exploiting each direction’s curvature would amount to a form of preconditioning, beyond the deliberately simple algorithm being analyzed.

With a small batch, noise forces a small learning rate to keep the residual error down, leaving little room for momentum to help. With a larger batch, lower noise allows larger effective steps and momentum can become more valuable.

Experiments from the noisy-quadratic work show SGD and momentum behaving similarly at small batch sizes, then separating as batches grow. A CIFAR-10 example shows a similar pattern.

Hashimoto cites later transformer experiments where SGD at batch size one was competitive with more elaborate optimizers. In one comparison, it approximately matched a GPT-3-style AdamW training curve.

He does not recommend batch size one as a routine systems choice: small batches can generalize well in some data-limited settings, but large batches are much easier to parallelize across accelerators.

05

Preconditioning trades convergence speed against noise

Rescaling directions can speed descent while also amplifying noise. The lecture explains why its gains can grow with batch size.

Preconditioning supplies another test. Hashimoto models a family of preconditioners using powers of the quadratic curvature; the inverse curvature is the idealized noiseless choice.

Making a narrow direction easier to traverse can also amplify noise in that direction. Stronger preconditioning improves convergence in the toy model while worsening the steady-state term, creating another tradeoff.

The tradeoff resembles the earlier momentum example: at small batch sizes the noise-driven steady-state term dominates, while larger batches can make stronger preconditioning useful.

At small batch sizes the noise penalty limits how strongly one can precondition. With larger batches, lower noise makes it easier to benefit, and the displayed experiments again show the optimizers separating as batches increase.

The general picture is that batch size controls noise, noise influences residual error, and methods trade that error against convergence speed. The model has also been used to incorporate batch size into scaling predictions.

06

Where the quadratic intuition breaks

Neural networks can show oscillatory convergence that the simple model does not capture. Learning-rate schedules offer one way to balance early speed with later noise.

The quadratic is not a complete account of deep learning. Hashimoto shows a full-batch example with strong oscillations and fast convergence, behavior that the simple quadratic without momentum would not predict.

A student asks whether extra artificial noise could help increase usable batch size. Within this model, Hashimoto says added noise worsens the residual term without moving the curvature-based stability limit.

Another student notes that the learning rate can be lowered near the end. Hashimoto agrees: a schedule can favor faster progress early and reduce steady-state error later, an intuition that also appears in classical optimization theory.

07

Normalization makes weight norms drift

Scale-invariant layers can receive updates tangent to a sphere, pushing weights outward. Weight decay counteracts that growth.

The lecture turns to parameter norms. In the earlier quiz, weights tended to grow without weight decay; Hashimoto asks why and why the growth matters for optimization.

Transformers use normalization in many places. For a normalized component, multiplying certain weights by a scalar can leave the output and loss nearly unchanged, making that component approximately scale invariant.

If loss is scale invariant, gradients lie tangent to a sphere around the origin. A finite step along that tangent moves the weights outside the sphere, increasing their norm; weight decay pulls in the opposite direction.

In the geometric picture, the outward drift from tangential steps and the inward pull from weight decay balance at an equilibrium norm. This gives a mechanical explanation for the norm curves students saw in the quiz.

In a toy example, runs with different initial norms but the same weight decay approach a common equilibrium. Without decay, the norm keeps growing; the equilibrium depends on both learning rate and decay.

A transformer is not completely scale invariant: its output layer is one exception. But the normalized components can exhibit the predicted norm growth, with decay counteracting it.

08

Norm growth changes the effective learning rate

The configured rate is not the whole story when weight norms change. Scheduling weight decay is one way to control the resulting equilibrium.

Even if the loss is insensitive to weight magnitude, the optimization steps are not. In a simple analysis, the effective angular step is proportional to the learning rate divided by the squared parameter norm.

Thus growing norms make effective updates smaller and can undermine control over a carefully tuned learning rate. The rate configured in code is not necessarily the rate governing movement through model space.

With a changing learning-rate schedule, the desired equilibrium itself moves. The actual norm can lag behind it, so the effective trajectory differs from the nominal schedule.

A changing nominal learning rate changes the target equilibrium too. Hashimoto notes that adjusting decay dynamically is one possible response, which motivates the next example.

A student asks which parts of a transformer are actually scale invariant. Hashimoto points to normalized residual streams and query and key vectors, while the output head remains sensitive to scale because it affects confidence.

One response is to make weight decay vary over time. Hashimoto describes AdamC, which relates decay to the learning-rate schedule to control the gradient-to-weight relationship and keep the equilibrium more stable.

This connection between learning rate, regularization and parameter norm has a history. In one-pass language-model training, work he cites found that a run without weight decay could imitate a decay run when the effective learning-rate trajectory was matched.

In the cited one-pass experiment, researchers recorded the effective learning rates implied by a weight-decay run, then copied those rates into a run with no decay. The resulting curves aligned, supporting the proposed control mechanism.

09

Hyperball constrains internal weights

The method fixes selected weight norms at their initial scale and can wrap existing optimizers. Hashimoto describes results on training loss and hyperparameter transfer.

If the norm controls effective movement, another possibility is to project weights back to a fixed norm after each update. Hashimoto credits Roger Grosse with raising that possibility and introduces Hyperball as a practical version.

Not every component should be constrained: the output head encodes confidence, normalization gains control scale, and embeddings can encode information in their magnitude. The method instead targets internal weights such as attention and MLP matrices.

Hyperball starts with an update from a base optimizer such as AdamW, normalizes the update direction and takes a step. It then projects the selected weights back to a radius usually set by the initial matrix norm.

Related work has separated weight direction from magnitude or imposed other geometric constraints. Hashimoto presents the method as part of a broader set of approaches to controlling training geometry.

In the results he shows, Hyperball versions of Muon and Adam achieve better losses at scale, while the constrained weights remain at their initialization norm. A change in the learning-rate schedule explains a later drop in the displayed curve.

Hashimoto notes that the weight norm remains exactly at its initial value under Hyperball because the method enforces that as a constraint. He treats the small differences in loss as potentially meaningful given the variation studied in the earlier assignment.

Controlling norms can also make hyperparameters transfer more easily across model sizes. Hashimoto cautions that transfer is not perfect and one setting will not work forever, but says the method can be more forgiving.

He describes related independent work that replicated several core results while using a somewhat different method. The examples illustrate how observations about model dynamics can inform optimizers and, in turn, architecture choices.

For one-pass training, Hashimoto argues that weight decay is primarily controlling the effective learning rate rather than model complexity. In some cases, tuning decay can therefore have an effect similar to tuning the learning rate.

The lecture combines simple theory with empirical observation. The challenge is choosing a model that captures the phenomenon that matters: what looks like an incidental norm drift can turn out to affect how an optimizer behaves.

同じチャンネルの記事

スライド 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
30:50EN
Stanford Online· 2026年11月25日Suhas Kotha: Measure Training Noise Before Trusting a Model ImprovementSuhas Kotha · Stanford UniversityIn a Stanford quiz review, small-model experiments show how random seeds, batch size and learning-rate schedules affect results.モデルと学習Pretraining & midtrainingExperimentation+2
1:17:43EN
Stanford Online· 2026年11月24日Tune the baseline before trusting a deep-learning resultTatsunori Hashimoto · Stanford UniversityTatsunori Hashimoto explains how hyperparameters, scaling, randomness and matched controls shape reliable experiments.Machine LearningScaling LawsDeep Learning+2
1:08:38EN
Stanford Online· 2026年11月24日Stanford’s deep-learning course teaches students to predict experimentsTatsunori Hashimoto, Suhas Kotha · Stanford UniversityA small language model and repeated quizzes test intuition; one demonstration shows why a component can look broken until its learning rate is tuned.Deep LearningPretraining & midtrainingNeural Networks
スライド 3 枚1:24:37EN
Stanford Online· 2026年11月24日Agents need practice environments as well as web textJohn Yang · Stanford UniversityJohn Yang explains how to collect trajectories and tasks, verify results and avoid training on shortcuts.AI agentsエージェント工学Data quality & curation+2