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

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

🎙 Tatsunori Hashimoto (Stanford University) — Stanford Online channel 👥 1.4M 📅 November 26, 2026 ⏱ 78 min 👁 79 📄 science communication 🧭 2026-11-26
Available in: English (current) Français

Keywords

noisy quadratic modelcritical batch sizemomentumweight decaylayer normHyperball

Summary

The lecture opens by situating optimization as the operational core of machine learning: it is the optimizer, not the architecture alone, that drives the loss down, and successive generations (SGD, Adam, Muon) have each delivered major compute savings at the scale of foundation-model training. Hashimoto then sketches the anatomy of a first-order optimizer — learning rate, batch size, preconditioner, momentum — and insists that mini-batch SGD, which looks poor under convex convergence-rate analysis, is nonetheless the template from which most practical deep-learning optimizers descend. He contrasts the deep-learning setting with classical convex optimization on three points: machine learning tolerates loose or noisy solutions very quickly rather than driving epsilon to zero; an irreducible statistical error floor exists, so reaching the statistically indistinguishable regime fast matters more than reaching first-order stationarity; and optimizers are co-designed with architectures, since residual connections and layer norms exist precisely to make the landscape easy for first-order methods. He notes that Adam’s original convergence proof contained an error, and treats this as a difference in priorities rather than a practical problem, since large language models are never trained to first-order stationarity. He then recaps the AdamW machinery — exponential gradient averaging, second-moment preconditioning that tends toward sign-SGD behaviour, and decoupled weight decay added directly to the update rather than flowing through the objective’s gradient. The second half introduces the noisy quadratic model: a diagonalized quadratic loss with gradient noise whose covariance aligns with the curvature, so each coordinate can be analysed in isolation and batching simply divides the noise variance by the batch size. This toy model yields closed-form steady-state loss, predicts a critical batch size beyond which extra batch gives strongly diminishing returns because the learning rate cannot exceed the stability limit of twice the inverse largest curvature, and predicts that momentum helps mainly at large batch sizes. The lecturer reports that experiments agree, with SGD at batch size 1 roughly matching the AdamW curve for GPT-3-style training. The final block turns to parameter norms: layer norm makes the loss nearly scale invariant, gradients lie tangent to the sphere, norms therefore grow until weight decay balances them, and since the effective step size scales as learning rate over norm squared, uncontrolled norm growth costs control of the learning rate. In one-pass pretraining, weight decay is argued to act mainly as a control on the effective learning rate, which motivates AdamC (tying weight decay to the learning-rate schedule) and Hyperball (normalize the base update, step, then project weights back onto a ball of radius equal to the initial Frobenius norm, leaving embeddings, norm gains and the output head unprojected).

433 words

Critical Evaluation

Value of the Information & Strength of the Argument

The informational value is high and unusually well targeted: rather than surveying optimizers, the lecture isolates a small number of high-leverage questions — why larger batches stop helping, whether momentum pays off at small batch, why weight norms grow in transformers, what weight decay actually does during one-pass pretraining — and answers each with an explicit mechanism. The argumentation is built as a controlled chain of reasoning. A deliberately simplified formal object, the diagonalized quadratic with curvature-aligned gradient noise, is introduced with its assumptions stated aloud, used to derive closed-form steady-state loss and the critical-batch-size prediction, and then explicitly bounded in a dedicated segment on the limits of the quadratic mental model. This is the strongest feature of the argument: the model is not presented as truth but as an instrument whose failure modes are announced in advance, including the case where momentum does not oscillate in the low-momentum regime. The adversarial treatment of the classical literature is also productive — the lecturer explicitly says the convex-optimization corpus is being set aside, justifies it by the existence of an irreducible statistical error floor and by architecture-optimizer co-design, and concedes that the mathematics remains intermittently useful without telling you in advance which part. The weakest link is evidential rather than logical: several decisive empirical statements (SGD at batch size 1 matching AdamW for GPT-3-style training, Hyperball variants being consistently better at scale and giving easier hyperparameter transfer) are asserted, and in the available transcript they are not accompanied by the curves, scales or error bars that would let a listener weigh them. The reasoning is didactic and sequenced, with concepts introduced before they are used, and it maintains a productive tension between what the toy model predicts and what practice shows rather than collapsing one into the other.

Scientific Rigor, Source Quality, Title Accuracy

