Unit 6 of 9 · about 6 hours · derive, measure

Critical batch, learning-rate scaling and the limits of muP width transfer

A small model can look inefficient simply because its batch or warmup is inappropriate. Transfer rules reduce search only when their parameterization and scope are checked.

You'll be able to

  • Estimate a target-dependent critical batch from reached runs without treating it as a hardware constant.
  • Fit local learning-rate and batch trends and test transfer at another width under matched exposure.
  • Diagnose muP coordinate behavior and distinguish width transfer from depth, data or schedule transfer.

Covers

Critical batch, learning-rate scaling and optimization transfermuP width invariants and limits of hyperparameter transfer
1

Read

In this order, only the parts listed

0 of 3 done

  1. Porian et al.: scale-dependent optimizationResolving Discrepancies in Compute-Optimal Scaling of Language Models (Porian et al., 2024)

    arXiv:2406.19146v1, Section 3.5, Figure 3 and Appendix E.1 to E.3

  2. Official muP implementation guideMaximal Update Parametrization: width-transfer checks

    Basic Usage; How mup Works Under the Hood; Current Limitations; Coord Check through Tips for Coord Check

    Read as a design reference for your existing width-scaling implementation. Skip installation and the legacy loading examples. Read Wider is Always Better as a warning sign to investigate: a reversal at one width and step can also be seed noise, so repeat it before you call the parameterization wrong.

  3. Estimate Critical Batch SizeTensorTonic - Scaling Laws I and II

    Statement: reached-target filtering, separate step and example minima, and their ratio

2

Focus on

  • The drill estimates , where examples and steps have separate minima among reached runs. These observed minima approximate limiting quantities; a narrow batch grid can bias the estimate. For language models, declare whether exposure and batch use examples or tokens.
  • Changing token batch changes the number of updates at fixed exposure. Retune learning rate under the same search budget and keep warmup expressed in a declared unit. Porian also finds the AdamW second-moment coefficient matters at small batches; blindly scaling learning rate is not enough.
  • The Pretraining Reliability unit on initialization transfer and muP covers the width-scaling rules. The official guide distinguishes hidden matrices, input and readout weights, fixed dimensions and width dimensions. There is no single inverse-width learning-rate rule for every tensor or optimizer.
  • Coordinate checks should cover initialization and early updates across seeds. Stable activation scales do not guarantee the best learning rate transfers, and width transfer does not license changing depth, tokenizer, sequence length, data distribution or training horizon.
Common mistakes · 3
  • Treating the batch that fits in memory as the critical batch. Memory capacity and statistical efficiency are different constraints.
  • Fitting a scaling trend through grid winners at the grid boundary without checking whether the optimum lies outside the grid.
  • Using the per-matrix learning-rate summary in Section 5 of the Modern LLM Notebook's scaling-laws notebook as a complete muP specification. Use the official parameter-class rules instead; stable coordinates are a diagnostic, not a universal loss guarantee.
3

Try it yourself

Closed-book, before checking anything

Closed-book, for reached batches of 8, 16 and 32 examples with 100, 60 and 50 steps, compute consumed examples 800, 960 and 1600; the drill estimate is 16 examples. Then use the smallest two widths of your local decoder with PyTorch 2.14.1: compare a small learning-rate-by-token-batch grid at fixed processed tokens. Record actual updates and warmup tokens. Add initialization and early-update coordinate summaries across three widths and three seeds; compare a predicted transferred learning rate with a neighboring rate at the reserved width. Report whether it transfers, not an expected winning rate.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Does the batch with the fewest steps necessarily consume the fewest examples?Answer

    No. In the constructed sweep it takes 50 steps but consumes 1600 examples, while the 100-step run consumes 800. The two minima serve different objectives.

  2. 2.A batch never reaches the target before the cap. How do you include it?Answer

    Keep it as an unreached, budgeted attempt. Do not use its capped steps as steps-to-target. Report censoring and add an all-unreached guard to your own tests.

  3. 3.Can flat coordinate scales prove the same learning rate is optimal at every width?Answer

    No. They check scale behavior over the measured widths and early steps. Test the transferred setting against neighboring settings at the new width under the same data and budget.

5

Practice

  • TensorTonic: Estimate Critical Batch Size

    Implement the statement's reached-target minima and ratio.

    Free. Public cases all reach the target and include minima at different batches. Add unreached points and an explicit all-unreached policy in your own tests.

  • TensorTonic: Fit Learning-Rate and Batch-Size Scaling

    Select per-scale grid winners, then fit the two specified log-space lines and residuals.

    Free. Public cases cover exact trends, grid tie order and three-scale residuals. They do not establish transfer from a measured decoder sweep.

  • TensorTonic: Diagnose muP Width Invariants

    Fit log-width slopes for activation and update-change RMS and apply the supplied tolerance.

    Free. Public cases cover constant series, one noninvariant series and small width variation. Keep the actual coordinate and transfer experiment in the section mini-project; supplied arrays are preparation only.

You're done when

You complete the three drills, retain unreached attempts, and distinguish measured coordinate stability from the observed success or failure of learning-rate transfer.

Only when you can do this without notes.

Leads to

Notes

