Before Meta trained Llama 3 405B, it ran pretraining experiments on models almost nobody has heard of. From 40-million-parameter toys to 16-billion proxies, trained at compute budgets from 6 x 10^18 to 10^22 FLOPs, several models at each budget, these small runs existed for one purpose: to find out what the settings should be for the big one. The peak learning rate, the batch size, the warmup schedule. Those choices, made by experiment on the small models, carried into a 15.6-trillion-token run on up to 16,000 H100 GPUs.
That is hyperparameter tuning in the large: the search, done before and during training, for the settings a model cannot learn from data by itself. It is the least glamorous step in frontier model development and one of the most consequential. Two identical architectures with different settings can differ by a wide margin in final loss. The numbers Meta reported for its own flagship are a useful reminder of how specific this gets: the 405B run used AdamW at a peak learning rate of 8 x 10^-5, an 8,000-step linear warmup, and a cosine decay to 8 x 10^-7 over 1.2 million steps, with the batch size starting at 4M tokens per step and doubling to 8M partway through. Every one of those figures is an answer to a question that has no closed-form solution.
What counts as a hyperparameter
A trained model consists of weights: the billions of numbers that gradient descent adjusts while it reads the training data. Hyperparameters are everything the human fixes before the first step: learning rate, batch size, weight decay, optimizer momentum terms, warmup and decay schedules, model width and depth, context length, dropout rate, gradient clipping threshold. The weights are chosen by the optimizer. The hyperparameters are chosen by you, which is the entire problem.
The site has covered individual members of this list separately: what a learning rate is, what gradient accumulation does, what parameters actually are. This piece is about the search itself.
Grid search and the reason it loses
The default mental picture of tuning is the grid: pick three candidate values for each knob and run every combination. With d hyperparameters and n values each, the grid tests n^d points but resolves each individual knob only to a spacing of n^(1/d). As the number of knobs grows, every axis gets coarser, fast.
The deeper flaw was laid out in 2012 by James Bergstra and Yoshua Bengio in the paper that made random search respectable. Hyperparameters are not equally important. In most models, the learning rate moves the loss a lot and, say, a momentum coefficient barely at all. A grid spends equal resolution on all of them; a random draw spends resolution where it matters, in expectation, without ever knowing which knobs matter in advance. Their conclusion, verified on SVMs and neural nets, was blunt: at any given evaluation budget, random search is better than grid search, and the gap widens as dimensions accumulate.

From random draws to budgets and early death
Random search fixed the geometry problem but not the cost problem: each evaluation of a frontier-scale configuration is a training run that may take days. Two lines of work attacked that.
Bayesian optimization treats tuning as fitting a cheap surrogate of the loss surface. Each new experiment is chosen where the surrogate predicts good performance or high uncertainty, rather than sampled blindly. Jasper Snoek and colleagues made this practical for machine learning in 2012; the Optuna framework, which remains a standard open-source tuner, implements the modern version of these ideas.
The second line is multi-fidelity search: stop runs that look bad early. Hyperband, from Lisha Li and colleagues, formalizes tuning as a bandit problem, runs a wide fan of random configurations on a small budget, and repeatedly halves the survivors, spending the freed compute on the promising tail. You already meet this logic if you have read the multi-armed bandit explainer; Hyperband is that framing applied to training runs, and early-stopping variants are now routine in tuning tools.
The rules of thumb labs actually trust
Frontier labs do not grid-search 400-dimensional spaces. Most of the tuning effort concentrates on a handful of coupled settings, chiefly learning rate and batch size, because those two interact through the physics of the optimizer.
The linear scaling rule, from a 2017 Facebook AI paper by Amedeo Goyal and colleagues that trained ImageNet models in one hour on 256 GPUs, is the oldest working heuristic: when you double the batch size, double the learning rate, and use a warmup so the first steps do not diverge. Sam McCandlish and colleagues sharpened this in 2018 with an empirical model of large-batch training: every model at every stage has a critical batch size. Below it, increasing the batch buys proportionally fewer steps for the same progress, which saves compute. Above it, extra batch shrinks step count but stops saving compute, because each step gets more expensive. Batch size therefore has a correct range per model scale, and the learning rate follows the batch.
OpenAI's 2020 scaling laws paper contributes the schedule result: after sweeping many warmup and decay shapes, its authors concluded that the specific curve "is mostly irrelevant, as long as the total summed learning rate is sufficiently large" and the schedule has a warmup and a final decay to near zero. That is why nearly every modern pretraining run, from the learning rate explainer's toy example to Llama 3, is linear-warmup-plus-cosine-decay. The remaining schedule debate has largely dissolved into convention.
The hardest problem is that the tuning budget cannot be spent on the model you intend to ship. Maximal update parameterization, the muP method from Greg Yang and colleagues at Microsoft Research, addresses this directly: reparameterize the network so that the optimal learning rate found on a small proxy model transfers to the large model without retuning. The site covered muP's mechanics separately. Meta's Llama 3 work is the industrial version of the same idea done the empirical way: rather than trusting transfer, it ran the tuning loop on a graded series of 40M-to-16B models and fit scaling-law curves to the winners.

