Stanford Online

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

Published 2026-11-26 · Duration 1:18:42

Summary

This lecture explores the complex dynamics of deep learning optimization, moving beyond classical convex optimization theory. It introduces the Noisy Quadratic Model (NQM) to provide intuitive insights into the trade-offs between batch size, learning rate, and steady-state loss. A major focus is placed on the phenomenon of parameter norm growth in scale-invariant architectures (like Transformers), which forces effective step sizes to shrink. The session concludes by detailing Hyperball, an algorithmic approach that projects weights onto a fixed-radius sphere to stabilize training and improve hyperparameter transfer.

Download summary

Key takeaways

  1. Critical Batch Size and Diminishing Returns 18:51

    The NQM predicts that increasing batch size improves training efficiency only up to a critical point. Beyond this point, the learning rate hits a stability limit (2/h, where h is the narrowest curvature), and additional batches yield strongly diminishing returns.

  2. Norm Growth and Effective Step Size 40:58

    In scale-invariant systems (e.g., those using Layer Norm), the loss is independent of the parameter norm. This causes gradients to lie tangent to the sphere, leading to norm growth. This growth, in turn, reduces the effective step size, limiting the control over the learning rate.

  3. Weight Decay Controls Effective Learning Rate 34:53

    In the one-pass setting, weight decay does not primarily control model complexity; instead, it controls the effective learning rate of the optimization process. This allows weight decay to be used as a mechanism to maintain tight control over the system's scale.

  4. Hyperball for Stability 1:04:30

    Hyperball is an optimization trick that projects both the gradients and the parameters back onto a fixed-radius sphere (defined by the initialization norm). This hard constraint stabilizes training and improves hyperparameter transfer across different model sizes.

More digests on Deep Learning

Technical details

  • Noisy Quadratic Model (NQM) 1666s

    The NQM is a simplified toy model where the quadratic loss is diagonalized, and the noise covariance is assumed to be axis-aligned with the quadratic. This allows for coordinate-by-coordinate analysis of SGD and momentum dynamics, revealing trade-offs between convergence rate and steady-state loss.

  • Momentum Regimes 2830s

    Momentum SGD operates in two regimes: overdamped (smooth, similar to gradient descent) and underdamped (oscillatory). The NQM suggests that the rate-limiting step is often the overdamped regime, and gains from momentum are most pronounced when the SGD learning rate is constrained by a stability limit.

  • AdamW Mechanics 1490s

    AdamW incorporates a momentum term (M_T, tracking exponentially decaying averages of gradients) and a preconditioning term (V_T, tracking squared gradients). The 'W' (weight decay) is implemented as decoupled weight decay, meaning it is added directly to the update rather than being filtered through the momentum machinery.

  • Preconditioning and Tradeoffs 2180s

    Preconditioning (using a matrix P, ideally the inverse Hessian) strictly improves the convergence rate. However, in the noisy case, stronger preconditioning (larger P) tends to worsen the steady-state error, illustrating a fundamental trade-off between convergence speed and final loss.

Mentioned resources

Channel & topics

Watch on YouTube · Back to latest

This independent, AI-assisted summary is provided for commentary and informational purposes. It may contain errors or omit important context. Please watch the original video for the creator's complete presentation. Video, thumbnail, and related copyrights belong to their respective owners.