On scientific rigor, the lecture is careful about the epistemic status of what it presents. The noisy quadratic model is framed from the outset as a toy model whose purpose is tractability, and a later section is devoted to its limits; the claim that momentum pays off mainly at large batch size is presented as a prediction of the model that experiment corroborates, which is the correct order of presentation for a hypothesis-driven claim. The discussion of Adam’s convergence-proof bug is handled with notable honesty and nuance, including a live exchange acknowledging that choosing hyperparameters after fixing the problem class differs from the reverse, and the lecturer explicitly declines to make it a scandal, reframing it as a difference in priorities. On sources, the supporting material named in the course description is directly matched to the technical content: Zhang et al. (2019) for algorithmic choices across batch sizes, a dedicated technical blog post for the weight-decay argument, and the Hyperball paper for the final optimizer. The playlist and course site provide the coherent didactic context. The one structural reserve is self-referentiality: the closing block on weight decay, AdamC and Hyperball rests substantially on the lecturer’s own research programme, and the transcript excerpt supplied does not contain the experimental protocol that would let a reader independently assess ‘consistently better at scale’. A second, purely evidential reserve is that the supplied transcript is truncated — it ends as the noisy quadratic model is being introduced — so the assessment of the later sections rests on the chapter structure and the course abstract rather than on the full spoken argument. On title/content fit, the announcement is honest: the three named topics are precisely the ones actually developed, with the Hyperball projection as the announced synthesis, and the framing as a numbered course lecture is the only loose element.

617 words

Title / Content Match

The title accurately announces the three advertised blocks — noisy quadratic model, momentum, weight decay — which are exactly the ones developed, with Hyperball as a natural extension. The only mismatch is the generic 'Lecture 3' framing, since the lecture itself opens with a broad comparative overview of first-order optimizers before narrowing to those topics.

Quality & Reliability

8/10

A graduate-level university lecture delivered by a specialist of the field (Stanford assistant professor, language modelling and robustness), whose content is anchored in published work (Zhang et al. 2019 on batch-size algorithmic choices, a dedicated weight-decay blog post, and the Hyperball paper). The reasoning is transparent: it states its assumptions, uses an explicitly acknowledged toy model (the noisy quadratic model), and carefully separates what that model predicts from its limits. Reserve: part of the material presented (Hyperball, AdamC) is the lecturer's own line of work, so it is presented in a programme-defending register rather than in a genuinely adversarial review, and several empirical claims are described rather than demonstrated with numbers in the transcript.

Chapters

Cited Sources

Concurring Sources

Dissenting Sources

  • Reddi, Kale & Kumar, On the Convergence of Adam and Beyond — Supplies the formal counterexample showing Adam can fail to converge on convex problems. This does not contradict the lecture's practical claims but sharpens a tension the lecturer resolves by priority rather than by proof: the argument that first-order stationarity is irrelevant for language-model pretraining is a pragmatic position, not a theoretical refutation.

Contribution & Novelties

The lecture’s originality lies in using an explicitly simplified formal object as a decision-making instrument rather than as a result: the noisy quadratic model predicts, before any experiment is run, that momentum should buy little at small batch sizes and that batch scaling must saturate at a critical value set by the stability limit on the learning rate — predictions the lecture then confronts with practice. The second contribution is the re-reading of weight decay in one-pass pretraining: because layer norm makes the loss nearly scale-invariant, gradients lie tangent to the sphere, weight norms drift outward, and the effective step size varies as learning rate over squared norm, so weight decay becomes chiefly a control on the effective learning rate rather than on model complexity. This reframing directly motivates learning-rate-scheduled decay (AdamC) and the Hyperball projection, which is presented as the extreme case of co-designing optimizer and architecture: exploit a known structural invariance of transformers and project the update onto a sphere of radius fixed at initialization, sparing embeddings, norm gains and the output head. The unifying thread is methodological — understand the macroscopic training dynamics first, then read the microscopic update mechanics backwards from there.

Pour aller plus loin :

  • An Empirical Model of Large-Batch Training — Independent derivation and empirical fit of the critical batch size, the natural companion to the steady-state-loss analysis presented here.
  • Decoupled Weight Decay Regularization — Formal basis of the AdamW update recapped in the lecture, and the point of departure for the effective-learning-rate reading of weight decay.
  • Layer Normalization — The architectural property whose near scale-invariance underpins the whole norm-growth and Hyperball argument.
  • Muon optimizer — cited in the lecture as the most recent step beyond Adam and as a base update for the Hyperball projection; best consulted through the course materials rather than a guessed address.
  • Frobenius-norm trust region / norm-constrained optimization — the classical mathematical notion underlying the projection step; worth reading in the standard convex-optimization literature.

326 words

Radar Profile

The profile is that of a dense advanced lecture: very high technical level and information quantity, with information quality close behind because assumptions, model limits and theoretical caveats are stated rather than glossed over. Reliability sits slightly below quality, reflecting the self-referential character of the closing block and the assertion, rather than demonstration, of the large-scale empirical results. The overall picture is a strongly asymmetric, research-grade profile rather than an accessible overview.

Reliability 8/10