One more confession from that paper belongs in any honest explainer. For post-training, Meta gave up on picking the single best grid-searched configuration. It averaged checkpoints from several configurations instead, and reported that the averaged models "consistently yield better results compared to the best individual model found via grid search" while being less sensitive to hyperparameters. The best response to a noisy search, it turns out, can be to stop choosing.
Now the models tune the models
In May 2025 Google DeepMind announced AlphaEvolve, a Gemini-powered evolutionary coding agent, and its most quotable result was applied to training itself. AlphaEvolve found a smarter way to divide a matrix-multiplication operation, speeding a key kernel in Gemini's architecture by 23 percent, which cut Gemini's overall training time by 1 percent, and improved a FlashAttention kernel implementation by up to 32.5 percent. One percent of a Gemini pretraining run is a considerable sum of computing, and the optimization there came from evolutionary search over code, not a human grid.
On the classic side, an early-2024 paper called LLAMBO showed large language models can serve as Bayesian-optimization assistants, encoding prior knowledge about what configuration ranges usually work. A late-2026 reproducibility study tempered that result: the claimed gains were sensitive to implementation details and did not uniformly survive careful re-running. Automated tuning is real; automated omniscience is not.
What tuning will not tell you
Tuning optimizes against a validation set, and validation sets are finite. A search with enough trials will find configurations that exploit the evaluation rather than improve the model, which is why labs hold out separate test suites and why a 2024 survey of the field still describes hyperparameter optimization as a patchwork of expensive heuristics rather than a solved discipline. The honest summary of the state of the art: run many small models, couple learning rate to batch size, warm up, decay, average at the end, and remain suspicious of anything that wins only on your validation set.
Sources
- Bergstra & Bengio, Random Search for Hyper-Parameter Optimization, JMLR 13 (2012): https://www.jmlr.org/papers/v13/bergstra12a.html
- Li et al., Hyperband: A Novel Bandit-Based Approach to Hyperparameter Optimization: https://arxiv.org/abs/1603.06560
- Snoek et al., Practical Bayesian Optimization of Machine Learning Algorithms: https://arxiv.org/abs/1206.2944
- Akiba et al., Optuna: A Next-generation Hyperparameter Optimization Framework: https://arxiv.org/abs/1907.10902
- Goyal et al., Accurate, Large Minibatch SGD (linear scaling rule): https://arxiv.org/abs/1706.02677
- McCandlish et al., An Empirical Model of Large-Batch Training (critical batch size): https://arxiv.org/abs/1812.06162
- Kaplan et al., Scaling Laws for Neural Language Models: https://arxiv.org/abs/2001.08361
- Yang et al., Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer: https://arxiv.org/abs/2203.03466
- Meta, The Llama 3 Herd of Models: https://arxiv.org/abs/2407.21783
- Google DeepMind, AlphaEvolve blog: https://deepmind.google/blog/alphaevolve-a-gemini-powered-coding-agent-for-designing-advanced-algorithms/
- Liu et al., LLAMBO: Large Language Models to Enhance Bayesian Optimization: https://arxiv.org/abs/2402.03921
- Reproducibility Study of Large Language Model Bayesian Optimization: https://arxiv.org/abs/2511.18891
- Franceschi et al., Hyperparameter Optimization in Machine Learning (survey): https://arxiv.org/abs/2410.22854
