Hashimoto Backs Weight Decay Over Learning Rate in Large-Batch Runs

µP, Momentum & Weight Decay Predictions | Stanford CS312 Quiz Review with Tatsunori Hashimoto — Stanford Online

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)

Reading summary

Reviewing Stanford's CS312 quiz solutions, Tatsunori Hashimoto demonstrates that neural network optimization and hyperparameter transfer can be largely predicted from first principles, empirical scaling diagonals, and simple quadratic heuristics. Shared Parameters and Alignment in Depth Parameterization (0:05) When analyzing depth scaling across 1,000 blocks, parameter sharing alters the statistical assumptions underlying residual stream growth. In standard Depth µP with independent weights, module outputs accumulate incoherently, scaling at O(sqrt(L)) and requiring a 1/sqrt(L) scaling factor to remain stable. However, sharing parameter blocks introduces perfect module correlation, causing updates to compound linearly at O(L). Under these conditions, CompleteP suppresses the initial residual multiplier and applies a 1/L scaling factor, preventing representation explosion and achieving the lowest fitted validation loss after five training steps, outperforming Depth µP by roughly 0.06. The Log-Quadratic Penalty on Hyperparameter Diagonals (5:04) Optimization sweeps across learning rates (LR) and weight decays (WD) demonstrate that model performance is anchored to a valley along the diagonal where the product LR × WD remains constant. Deviations away from this optimal ridge incur a predictable degradation in validation loss that behaves quadratically with respect to the logarithmic discrepancy. Hashimoto notes that multiplying the squared log deviation by an empirical coefficient of roughly 0.01 accurately forecasts off-diagonal loss penalties, such as a predicted 0.09 penalty for an 8× discrepancy ((log2(8))^2 × 0.01 = 0.09) compared to observed penalties near 0.13. Batch Size Sensitivity and Momentum Dynamics (9:25) Batch size fundamentally alters optimizer sensitivity to momentum (beta_1). At a small batch size of 8, loss remains largely flat across momentum settings, shifting toward an optimum near 0.99 and suffering only an approximate 0.02 loss increase if momentum is removed entirely. Conversely, at a large batch size of 256, the loss surface forms a narrow, unforgiving cup where eliminating momentum leads to a severe loss penalty of roughly 0.25. When scaling up to large batches like 512, Hashimoto notes that optimal peak learning rates saturate as predicted by the Noisy Quadratic Model, making weight decay scaling—rather than continued learning rate increases—the effective strategy to maintain stability. Width Scaling Across µP, Almost µP, and Hyperball (11:15) Learning rate transfer across widths depends on how much implicit or explicit normalization an optimizer applies. Baseline Adam requires an optimal learning rate scaling inversely with width (exponent -1.0), while Maximal Update Parameterization (µP) maintains a constant optimal rate (exponent 0.0). 'Almost µP'—which applies µP everywhere except the readout layer—exhibits behavior closely matching full µP with an LR scaling ratio near 1.0, because the unadjusted readout layer comprises a negligible portion of total parameters. Meanwhile, the Hyperball optimizer inherently rescales updates by the weight matrix Frobenius norm (scaling as sqrt(width)), resulting in an intermediate optimal LR scaling exponent between -0.38 and -0.55 and an intermediate transfer penalty between 0.02 and 0.08. The review demonstrates that while exact empirical values vary across seeds, first-order theoretical dynamics reliably predict optimization failure modes and hyperparameter scaling behaviors across network depth, width, and batch sizes.

Source quotes

[17:12] Tatsunori Hashimoto: As you increase the batch size, we do have a scaling law, but the scaling law kind of bends for optimal peak learning rate.

Original transcript

