Stanford Online
Optimal learning rates saturate as batch sizes grow while optimal weight decay increases monotonically, making weight decay scaling essential to avoid optimization failure in large-batch training.
AI-assisted summary of µP, Momentum & Weight Decay Predictions | Stanford CS312 Quiz Review with Tatsunori Hashimoto — original source. Check the original for full context.
Source published:
Key ideas
- For deep networks with shared parameter blocks, CompleteP outperforms depth µP by providing explicit 1/L scaling, which properly counters the coherent linear amplification of perfectly correlated layers. (3:31)
- Validation loss penalties when deviating from the optimal learning rate × weight decay ridge follow a reliable quadratic rule of thumb: squaring the log discrepancy and multiplying by roughly 0.01 accurately predicts degradation across multiple quiz settings. (6:08)
- Momentum tuning sensitivity diverges sharply across batch regimes: stripping momentum causes a negligible 0.02 loss increase at batch size 8, but results in a catastrophic 0.25 loss spike at batch size 256. (9:25)
- When scaling to large batch sizes, practitioners should scale weight decay rather than learning rate, because optimal peak learning rates plateau as predicted by the Noisy Quadratic Model while optimal weight decay continues to climb. (17:12)
Detailed notes
## Background Published on YouTube by Stanford Online on November 28, 2026, this video features Assistant Professor Tatsunori Hashimoto reviewing held-out optimization experiments from Stanford's CS312: Deep Learning Alchemy course. The session covers empirical and theoretical trade-offs in deep learning optimization, including depth µP versus CompleteP, the interaction of learning rate and weight decay under cosine schedules, momentum behavior across batch sizes, and hyperparameter scaling strategies for large-batch training.
## TL;DR In this quiz walkthrough, Tatsunori Hashimoto demonstrates how complex empirical optimization behaviors can be deduced from first principles rather than memorization. He explains why shared parameter blocks favor CompleteP's linear scaling over depth µP's square-root adjustment, and introduces a robust log-quadratic rule of thumb (scaled by 0.01) for estimating loss penalties when deviating from the optimal learning rate and weight decay product. Hashimoto also details how momentum is expendable at small batch sizes but critical at large batch sizes, analyzes how Hyperball's Frobenius normalization yields an intermediate width scaling exponent of roughly -0.5, and shows why large-batch regimes demand scaling weight decay instead of saturating the learning rate. The review wraps up with practical administrative updates on upcoming tutorials and extra credit workflows.
## Atmosphere & style The session carries the relaxed, cerebral atmosphere of an advanced graduate seminar where empirical deep learning 'alchemy' is demystified through statistical intuition and mental arithmetic. Hashimoto speaks candidly and conversationally, chuckling at the unexpected precision of simple heuristics while transparently sharing his own playtesting observations. It feels methodical yet engagingly analytical, giving listeners an insider's look at how seasoned researchers reason through noisy optimization surfaces without resorting to brute-force trial and error.
## Bulletin - [03:31](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=211s) For deep networks with shared parameter blocks, CompleteP outperforms depth µP by providing explicit 1/L scaling, which properly counters the coherent linear amplification of perfectly correlated layers. - [06:08](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=368s) Validation loss penalties when deviating from the optimal learning rate × weight decay ridge follow a reliable quadratic rule of thumb: squaring the log discrepancy and multiplying by roughly 0.01 accurately predicts degradation across multiple quiz settings. - [09:25](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=565s) Momentum tuning sensitivity diverges sharply across batch regimes: stripping momentum causes a negligible 0.02 loss increase at batch size 8, but results in a catastrophic 0.25 loss spike at batch size 256. - [17:12](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=1032s) When scaling to large batch sizes, practitioners should scale weight decay rather than learning rate, because optimal peak learning rates plateau as predicted by the Noisy Quadratic Model while optimal weight decay continues to climb.
## Key takeaways - [00:05](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=5s) Depth µP is engineered to cancel O(sqrt(L)) growth from independent, random layers, but fails to prevent representation explosion when blocks share identical parameters. - [03:31](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=211s) CompleteP achieves lower 5-step validation loss under parameter sharing because its 1/L scaling correctly matches the linear amplification of correlated weights. - [05:04](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=304s) The primary axis dictating optimization quality across learning rate and weight decay sweeps is their product (LR × WD), forming a constant valley along the diagonal. - [06:08](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=368s) An empirical rule of thumb predicts off-diagonal loss penalties as approximately 0.01 times the squared log deviation from the optimal LR × WD product. - [07:53](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=473s) Hyperball scaling curves remain remarkably linear compared to AdamW, allowing direct linear extrapolation to accurately predict target values across wider compute budgets. - [09:25](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=565s) At small batch sizes (B=8), the loss profile across momentum parameters is very flat, incurring only an approximate 0.02 penalty if momentum is removed entirely. - [09:25](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=565s) At large batch sizes (B=256), momentum exhibits a sharp cup profile where removing momentum causes an outright catastrophic loss spike of approximately 0.25. - [11:15](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=675s) In 'Almost µP', leaving the readout layer unscaled has minimal impact on width scaling because the readout accounts for a tiny fraction of parameters compared to the rest of the deep network. - [11:15](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=675s) Direct learning rate transfer across widths under Almost µP behaves very close to true µP, maintaining an optimal learning rate ratio near 1.0 with minimal transfer penalties. - [14:26](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=866s) Hyperball normalizes update matrices by the weight's Frobenius norm (~sqrt(m)), inherently applying an implicit 1/sqrt(m) step scaling that shifts its optimal learning rate scaling exponent to roughly -0.5. - [17:12](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=1032s) As batch size scales up, optimal peak learning rates bend and saturate as predicted by the Noisy Quadratic Model, making continuous learning rate increases destabilizing. - [17:12](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=1032s) Optimal weight decay does not saturate with expanding batch sizes, making weight decay scaling the optimal strategy for maintaining stable update dynamics at large batch sizes. - [18:42](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=1122s) The quadratic log-deviation rule of thumb accurately estimates the ~0.09 loss degradation incurred when scaling batch size without updating the original hyperparameters.
## Detailed walkthrough ### [00:05](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=5s) Reasoning Through the Quiz and Question 1: Shared Parameter Blocks in Depth µP vs. CompleteP
Tatsunori Hashimoto kicks off the solutions session by acknowledging that while this quiz may have felt slightly more advanced than the first one, it possesses an appealing theoretical coherence. As Hashimoto observes: “In some ways I think this quiz is a pretty interesting one because you can reason through quite a few of the answers.” Rather than relying purely on memorization, many problems can be deduced from first principles. To explain the solutions, he draws from data generated by an internal, autonomous playtest of the assignment that ran without knowledge of the quiz questions.
The opening question examines depth parameterization: the assignment explored a depth µP architecture with 1,000 distinct blocks, and this problem asks what happens when those 1,000 blocks are instead shared parameter blocks. Hashimoto emphasizes that the question does not just look at the raw root-mean-square (RMS) values, but specifically at the ratio of RMS before and after updates. In standard sweeps, depth µP maintains stable residual RMS values across varying depths, while standard µP experiences uncontrolled growth. This might initially give students the impression that depth µP is universally superior to CompleteP.
When calculating the RMS ratios, however, standard parameterization and depth µP land on option two, while CompleteP resolves to option one, yielding a significantly smaller ratio. Hashimoto explains the intuition: these depth parameterizations multiply the residual stream contributions by scaling factors based on depth powers ($R$). When taking the ratio of pre-update to post-update values, contributions added along the residual stream scale proportionally and cancel out to a constant factor. However, CompleteP initializes with a much smaller residual multiplier, suppressing the module updates from the start. Consequently, the input embeddings entering at the base of the network heavily dominate the residual stream. This large constant offset breaks the linear decay pattern, causing CompleteP to produce a much smaller ratio.
```mermaid flowchart TD accTitle: Depth Scaling Parameterization with Shared Blocks accDescr: Diagram contrasting how residual contributions accumulate in Depth µP versus CompleteP under parameter sharing.
subgraph S1["Depth µP Formulation"] D1["Independent / Random Weights"] --> D2["Incoherent Summation"] D2 --> D3["RMS scales as O(sqrt(L))"] D3 --> D4["Requires 1/sqrt(L) scaling"] end
subgraph S2["CompleteP Formulation"] C1["Shared Parameter Blocks"] --> C2["Perfect Module Correlation"] C2 --> C3["Coherent Linear Summation: O(L)"] C3 --> C4["Requires 1/L scaling"] end ```
[03:31](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=211s) Question 1b: Alignment, Weight Correlation, and Five-Step Validation Loss
Moving to the second part of Question 1, Hashimoto turns to the model performance after five training steps: which parameterization achieves the lowest validation loss? He argues that this question is even easier to deduce than the ratio problem because it boils down directly to alignment. At initial random initialization with independent layers, module outputs add incoherently, leading to square root scaling ($\sqrt{L}$). Depth µP is explicitly engineered to cancel that square root growth.
When blocks share identical parameters, however, the statistical independence assumption completely collapses. As Hashimoto explains: “If you have perfect correlation, everything is going to sort of amplify linearly, and so you really want the one over R scaling.” Because CompleteP enforces this exact $1/L$ ($1/R$) scaling factor, it prevents the shared representations from exploding down the transformer backbone. In the empirical playtest runs, CompleteP significantly outperforms both depth µP and the baseline parameterization, achieving the lowest fitted validation loss after five steps. When a student asks from the audience about whether the means differ significantly, Hashimoto clarifies that the difference between the conditions is around 0.06, which sits comfortably clear of the 0.05 margin.
[05:04](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=304s) Question 2a: Cosine Decay and the Learning Rate × Weight Decay Diagonal
Question 2 shifts focus to optimization schedules, asking what happens when linear learning rate decay is swapped out for a cosine decay to zero across a grid sweep of learning rates (LR) and weight decays (WD). Hashimoto points back to Assignment 2, where students plotted loss surfaces and heatmaps over this two-dimensional hyperparameter space.
Those empirical sweeps revealed that the primary axis governing optimization quality is the product of learning rate and weight decay ($\text{LR} \times \text{WD}$). On a log-scale heatmap, the lowest loss values carve out a valley along the main diagonal where this product remains constant. Moving perpendicularly away from that ridge causes loss to degrade sharply. Hashimoto notes that there is no trick to this question: “Basically, if you just read off the exact same relationship as what you had in the assignment, you would have gotten the question right.” Configurations B and A land in the sweet spot of lowest loss, configurations F and E sit at intermediate values, and configurations D and C reside out on the high-loss wings. Only one of the provided multiple-choice rankings matches this block structure.
[06:08](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=368s) Question 2b: The Quadratic Penalty Rule of Thumb for Off-Diagonal Deviation
Part B asks for a concrete numerical prediction: given configuration C—which is suboptimal and displaced from the diagonal—how much does its validation loss increase above the optimal baseline loss of 2.83? Hashimoto acknowledges that without inspecting plots from the assignment, students might feel forced to guess blindly, but a clean quantitative relationship exists.
Along the $x = y$ line where $\text{LR} \times \text{WD}$ is preserved, the model remains stable. When deviating from that ridge, the loss penalty behaves approximately quadratically with respect to the log discrepancy, scaled by an empirical constant of roughly 0.01:
$$\Delta \text{Loss} \approx 0.01 \times \left(\log \frac{\text{LR} \times \text{WD}}{(\text{LR} \times \text{WD})^*}\right)^2$$
Squaring the log deviation and scaling by this factor lands precisely on option four. Hashimoto chuckles at the accuracy of the heuristic: “I'm actually kind of surprised by how close that ends up being, but that is basically kind of the rule of thumb.” Students who had identified the order of magnitude of that quadratic penalty could calculate the expected degradation and identify the correct option immediately.
- **Optimal Baseline Loss:** 2.83 along the constant $\text{LR} \times \text{WD}$ ridge. - **Off-Diagonal Penalty Scaling Factor:** Approximately 0.01 multiplied by the squared log-ratio difference. - **Configuration Ordering:** Lowest loss at {B, A}, intermediate loss at {F, E}, and highest loss at {D, C}.
[07:53](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=473s) Question 3: Extrapolating Hyperball Scaling Trends
Question 3 was intentionally designed as an accessible extrapolation problem. As Hashimoto describes it: “Question three is literally something like if you extrapolated this line out, you would get the right answer.” The problem tests whether students can follow scaling trends as models are pushed toward larger compute or width budgets.
Hashimoto notes that in Assignment 2, extending scaling curves revealed an interesting optimizer contrast: AdamW can exhibit erratic, non-linear scaling behaviors once pushed far out into extreme regimes, whereas the Hyperball optimizer remains remarkably linear across broad ranges. By simply carrying the linear trendline out to the evaluated point without overthinking or attempting complicated corrections, students arrive at a value of approximately 0.008. This value falls squarely into the bucket for option two, leaving no ambiguity among the multiple-choice choices.
[09:00](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=540s) Question 4: Setting Up the Momentum Sweep Across Batch Sizes
Hashimoto introduces Question 4, which inspects how momentum tuning interacts with batch size by evaluating sweeps at a small batch size of 8 versus a large batch size of 256. Like the previous problems, this question directly stems from core visualizations built during the homework assignments. Hashimoto pauses as he pulls up the momentum comparison plots to inspect whether students recognized how drastically the optimizer's dependence on momentum shifts when moving between stochastic, sample-constrained regimes and aggregate gradient updates.
[09:25](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=565s) Momentum Sweeps: Batch Size 8 vs. Batch Size 256
Tatsunori Hashimoto reviews the quiz questions covering momentum tuning across different batch sizes, tying them back directly to the empirical plots students generated in their course assignments. At a small batch size of 8, optimization performance is remarkably insensitive to the choice of momentum parameter ($\beta_1$). Looking at the curve, the loss is fairly flat, though the actual optimum shifts further to the right toward higher values, landing quite close to 0.99. In stark contrast, when scaling up to a large batch size of 256, the behavior changes drastically: the curve exhibits sharp upward bends on both sides, creating a pronounced, characteristic bowl or "cup" where choice of momentum matters immensely. In both batch regimes, setting $\beta_1$ poorly is penalized, but the large-batch setting is far more unforgiving.
```mermaid flowchart TD accTitle: Impact of Momentum Across Batch Regimes accDescr: Diagram contrasting how momentum affects loss at batch size 8 versus batch size 256.
subgraph SmallBatch["Small Batch Size (8)"] A["Flat, insensitive curve"] --> B["Optimum shifts right (~0.99)"] B --> C["Removing momentum: ~0.02 loss penalty"] end
subgraph LargeBatch["Large Batch Size (256)"] D["Sharp characteristic cup"] --> E["Narrow optimal bowl"] E --> F["Removing momentum: ~0.25 loss penalty"] end ```
The difference becomes undeniable when evaluating the exact penalty incurred by stripping away momentum entirely. Mentally revisiting the curves, setting momentum to zero produces almost no penalty for the small-batch run because the curve is so flat, incurring a negligible loss increase of approximately 0.02. In the high-batch regime, however, dropping momentum leads to what Hashimoto emphasizes as an outright disaster. Looking at how validation loss shoots upward, students should have easily spotted the failure mode: “The small batch case is around 0.02 and the large batch case is 0.25. This is a truly catastrophic you know number.”
- Small batch size ($B=8$): Very flat loss profile across $\beta_1$; optimum is close to $0.99$; loss penalty for removing momentum is only $\approx 0.02$. - Large batch size ($B=256$): Severe cup-shaped curvature; loss penalty for removing momentum spikes to $\approx 0.25$. - Hashimoto notes that while missing the exact value on the small-batch penalty by one bin is completely understandable, the large-batch degradation is unmistakably degenerate.
---
[11:15](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=675s) Question 5: "Almost µP" and Learning Rate Transfer
Turning to Question 5, Hashimoto addresses "Almost µP," explaining that the entire exercise hinges on understanding the role of the readout layer and its specific impact on network stability and behavior. The first sub-problem asks for the ratio of the optimal learning rate when scaling a model's width from 512 to 1024. In the reference plots from the assignment comparing baseline parameterization to Maximal Update Parameterization (µP), the baseline peak learning rate decays with model width along a line of slope roughly $-1$ (scaling as $1/\text{width}$), whereas the µP curve stays completely flat across widths (scaling as $\text{width}^0$).
```mermaid flowchart LR accTitle: Learning Rate Scaling with Width Across Parameterizations accDescr: Spectrum of learning rate scaling with width comparing baseline, Almost muP, and muP.
Base["Baseline (Adam) LR ~ 1/width Slope = -1"] --- Mid["Almost µP Readout omitted Ratio ≈ 1"] --- MuP["µP LR ~ width^0 Slope = 0 (Flat)"] ```
Because "Almost µP" applies µP everywhere except for the readout layer, its behavior naturally falls somewhere between the two extremes. However, the readout matrix makes up only a tiny fraction of the overall parameter count and contribution relative to the rest of the deep network: “In this case, you know, the readout is actually a very small contribution relative to the rest of the the network, and it turns out to be much closer to µP. I mean, we did call it almost µP than, you know, the course baseline.” Consequently, the width-scaling ratio between width 1024 and width 512 remains very close to 1 rather than halving to $1/2$ as standard parameterization would. Hashimoto assures students that missing by a single bin is not a concern, as the goal is simply to separate the first-order mechanisms from noise.
The follow-up question (Part B) asks for the performance penalty when directly transferring the peak learning rate from a smaller model to a larger model without retuning. In true µP, direct learning rate transfer works out of the box with zero penalty, matching the performance of a freshly tuned run. Because Almost µP behaves nearly identically to full µP, the transfer penalty is minimal. The only reason the penalty is not identically zero is that transferring the small-model minimizer introduces a slight suboptimality gap compared to re-optimizing on the large model, placing the loss penalty into the narrow option 3 bin rather than option 4.
- Standard baseline Adam scaling: Optimal learning rate scales inversely with width ($\propto 1/\text{width}$, slope $\approx -1$ on log-log plots; ratio for doubling width is $\approx 0.5$). - µP scaling: Optimal learning rate remains constant across widths ($\propto \text{width}^0$, slope $\approx 0$; ratio is $\approx 1.0$). - Almost µP behavior: Because the uncorrected readout layer is dwarfed by the rest of the architecture, the optimal learning rate ratio remains close to $1.0$, and the transfer penalty is minimal.
---
[14:26](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=866s) Question 6: Hyperball Learning Rate Scaling with Width
Hashimoto transitions to Question 6, which inspects the Hyperball optimizer under standard parameterization across a width sweep to track how its optimal peak learning rate behaves. By contrasting standard baseline Adam (decaying as $1/m$, where $m$ is width) and µP (which remains constant at $m^0$), one can reason through Hyperball’s mechanics analytically. In these networks, feature alignment sits around 0.75, placing the dynamics closer to the fully aligned µP regime than to an unaligned $1/\sqrt{m}$ regime.
Hyperball operates by taking a parameter update matrix, normalizing it, and rescaling it by the Frobenius norm of the weight matrix $\|W\|_F$. Since the Frobenius norm of an initialized weight matrix scales roughly with the square root of width, this normalization implicitly applies a step size scaling factor of roughly $1/\sqrt{m}$. Hashimoto walks through the mental algebra: standard Adam requires a step size scale of $1/m$; if Hyperball inherently provides a $1/\sqrt{m}$ scaling via weight normalization, the remaining optimal learning rate only needs to supply the difference, which is roughly another factor of $1/\sqrt{m}$ (an exponent of $-0.5$). Across experimental seeds, the empirical exponents land between $-0.38$ and $-0.55$, fitting comfortably inside the target quiz bracket of $[-0.75, -0.25]$.
| Parameterization / Optimizer | Implicit Step Scaling | Optimal LR Scaling Exponent | |:--- |:--- |:--- | | **Baseline Adam** | None | $-1.0$ (scales as $1/m$) | | **Hyperball (Standard Param)** | Rescaled by $\|W\|_F \sim \sqrt{m}$ | $\approx -0.5$ (bracket: $[-0.75, -0.25]$) | | **Maximal Update Param (µP)** | Explicit $1/m$ tensor scalings | $0.0$ (flat / constant) |
In Part B, the quiz asks for the transfer penalty when applying the best sampled learning rate across widths under Hyperball. Because Hyperball does not achieve perfect scale invariance like µP, it suffers a higher transfer penalty than µP, but it still performs considerably better than standard Adam's substantial penalty of 0.12. The actual penalty lands in the intermediate band between 0.02 and 0.08. Hashimoto admits candidly: “This one, honestly, as I was, you know, play testing this, was a little bit harder for me to guess than the other ones. I think you just kind of have to know the scales of some of these things.”
---
[17:12](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=1032s) Question 7: Large Batch Scaling — Why Weight Decay Beats Learning Rate
Hashimoto introduces Question 7 with genuine enthusiasm, calling it his personal favorite question on the entire quiz. The problem presents an extreme training setup: an unusually large batch size of 512, which affords far fewer total update steps to reach the target performance. Students are asked to choose the best optimization recipe from several potential strategies to keep model training stable and effective under these large-batch conditions.
```mermaid flowchart TD accTitle: Large Batch Hyperparameter Scaling Comparison accDescr: Contrasting the limits of learning rate scaling against weight decay scaling at large batch sizes.
Batch["Increase Batch Size to 512 (Fewer Total Updates)"]
Batch --> LR["Scaling Learning Rate?"] Batch --> WD["Scaling Weight Decay?"]
LR --> LRFail["Fails: Scaling law bends and saturates (Predicted by Noisy Quadratic Model)"] WD --> WDPass["Succeeds: Optimal weight decay keeps increasing monotonically"]
WDPass --> Decision["Preferred Recipe: Scale Weight Decay while holding best ratio"] ```
The solution comes down to how optimal learning rates and optimal weight decays behave as batch sizes grow. While classical scaling heuristics suggest increasing the learning rate linearly or via a square-root rule with batch size, assignment data and theoretical frameworks like the Noisy Quadratic Model (NQM) reveal that the optimal peak learning rate eventually saturates: “As you increase the batch size, we do have a scaling law, but the scaling law kind of bends for optimal peak learning rate. You can't just like keep cranking up your peak learning rate, and you could have also just like without doing the assignment reason about this from the NQM, right? Like you could have known that you can't just keep cranking up your learning rate.”
In contrast, empirical tuning curves show that the optimal weight decay does not saturate—it continues to climb steadily as batch size expands. Because the optimal learning rate plateaus while optimal weight decay continues to scale upward, attempting to push the learning rate higher destabilizes training. Therefore, the winning recipe for large-batch training is Option D: hold the learning rate at its stable plateau to preserve the optimal update dynamics, and scale up the weight decay instead.
[18:42](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=1122s) Batch Scaling Penalty and the Quadratic Rule of Thumb
Tatsunori Hashimoto examines the practical penalty incurred when scaling up batch size while naively leaving the original hyperparameters unchanged. Because leaving hyperparameters static at a much larger batch size produces a deeply suboptimal configuration, the performance is guaranteed to degrade significantly. Hashimoto guides students through how to estimate the exact order of magnitude of that loss increase when looking at multiple-choice options. A penalty of roughly 0.15 would represent an extreme degradation—comparable to the damage seen when scaling the batch size linearly alongside the theoretically flawed predicted learning rate, which earlier produced an observed loss increase of approximately 0.13.
```mermaid flowchart TD accTitle: Suboptimal Hyperparameter Penalty Estimation accDescr: Flowchart showing the steps to calculate the quadratic penalty for keeping hyperparameters fixed when scaling batch size. A["Scale batch size while keeping original hyperparameters"] --> B["Compute mismatch factor in LR × WD: factor of 8 off"] B --> C["Take log base 2: log2(8) = 3"] C --> D["Square the result (quadratic model): 3² = 9"] D --> E["Multiply by empirical constant: 9 × 0.01 = 0.09"] E --> F["Lands squarely in the correct target loss interval (~0.09)"] ```
Rather than guessing blindly, students could deduce the exact interval by reapplying the empirical quadratic rule of thumb introduced earlier for learning rate and weight decay mismatch. If the product of learning rate and weight decay is roughly eight times off from the true optimum, one takes the base-2 logarithm of that factor ($\log_2 8 = 3$), squares it to account for the quadratic error bowl ($3^2 = 9$), and multiplies by the empirical order-of-magnitude coefficient of roughly $0.01$. This calculation yields an estimated penalty of around $0.09$, landing squarely in the middle of the correct target interval seen in actual runs. Hashimoto remarks on how surprisingly well this heuristic held up throughout the quiz's empirical problems: “This is a kind of surprisingly robust rule of thumb for whatever reason in this quiz.”
- **Suboptimal baseline comparison**: Scaling up the batch size with a linearly predicted learning rate yielded a loss increase of around $0.13$; keeping original, unscaled hyperparameters also leads to severe degradation. - **Log-quadratic approximation**: For an 8× discrepancy in the learning rate $\times$ weight decay product, $\left(\log_2 8\right)^2 \times 0.01 = 9 \times 0.01 = 0.09$. - **Heuristic consistency**: Across several problems on the quiz, order-of-magnitude shifts in loss away from the optimal diagonal could be accurately deduced by modeling deviation in log space with a $0.01$ quadratic multiplier.
---
[20:15](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=1215s) Course Logistics: Tutorials and Bonus Questions
Concluding the quiz walkthrough, Hashimoto shifts to class logistics and upcoming section schedules. The teaching staff is preparing to launch course tutorials and asks all enrolled students to promptly complete the scheduling survey so that tutorial group assignments can be finalized without delay.
Hashimoto also clarifies the policy regarding the bonus questions students had previously submitted as part of their homework assignments. While the staff had not yet incorporated those questions into grading, they plan to integrate them directly into tutorial sessions, awarding extra credit through that format instead. Hashimoto explains the practical motivation behind this administrative shift, noting: “Logistically, that's a lot easier for us.”
- **Tutorial survey**: Students must fill out the scheduling survey immediately to facilitate section placement. - **Bonus credit workflow**: Homework bonus submissions will be utilized and evaluated during tutorial meetings rather than graded as standalone homework addenda.
## Notable quotes > [17:12](https://www.youtube.com/watch?v=hpkd9OYyrXU&t=1032s) As you increase the batch size, we do have a scaling law, but the scaling law kind of bends for optimal peak learning rate. — Tatsunori Hashimoto
## Mentioned Tatsunori Hashimoto, Suhas Kotha, John Duchi, Percy Liang, Stanford University, Stanford Institute for Human-Centered Artificial Intelligence (HAI), MIT, Harvard University, CS312: Deep Learning Alchemy, CS336: Language Modeling from Scratch, µP, CompleteP, Hyperball, Adam, AdamW, Noisy Quadratic Model
## Video description Browse Stanford's online courses in deep learning: https://stanford.io/4zhLWFN
How much loss do you lose by mistuning learning rate times weight decay, and when does momentum stop mattering? In this Stanford CS312: Deep Learning Alchemy quiz review, Assistant Professor Tatsunori Hashimoto walks through held-out optimization experiments and shows how many answers can be reasoned out. He covers depth µP vs. CompleteP, cosine decay and a rule of thumb for the learning rate and weight decay tradeoff, momentum at small and large batch sizes, Hyperball learning rate scaling with width, and why scaling weight decay beats scaling learning rate for large batches.
Key questions answered in this lecture: Q: Depth µP vs CompleteP: which works better with shared parameter blocks? A: CompleteP gave the lowest loss after five steps. Shared blocks are perfectly aligned, so contributions add up linearly and need 1/L scaling, which CompleteP provides, while depth µP corrects for the square root scaling of random weights.
Q: How much loss do you lose by mistuning learning rate times weight decay? A: Loss is lowest along the diagonal where LR times WD is constant, and off the diagonal the penalty is roughly quadratic: take the log of how far off the product is, square it, and multiply by about 0.01. Hashimoto was surprised how close this rule of thumb landed.
Q: Does momentum matter at small batch sizes? A: At batch size 8, loss is fairly insensitive to momentum, and removing it costs about 0.02, while at batch size 256 there is a sharp cup and removing momentum costs about 0.25, which Hashimoto calls catastrophic.
Q: How does Hyperball's optimal learning rate scale with model width? A: Hyperball normalizes updates to the weight's Frobenius norm, which acts like a 1 over square root width step size, between Adam's 1/width scaling and µP's flat scaling. Seeded runs gave exponents around -0.38 to -0.55.
Q: When increasing batch size, should you scale learning rate or weight decay? A: Scale weight decay. The optimal peak learning rate bends and stops growing with batch size, as the noisy quadratic model predicts, while the optimal weight decay keeps increasing.
Chapters: 0:00 Optimization quiz review: reasoning it out 0:28 Q1: Shared blocks, depth µP vs CompleteP 3:31 Q1b: Alignment and which loss is lowest 5:04 Q2: Cosine decay and LR times weight decay 6:08 Q2b: Quadratic penalty rule of thumb 7:53 Q3: Extrapolating Hyperball scaling trends 9:00 Q4: Momentum sweep at batch 8 vs 256 11:15 Q5: Almost µP and learning rate transfer 14:26 Q6: Hyperball learning rate scaling in width 17:12 Q7: Large batch: scale weight decay, not LR 20:01 Tutorials and bonus question logistics
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.
Course website: https://deep-learning-alchemy.github.io/ Watch the full CS312 playlist: https://www.youtube.com/playlist?list=PLXRTcAYPI4AU
Recorded October 8, 2026, in CS312: Deep Learning Alchemy, a Stanford University course taught by Tatsunori Hashimoto and Suhas Kotha.
#DeepLearning #Optimization #Stanford
[Source](https://www.youtube.com/watch?v=hpkd9OYyrXU)