Summary

The second scaling lecture, deliberately a grab bag of the practical details that come after the classical Kaplan and Chinchilla material covered earlier in the course. It is organised around two contrasting real recipes — MiniCPM, which uses muP to make the optimal learning rate scale-invariant, and DeepSeek LLM, which instead fits scaling laws to predict the optimal learning rate and batch size — and then generalises each into its own section. The middle of the lecture surveys how recent open-weight releases (Qwen, Kimi K2, Hunyuan, LLaMA 3, MiniMax-01) actually use scaling experiments, and covers optimizers including Muon. The last third is a derivation of muP from two invariants, followed by its known failure cases. The recurring message is that extrapolating from small-scale experiments remains partly an art.

Key Takeaways

  • Two opposing strategies for scale-sensitive hyperparameters: stabilize them so the optimum does not move (MiniCPM’s muP approach), or accept that they move and fit a scaling law that predicts where the optimum will be (the DeepSeek approach). Both are in use.
  • MiniCPM’s muP recipe scales the embedding output, the residual connections by the square root of the number of layers, the initialization of matrix-shaped tensors by the fan-in/fan-out ratio, the per-tensor learning rates, and the LM head. The result is clean: the loss minimum sits at roughly 1e-2 across model sizes, removing the need to tune learning rate at the target scale.
  • Warmup-stable-decay learning rate: a fixed-step warmup, a long constant phase, and a rapid decay over the last 10-20% down to roughly 10% of peak. Its point is reusability — cosine requires knowing the token horizon in advance, so every data-scaling point needs a fresh run, whereas WSD lets you rewind to the last stable checkpoint and re-decay. WSD curves look like they are losing until the decay phase reclaims the gains, and end up comparable to a well-tuned cosine.
  • DeepSeek grid-searches learning rate and batch size at many scales and fits both against non-embedding FLOPs. The batch size fit is a convincing line; the learning rate fit is noisier, and grid quantization error is a real weakness of this approach. Their extrapolated predictions for the final large runs land close to the actual results.
  • The StepFun hyperparameter study finds the loss surface over (learning rate, batch size) is smooth and convex along each slice, which is what makes gridding viable at all. Its headline claim is that optimal batch size depends mainly on total data, roughly as its square root, while optimal learning rate falls with model size and rises with data — the latter is counterintuitive and contested. Under Chinchilla-style scaling the two effects partly cancel, recovering a DeepSeek-like law where learning rate falls with compute.
  • These fitted laws transfer to MoEs reasonably well once active parameters are controlled for, but shift with the training data distribution, so the specific constants are contingent on the data rather than universal.
  • MoE-specific scaling laws are the current frontier item: Kimi K2 sweeps sparsity against loss and picks a sparsity of 48 where returns diminish, Hunyuan runs the same style of analysis and lands on about 96 tokens per active parameter, LLaMA 3 fits a sigmoid mapping log loss to downstream benchmark accuracy, and MiniMax-01 uses scaling curves to show lightning (linear), softmax and hybrid attention are comparable, which is how they justified shipping the hybrid.
  • Muon treats matrix-shaped parameters differently from vector ones: after the momentum step it orthogonalizes the update via Newton-Schulz, effectively setting every singular value to 1, which is the spectral-norm analogue of Adam’s per-coordinate normalization. Newton-Schulz is used because it needs only matrix multiplies, unlike an SVD, which is slow on GPUs; vector parameters still use AdamW. It wins big on the NanoGPT speedrun, controlled studies show the gain shrinking as scale grows, and yet Kimi K2 was trained entirely with it — with no published ablation at that scale.
  • Optimizer comparisons are badly confounded. An undertuned Adam baseline or a non-optimal weight decay can manufacture or erase the entire gain, and most papers vary model size but neglect the Chinchilla token-to-parameter ratio, which is a second scaling axis that some algorithms are sensitive to. A Marin example shows a beautiful scaling trend holding for orders of magnitude and then blowing up.
  • The muP derivation asserts two invariants as width grows: activations at initialization stay the same scale, and one gradient step changes activations by O(1) (feature learning, as opposed to the neural tangent kernel regime where that change vanishes). Tracking orders of magnitude through a deep linear network yields the initialization scale and a per-layer learning rate of fan-out over fan-in for SGD, or one over fan-in for Adam. Stress testing shows muP survives SwiGLU and most architecture variation but breaks with a learned RMSNorm gain, sign-based optimizers such as Lion, and large decoupled weight decay.

Extracted Notes

  • None yet.

Parent Source