[0:05] Okay. [0:06] Uh so we will go through the solutions. [0:08] Um I do think this quiz was maybe a [0:11] little bit more advanced than the first [0:13] one. But [0:15] um [0:16] also I think you know in some ways I [0:18] think this quiz is uh [0:20] pretty interesting one because you can [0:21] reason through uh quite a few of the [0:25] answers. Not all of them but but quite a [0:26] few of them. [0:27] Um [0:28] so okay the first question is you know [0:31] in the assignment we had uh depth mu P [0:34] example where we had a thousand [0:35] different blocks. Now what happens if [0:37] you do a thousand shared uh parameter [0:40] blocks? [0:41] Um and you know we have various options [0:42] here. Um and of course an important [0:44] aspect of this question is we're looking [0:46] at the ratio uh not just the raw RMS. [0:50] Um and the way I'm going to go through [0:51] the answers is that I'm going to go [0:53] through uh we have an internal you know [0:56] play test of the of the assignment. Um [0:59] so I've taken data from the play test [1:01] that we have just to show you like what [1:02] relevant information uh at least exists [1:05] in the assignment. And this play test [1:06] doesn't look at the quiz so it's you [1:07] know just kind of running through the uh [1:10] assignment completely autonomously. [1:12] Um so at least in you know this um [1:15] example you know if you vary the depth [1:17] at all you'll kind of see that you know [1:18] depth mu P is like pretty stable in [1:20] terms of the residual RMS. Mu P of [1:22] course grow grows uncontrollably. Um [1:24] same story after five updates right? And [1:26] so you might like kind of have this [1:27] impression that like depth mu P kind of [1:29] works better uh than complete P. [1:32] Um so what is the answer for the ratio? [1:33] The ratio answer is uh [1:36] option two for like the the standard and [1:39] depth. And then uh you know option C [1:42] like the one that's uh [1:43] sorry it's option one which is like the [1:45] small one for complete P. [1:47] Um [1:47] and really like the the important thing [1:49] here is like it's the ratio right? So if [1:51] you look at all three the pattern is the [1:53] same as the one you might have seen in [1:55] the assignments like the RMS you know is [1:57] actually in the same ranking. Um it's [1:59] just that kind of few, for some reason [2:01] the ratios are very similar. For this [2:03] one, the ratio is much smaller. Um, and [2:05] so you might say like, how how am I [2:07] supposed to know this? Um, well this is [2:09] something that you can actually kind of [2:10] reason through. Um, because like what [2:12] are all these things doing? Well, [2:13] they're shifting the residual [2:15] contribution by some power of R, right? [2:18] Um, and so they're just kind of multiply [2:20] whatever stuff gets added to the [2:22] residual stream by a constant factor. [2:24] Um, so when you take the ratio, these [2:25] things kind of cancel out for any [2:27] contributions coming through the [2:28] residual stream, right? Um, and so you [2:30] can kind of see this like if you look at [2:31] the stuff that's being added into the [2:32] residual stream and you take the ratios [2:34] of that before and after, you get [2:36] basically a constant factor. Um, but an [2:38] important thing is that, you know, [2:40] complete P is kind of starting off with [2:42] a very small multiplier. So all the [2:44] residual contributions are small to [2:45] start with. And so relatively speaking, [2:47] um, basically the embeddings that are [2:49] entering the residual stream at the [2:51] bottom are much larger. And therefore [2:53] you kind of get this effect where the [2:55] the ratios aren't like hostilely and [2:56] linearly decaying. You have this big [2:57] constant offset that messes with uh the [3:00] ratio. And so uh the complete P one just [3:03] has this much smaller uh multiplier. But [3:06] really like, you know, um, the core [3:08] observations here are just kind of [3:09] knowing about the behavior of standard [3:11] and depth new P. And you know, if you [3:13] you know, knew that complete P was [3:14] really going to like kill the RMS [3:16] contributions and so the embedding would [3:17] dominate, you would you would have [3:18] probably gotten somewhere directionally [3:20] correct um on this quiz question. [3:23] Okay. Um, and so now this is like the [3:25] what happens um, you know, after five [3:27] steps, you know, which one has the [3:29] lowest of the three losses. Um, this one [3:31] I would actually argue is maybe uh [3:34] easier to to know about than the others [3:36] because this is really a question about [3:38] uh alignment. So in the uh alignment, [3:42] what you might have seen is that uh [3:44] depth new P uh would work significantly [3:47] better in terms of the fitted validation [3:50] losses than the others. And the reason [3:51] for this, if you want to think about it, [3:52] is at initialization all the weights are [3:55] kind of random, right? And we talked [3:56] about in lecture like when they're [3:57] random, you know, you get this square [3:59] root scaling. And if you get square root [4:01] scaling, well depth new P is exactly [4:03] correcting for that square root scaling, [4:04] right? Um and what's completely [4:06] correcting for? Well, complete P is [4:08] correcting for the case where everything [4:09] is aligned, and if everything is uh [4:12] aligned, well, that's the case where you [4:14] copy all the modules, right? You have [4:15] perfect correlation. If you have perfect [4:17] correlation, uh everything is going to [4:19] sort of amplify linearly, and so you [4:21] really want the one over R scaling. Um [4:24] and this is exactly what shows up in the [4:25] experiment. You end up with the case [4:27] where complete P is significantly better [4:29] uh than depth U P as well as the [4:31] baseline, which is the zero point uh [4:33] over here. And this is a different [4:34] visualization of the whole same thing. [4:35] Um so for this question, you know, [4:37] complete P uh turns out to be uh the [4:39] best choice over here. [4:42] Okay. [4:43] Um so question 2 A. Oh, yeah. [4:45] >> of different means? [4:49] >> Means are different by about I mean [4:51] Well, it depends on which one we're [4:52] looking at, but this one's about 0.06. [4:55] So statistically [4:56] >> It's so close to the 0.05 [5:01] >> Um [5:04] Okay. Um so [5:06] uh Q 2 A is now uh question about [5:10] instead of doing linear decay um on our [5:13] sort of sweep over learning rates and [5:15] weight decays, we're just going to do [5:17] cosine decay to zero, and then we're [5:19] going to do kind of loss ranking. Um [5:21] right? So So this is pretty close to [5:23] what you should have done in A 2. Um you [5:26] should have made kind of these quadratic [5:27] plots. Um the observation you should [5:29] have made with these plots is that [5:31] essentially the diagonal, right? Weight [5:33] uh sorry, learning rate times weight [5:34] decay is a very important kind of [5:36] constant to to track. Um and then you [5:39] maybe saw a heat map like this um where [5:42] essentially, you know, the diagonals are [5:43] low loss, and then as you go off, you [5:45] you get increasingly higher losses, [5:47] right? [5:48] Um this is a a pretty straightforward [5:50] question. We're not trying to trick you. [5:52] Basically, if you just read off the [5:54] exact same relationship as what you had [5:56] in the assignment, you would have gotten [5:57] the question right. Um basically, B and [6:00] A are very low loss, F and E are similar [6:03] loss, D and C are high loss, right? And [6:05] that kind of corresponds to exactly this [6:07] kind of block structure if you kind of [6:09] like, you know, reason through where [6:10] this lives in the hyper-parameter grid. [6:12] And that, you know, there's only really [6:13] one ordering that's anywhere close to [6:15] this ordering. Um [6:17] so that's the the answer for question [6:19] two. [6:20] Um and part B is the numerical [6:22] prediction follow-up, right? If we have [6:24] configuration C, um you know, which is [6:26] not one of the optimal ones, um how far [6:28] off are we from the optimal loss is [6:31] 2.83? [6:33] Um and then we're supposed to kind of [6:34] guess what this guy is. [6:36] Um this one, I think, you know, [6:39] you were either going to guess like, you [6:41] know, out of a hat or you would have [6:44] maybe perhaps made a plot like this [6:46] somewhere in your assignments. And if [6:47] you did, this would be a more [6:48] straightforward answer. Um basically you [6:51] may have been curious um of basically [6:54] how much it hurts if you mess with the [6:56] LR times WD uh [6:59] multiplier, right? So you know, we [7:01] ideally want to keep that fixed. That's [7:02] the X equals Y line. What happens when [7:04] we deviate from that line? Um and when [7:06] you make kind of this plot, you'll [7:08] roughly see that there are quadratics [7:10] and they're roughly going to be on the [7:12] order of something like 0.01 scaling. Um [7:16] and if you knew that, then you would [7:17] know that, you know, you take the log of [7:19] the product, how far off you are, square [7:21] it, and multiply by some constant, and [7:23] that's going to be roughly what you're [7:24] going to get. [7:26] Um and then that like basically bang on [7:28] predicts option four. I'm actually kind [7:30] of surprised by how close that ends up [7:33] being, but that is basically kind of the [7:34] rule of thumb. Like you could have taken [7:36] uh [7:37] some of the quadratics, at least the [7:38] order of magnitude if you kind of knew [7:40] this, and then multiplied it by the log [7:42] product squared. Um [7:44] and you would basically get uh [7:46] exactly uh the prediction. [7:49] Anywhere close would have been good too, [7:51] right? Um [7:53] [laughter] [7:54] Okay. Uh [7:56] question three. [7:57] Um question three is yet another really [8:00] straightforward one. Um we thought that [8:03] we should have some fairly [8:03] straightforward ones. Question three is [8:06] literally something like if you [8:07] extrapolated this line out, you would [8:08] get the right answer. [8:10] Um, [8:11] so maybe the point that we were trying [8:13] to make here is that at least in the [8:15] data that you will have seen in the [8:17] assignment, even if you extended out [8:19] your scaling laws pretty far, um, you [8:21] know, you will have gotten that these [8:23] things are mostly linear, like, you [8:25] know, or at least hyperbola is mostly [8:26] linear. Adam W does actually have some [8:28] funky scaling once you go far out. Um, [8:30] but you can for the most part extend the [8:32] line on hyperbola. It's We're not trying [8:34] to be too fancy here. Um, and so if you [8:37] really just follow the trend line, you [8:39] will get roughly the answer which is [8:40] 0.008. [8:42] Um, and that's, you know, there's only [8:44] really one answer bin that that guy is [8:46] going to resolve to, um, which is option [8:52] Okay. [8:53] Um, [laughter] [8:56] Okay. [8:57] Uh, [9:00] And then we have question four. Um, [9:03] question four [9:04] What was this one? Oh, this is the [9:05] momentum sweep. Yeah. Uh, [9:07] four is the momentum sweep at two [9:10] different batch sizes. Um, once again, [9:13] like, so so questions three and four, I [9:15] mean also two, are building pretty [9:17] directly off of the assignment. Um, [9:19] question four once again is really [9:21] asking, like, did you make a particular [9:23] kind of momentum sweep in your [9:25] assignment? Um, [9:27] and, you know, hopefully in your [9:29] assignment you will have produced plots [9:30] that look like this. Um, and you'll know [9:32] that like batch size A is generally [9:34] pretty insensitive to your momentum. Um, [9:37] not only that, like, basically the [9:38] optimum shifts, you know, farther to the [9:40] right on this curve, right? Like the [9:42] optimum momentum is actually pretty [9:43] close to 0.99. Um, and also batch 256 [9:46] have pretty sharp, you know, upper bends [9:48] on both sides. Um, and so if you know [9:50] this, then I think you will have gotten [9:52] this answer to to roughly, you know, [9:54] within one, which is we do know that [9:56] probably beta one is the worst in both [9:59] of these guys, right? Um, and then, you [10:02] know, these two, 0.9 or 0.98, like, I [10:04] mean, you might have guessed this wrong, [10:05] but if you were carefully looking at the [10:07] shape uh, of the low batch case, you [10:09] would know that [10:10] would have been better. Similarly, for [10:12] this one, it's a little bit easier [10:13] because in the high batch case, it's [10:14] like such a big sort of characteristic [10:16] cup that you would know that B is [10:18] probably the minimizer, right? [10:22] And [10:24] finally, you know, you might ask like, [10:25] okay, like what happens when we sort of [10:28] remove momentum in all of these? And [10:30] then if we do that, [10:33] then we can kind of look at the plot [10:34] again, at least mentally, and we would [10:36] know that at least for the gray one, or [10:38] sorry, black one, we would not have much [10:39] of a penalty. It's a pretty flat line, [10:41] right? Whereas for the blue one, which [10:43] is the high batch case, we should really [10:45] suffer quite a bit. We talked about this [10:46] in lecture as well. [10:48] And so really it's just a matter of like [10:49] picking quantitatively what these [10:51] numbers are. And at least in the case [10:53] here, [10:54] you know, the small batch case is around [10:56] 0.02 and the large batch case is 0.25. [10:58] This is a truly catastrophic you know [11:00] number. I mean, I do think, you know, [11:02] getting this one off by one is a totally [11:04] reasonable thing, but this one, you [11:05] know, I think if you were looking at the [11:06] validation loss ranges, this guy is you [11:08] know really shooting up and so you [11:09] should have predicted that this would be [11:11] pretty degenerate. [11:15] Okay. [11:16] Question five is almost mu P. [11:19] Really the key to the question five is [11:23] basically figuring out what the readout [11:24] does in a model and also the impact of [11:27] the readout just in terms of the [11:28] stability and behavior of the model. [11:32] So the first question is asking about [11:34] the ratio between the 1024 width model [11:38] and the 512 width model's optimum [11:41] optimal learning rates. [11:43] And so, you know, I think let's see if [11:45] we have the right data. Yep. So I think [11:47] that the relevant assignment to data [11:50] that you might have is a plot that looks [11:51] like this. You know, you're changing [11:53] your width, you're looking at optimum [11:54] peak based learning rate, and you would [11:56] compare them for both baseline and mu P. [12:01] In the case of mu P, we know this guy is [12:02] pretty flat. In the case of baseline, we [12:06] know this thing is roughly a slope with [12:08] negative one, right? [12:10] And so we know almost mu P is going to [12:12] be somewhere in between, right? And if [12:14] it's somewhere in between, where do we [12:16] really expect it to be? Well, we kind of [12:18] expect it to be somewhere in the middle. [12:21] In this case, you know, the readout is [12:23] actually a very small contribution [12:25] relative to the rest of the the network, [12:27] and it turns out to be much closer to mu [12:29] P. I mean, we did call it almost mu P [12:32] than, you know, the course baseline. [12:34] And so the correct answer ends up being [12:36] that the right sort of ratio is close to [12:39] one, right? Because it basically is [12:40] constant. It doesn't change very much. [12:43] If we were close to baseline, then that [12:44] should be kind of one over two, and that [12:47] should be closer to here. And so you can [12:48] kind of reason through by sort of is it [12:50] close to mu P or not these two numbers. [12:52] You may have gotten it off by one, but [12:54] regardless, you know, you should be able [12:56] to guess it to within at the very least [12:58] items two or three based on your [13:00] knowledge of mu P and the behavior of [13:02] the readouts. [13:04] Yeah. [13:05] And if you're off by one, like it's not [13:06] a big deal, especially if, you know, [13:09] you're pointing towards relevant [13:11] experiments that you run in this [13:12] assignment. Like some of these are like [13:13] somewhat ambiguous. We just want to be [13:15] able to, you know, have sort of more [13:16] fine grain separation for some of these. [13:18] But, you know, for the most part, if you [13:19] get the the first order terms right, you [13:21] should feel pretty good about yourself. [13:24] Okay. [13:25] Part B. [13:26] This is a basically the same kind of [13:28] question. It's a variation of the same [13:30] thing. We're just asking how much does [13:31] this hurt, right? Is it a lot? Is it a [13:33] little? Like what what happens if we [13:35] just [13:36] do the same thing? Well, [13:38] so if we transfer the peak learning [13:40] rate, we do know that for mu P, right, [13:42] you might have generated a table like [13:44] this, you know, like direct transfer [13:46] just does fine, right? Like it's [13:47] basically as good as, you know, if we [13:49] tuned it again. And so if we know that [13:51] and we know that almost mu P is [13:53] basically like mu P, we should expect [13:55] that the impact that we get is very low. [13:58] The only thing about this question is [14:01] really we're comparing the minimizer to [14:03] the actual thing that we ran, right? And [14:05] this is not actually optimal, so there [14:07] is a little bit of a suboptimality gap, [14:09] and that's why we're kind of in the [14:10] option three bin rather than option [14:12] four. But regardless, you end up with a [14:13] very small gap because after almost mu p [14:16] is kind of like mu p. You should know [14:19] from the assignment uh that, you know, [14:21] mu p, you can just directly transfer the [14:23] learning rate. [14:26] Okay. [14:27] Um question six. Um this one was the [14:29] hyperball one. Um and so now what we're [14:32] going to do is we're going to do [14:33] hyperball um and we're going to do width [14:35] sweep. And we're going to do uh peak and [14:38] we're going to look for what the best [14:39] learning rate is. [14:41] Um so now the question is what is the [14:43] learning rate scaling of hyperball under [14:46] standard parameterization, right? Um so [14:49] this one [14:51] really once again you you would kind of [14:53] look at the same experiment in a way. Um [14:55] there's really two things maybe that you [14:57] could have looked at and thought about. [14:58] Um [14:59] so on the left once again we have the [15:01] width sweep. We vary width. We look at [15:03] the optimal learning rates. Um and we [15:05] would see that really the key thing here [15:07] is that baseline decays at one over the [15:09] the width whereas mu p stays constant. [15:11] This will be kind of important scaling. [15:13] Um we also know that alignment is [15:15] roughly around 0.75 which means that [15:17] we're closer in some sense to uh you [15:20] know the the full aligned like mu p [15:22] regime rather than kind of a square root [15:24] n regime. [15:26] Now um one way to reason about hyperball [15:29] is to sort of like mentally do the math [15:32] of like what is hyperball doing? Well, [15:34] hyperball is going to take some matrix. [15:36] It's going to you know multiply um it's [15:39] up it's going to normalize this update [15:41] and then scale it back up to the size of [15:43] the Frobenius norm of w. Um you can kind [15:46] of reason that this is going to be [15:48] roughly one over the square root of [15:50] width in terms of the step size. Um at [15:52] base Adam needed one over m scaling for [15:55] the step size. If hyperball implicitly [15:57] gives us something like one over square [15:59] root m, well, the gap that we expect [16:01] between these two should be one over [16:03] square root m. Um and it turns out that [16:05] this kind of reasoning is not too far [16:07] off. You know different seed seeded runs [16:10] will give you somewhere between like 0.4 [16:12] like 0.38 to 0.55. You know the real [16:16] number is somewhere in between but [16:17] comfortably uh in this bin of -0.75 [16:20] to -0.25, right? So you could have kind [16:22] of reasoned about this, but you could [16:24] have also sort of thought through once [16:25] again that maybe hyperball would have [16:27] some stabilizing effect and it would put [16:29] you right in between uh these two, and [16:31] that would have gotten you the right [16:33] answer uh as well. [16:35] Great. [16:36] Um for part B, um the question is, you [16:40] know, like what is the the transfer [16:41] penalty once again uh for this uh [16:44] best sample learning rate? Um and for [16:46] hyperball, you know, there is a slightly [16:48] bigger uh penalty than before, but once [16:51] again we expect it to be less than the [16:52] Adam case, which is 0.12. Um and you end [16:55] up landing uh somewhere in the middle [16:57] here, which is in the in the band of C [16:59] uh between 0.02 and 0.08. Um this one, [17:02] honestly, as I was, you know, play [17:04] testing this, was a little bit harder [17:05] for me to guess than the other ones. I [17:07] think you just kind of have to know the [17:08] scales of some of these things. [17:12] Okay. [17:13] Um and then so this is the last [17:15] question, um which I thought was pretty [17:18] fun. This was my favorite question of [17:19] the of the quiz. [17:21] Um so now we're going to take a really, [17:23] I mean relative to the class, a really [17:25] large batch size, which is 512. Uh we [17:27] have way fewer updates, and now we have [17:29] lots of different tricks that we can [17:31] apply to make things train under this [17:33] fairly large batch size. Um and you have [17:35] to figure out which of these recipes [17:37] you're going to pick. [17:39] Um so from the assignment, you may have [17:42] seen plots that look like this. As you [17:44] increase the batch size, we do have a [17:46] scaling law, but the scaling law kind of [17:49] bends for optimal peak learning rate. [17:51] You can't just like keep cranking up [17:52] your peak learning rate, and you could [17:53] have also just like without doing the [17:54] assignment reason about this from the [17:55] NQM, right? Like you could have known [17:57] that you can't just keep cranking up [17:59] your learning rate. Um on the other [18:00] hand, you may have noticed that the [18:02] optimal weight decay can in fact keep [18:04] going up with larger batch sizes, right? [18:07] Um given these two observations, you [18:10] might then say actually scaling weight [18:12] decay might be the more preferable uh [18:15] option for large batch relative to [18:16] scaling up um learning rate. [18:19] So where does that leave us? Um, sorry, [18:22] the kind of bad visualization here. Um, [18:24] that leaves us with um, doing weight [18:26] decay scaling, which is option D turns [18:29] out to be the right thing to do. Um, [18:31] whereas, you know, you want to try to [18:32] keep the best ratio, but then scale up [18:35] uh, the weight decay. [18:37] Um, [18:37] good. [18:38] Okay. [18:39] Um, and then now you might say, okay, [18:42] like if I keep the original uh, [18:44] hyperparameters, but then scale up the [18:47] batch size, you know, what is the [18:49] penalty that I incur in doing this? Um, [18:51] well, you know, we do know that this [18:54] should be a lot worse, right? Because [18:55] this is a deeply suboptimal [18:57] hyperparameter. [18:59] Um, but we have to kind of reason about [19:00] how much worse. Um, and so looking at [19:03] the options, right? Um, 0.15 [19:07] is kind of way worse. It's as bad as [19:09] sort of scaling the batch linearly. Like [19:11] if we go back up to uh, here, we kind of [19:14] see that, you know, scaling up the batch [19:16] and using the predicted learning rate, [19:18] which we know is a really bad thing to [19:19] do, get gives you a loss of around 0.13 [19:23] uh, [19:24] increase. [19:25] And so like what does that, you know, [19:27] tell us? You know, well, you know, it [19:28] tells us that maybe um, you know, our [19:30] losses are not necessarily uh, going to [19:32] be that high, but it is going to be [19:34] pretty high. Um, and in fact, you could, [19:36] you know, once again, if you had known [19:37] roughly speaking what the penalty is for [19:40] going off the optimum on uh, weight [19:42] decay times learning rate, you could [19:44] have kind of reasoned, okay, I'm like [19:45] eight times off, you know, I take the [19:47] log base two, I square that cuz that's [19:49] the quadratic, and then you know, rough [19:51] order of magnitude is 0.01. Um, and so [19:53] this would give you an estimate that [19:55] also lands squarely in the middle of the [19:57] correct interval. Um, the answer is if [19:59] you actually run it is like roughly in [20:00] this range as well. Um, this is a kind [20:02] of surprisingly robust rule of thumb for [20:04] whatever reason in this quiz. Um, but [20:06] you could have sort of reasoned about [20:08] uh, the order of magnitude computation [20:09] here as well, mainly by sort of just [20:11] looking at the learning rate weight [20:13] decay uh, combination. [20:15] All right. So, those are the answers. [20:17] Um, I think one uh, last logistical [20:20] announcement. Um, we're going to start [20:22] tutorials. Please sign out the fill out [20:25] the survey so we can assign them as soon [20:27] as possible. [20:29] Thus far, we haven't used kind of the [20:31] what's it called? The bonus questions [20:33] that you submitted on the homework, but [20:34] we are probably going to use them in the [20:36] tutorial and award bonus points in the [20:37] same way. Logistically, that's a lot [20:39] easier for us.