Resources · 3 for this unit, 14 more in the section
  • Resolving Discrepancies in Compute-Optimal Scaling of Language Models (Porian et al., 2024)Tel Aviv University and University of Washington · required

    Read Figure 1 and Sections 3 to 5: the Kaplan and Chinchilla allocation gap closes once last-layer FLOPs, warmup length and scale-dependent optimizer tuning are fixed. It also gives learning-rate and batch-size fits and shows AdamW beta2 matters at small batches.

  • TensorTonic - Scaling Laws I and IITensorTonic · support

    Solve Fit a Data Power Law with a Noise Floor (cs336-l09-fit-data-power-law), Extrapolate Data-Mixture Scaling Curves (cs336-l09-data-mixture-extrapolation), Estimate Critical Batch Size (cs336-l09-critical-batch-size), Recover an IsoFLOP Compute-Optimal Frontier (cs336-l09-isoflop-optimal-frontier), Fit Learning-Rate and Batch-Size Scaling (cs336-l11-hyperparameter-scaling-fit) and Diagnose muP Width Invariants (cs336-l11-mup-invariant-diagnostics). Supplied-data drills are preparation, not a measured scaling result. Public test cases check the listed edge cases, not gradients or the hidden grader, so keep your own tests beside each solution.

  • Maximal Update Parametrization: width-transfer checksMicrosoft Research · support

    Read Basic Usage, How mup Works Under the Hood, Current Limitations, and Coord Check through Tips for Coord Check at commit 1981497. Use as a design reference, not an installation requirement; skip Wider is Always Better, which is not a finite-run guarantee.

Also in this section

  • CS336 Assignment 3 - ScalingStanford University · primary

    Read the handout Sections 2 and 3, then fit IsoFLOP profiles and a scaling law to the public data/isoflops_curves.json with residuals and one held-out prediction. The hosted training API and leaderboard need enrollment, and the tests need postgres and keys, so the graded half is out of reach; add a small local sweep of your own and keep the failed runs. Pair it with the Lecture 9 and 11 slides (lecture_09.pdf, lecture_11.pdf in stanford-cs336/lectures).

  • Scaling Laws for Neural Language ModelsOpenAI · required

    Read Sections 1 and 2 (the three power laws in Equations 1.1 to 1.3), Figure 1 and Section 6 (optimal allocation). Reproduce one fit and list every assumption that differs from your experiment: fixed batch size, one schedule length and single-epoch data. Read Porian et al. before trusting its allocation rule.

  • Training Compute-Optimal Large Language ModelsGoogle DeepMind · required

    Study Figure 1, Section 3.2 (IsoFLOP profiles over nine compute budgets), Section 3.3 (the parametric loss in Equation 2) and Appendix D.2 (the fitted constants in Equation 10). Recreate the conclusion only within the range your run matrix supports; read Besiroglu et al. on the Approach 3 fit.

  • Chinchilla Scaling: A Replication Attempt (Besiroglu et al., 2024)Epoch AI · support

    Read all seven pages after Chinchilla: the Approach 3 estimates disagree with Approaches 1 and 2, the reported intervals are implausibly narrow, and refitting reconstructed data restores agreement. It targets Approach 3, not the IsoFLOP evidence.

  • DeepSeek LLM, Section 3 (Scaling Laws)DeepSeek-AI · support

    Read Sections 3.1 and 3.2: batch-size and learning-rate trends with compute, and the model and data allocation fit. Its data mix is bilingual, so the exponents are specific to it.

  • Data Mixing Laws: Optimizing Data Mixtures by Predicting Language Modeling Performance (Ye et al., 2024)Fudan University · support

    Read Section 3 (the exponential law for per-domain loss as a function of mixture proportions, Equations 1 and 6) and Table 1. It interpolates within tested proportions; it does not extrapolate.

  • The Curse of Recursion: Training on Generated Data Makes Models Forget (Shumailov et al.; Nature 2024)University of Oxford · support

    Read Sections 1 to 4 on model collapse: training on generated data loses the tails of the original distribution. Keep it beside every synthetic-data decision; it does not show that any synthetic data collapses a model.

  • The Smol Training Playbook - Scaling Laws and Data MixtureHugging Face · support

    Read the scaling-laws section and the SmolLM3 data-mixture ablations for how a small team chose model size, token count and mixture under a fixed budget. Cite section names; the numbers are specific to SmolLM3.

  • 2 OLMo 2 Furious, Section 4 (Mid-training Recipe)Allen Institute for AI · support

    Read Sections 4.1 to 4.5: learning-rate annealing, the Dolmino mid-training mix, math microanneals and checkpoint soups. It is the curriculum and annealing case the scaling papers lack.

  • Modern LLM Notebook - Scaling LawsWalking Labs · support

    Use notebooks-en/part2-training/14-scaling-laws.ipynb for a compact bridge among Kaplan, Chinchilla, muP, FLOPs and memory. Treat its calculations as exercises to verify, not as evidence for extrapolation; its prices are dated samples.

  • Scaling Data-Constrained Language ModelsHugging Face Research · depth

    Read Section 3 (the data-constrained law, in which repeated tokens lose value at a fitted rate), Appendix A (its derivation) and Sections 5 and 6 (up to about four epochs of repetition cost little; returns fall quickly after that), then inspect the reproducibility repository (https://github.com/huggingface/datablations). Use one small repeated-data experiment to challenge the compute-optimal assumption.

  • DoReMi: Optimizing Data Mixtures Speeds Up Language Model Pretraining (Xie et al., 2023)Stanford and Google · depth

    Read Section 2 (Group DRO over domain weights with a small proxy) and Section 4. A larger proxy can do worse, so proxy scale does not transfer automatically.

  • Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling Laws (Sardana et al., 2024)Databricks · optional

    Read Section 2 (training plus inference cost for a target quality and inference demand) and Sections 4 and 6 (results and real-world cost). Its demand model is illustrative.

  • Applied Science Research Laboratory - Scaling StudyRoadmap-Final · support

    Borrow the preregistration, matched-budget, uncertainty, residual and negative-result requirements for the scaling experiment.