Scaling Laws
A neural network is a pile of multiplies and adds. Training one is more multiplies and adds. Take away the hype and an LLM is three numbers: how many parameters, how many tokens, how many FLOPs.
So the real question is a budget question. You have a fixed number of FLOPs. How do you split them between parameters and tokens? OpenAI measured the answer in 2020 (Scaling Laws for Neural Language Models). DeepMind corrected it in 2022 (Chinchilla). This post counts the FLOPs first, then spends them.
FLOPs
A FLOP is one floating-point operation: one multiply or one add of two decimal numbers. Compute, C, is the total number of FLOPs in a training run. Count them from the bottom up:
- For one weight, the network multiplies an input by the weight, then adds the result to a running sum. That is 2 FLOPs.
- Each weight does this one time for each token. So a model with N parameters costs approximately 2N FLOPs per token in the forward pass.
- Training also runs a backward pass. It computes two gradients for each layer: one for the inputs, to send back to the layer below, and one for the weights, to update them. Each costs approximately as much as the forward pass, so the backward pass is approximately 4N.
Total: 6N FLOPs per token. Train on D tokens and the compute is C ≈ 6ND. Kaplan et al. use this same estimate. Attention adds a term that grows with the context length, but it is small for large models.
Now put hardware under it. GPT-3 took approximately 3.2 × 10²³ FLOPs. An NVIDIA H100 is rated at approximately 10¹⁵ FLOPs per second (dense BF16, the peak on paper). One H100 at 100% of that peak needs approximately 3.2 × 10⁸ seconds: 10 years. Real runs get much less than peak, so labs use thousands of GPUs for months.
Kaplan et al. measure compute in PF-days: 10¹⁵ FLOPs per second for one day, 8.64 × 10¹⁹ FLOPs. That is approximately one H100 at peak for one day.
scaling laws
A scaling law is a simple rule that predicts the loss of a language model as you make it larger. With these rules, you tune on small, cheap models, then extrapolate to the large model and nail it in a single run. You do not have to guess hyperparameters at full scale.
Kaplan et al. (2020) quantified this with three power laws:
where N = number of parameters, D = dataset size (tokens), C = compute budget (FLOPs), and L = cross-entropy loss.
A power law is a straight line on a log-log plot. The loss drops when you add parameters, data or compute, but the small exponents give diminishing returns. Each 10x increase in parameters multiplies the loss by 10^-0.076 ≈ 0.84, a 16% drop. 10x more data gives a 20% drop. 10x more compute gives an 11% drop.
Figure: Kaplan et al. (2020), Figure 1. Test loss against compute, dataset size and parameters. Each one is a straight line on log-log axes.
Figure: Classic machine learning expects a model to overfit as it gets larger (left). At LLM scale, the loss continues to fall as scale increases (right).
chinchilla
Two years later, Hoffmann et al. (2022) found that GPT-3 and other large models were undertrained: too many parameters, not enough data. For compute-optimal training, they scale parameters and tokens equally: each time you double the parameters, double the tokens. This gives approximately 20 tokens per parameter.
They tested this with Chinchilla: 70B parameters trained on 1.4T tokens. Chinchilla used the same compute as DeepMind's Gopher (280B parameters, 300B tokens), with 4x fewer parameters and 4x more data. It beat Gopher, GPT-3 (175B), Jurassic-1 (178B) and MT-NLG (530B).
*Figure: Parameters and training tokens from Hoffmann et al. (2022), Table 1.*The calculator uses C ≈ 6ND from the FLOPs section. For the same C, Kaplan's rule puts more of the budget into parameters. Chinchilla's rule puts more into data.
data
Loss versus dataset size is also a power law, linear on a log-log plot.

Kaplan et al. trained on one dataset (WebText2) and tested on others (books, Wikipedia, Common Crawl). Each test set gives a parallel line: the data changes the offset, not the slope. So a data difference that shows at small scale stays at large scale, and you can test data choices on small models.

Repeating data helps up to about 4 epochs, then returns fall off fast (Muennighoff et al., 2023). That sets up the real tradeoff: repeat high-quality data, or pull in new lower-quality data.
how to design a huge LM
- Use a transformer, not an LSTM. In Kaplan et al., the transformer loss continues to drop as you add parameters. MoE (mixture of experts) is the only change that beats a vanilla transformer every time.
- Use Adam, not SGD, when you train for many epochs. Adam adapts the step size for each weight instead of one fixed rate.
- For depth, 1 vs 2 layers is night and day. From 2 layers up, depth barely matters for the same number of parameters (Kaplan et al., Figure 6).
- For batch size, a bigger batch gives more gradient signal per step, up to a critical batch size. Past it, you spend compute for little gain.
recap
You pick which of the three knobs to turn: parameters, data, or compute. You can turn all three. The Chinchilla paper showed most labs were turning the wrong rknob. They were making models too big and not training them on enough data. Chinchilla (70B params, approximately 4.7x the data of GPT-3) beat the much larger GPT-3 with a better split of the compute budget.
Loss ~ f(parameters, data, compute): all three matter, but how you balance them matters more.
Different labs make different bets on this tradeoff. ChatGPT scales up parameters and broad data with a very large compute budget, for generality. DeepSeek goes the other way, for reasoning efficiency: DeepSeek-V3 is a mixture-of-experts model that uses only 37B of its 671B parameters for each token, with higher-quality data and more inference-time compute. Both obey the same scaling laws, they just allocate their budgets differently.
limitations and what's next
The catch: we're running out of high-quality text. Two escape routes are in play. Synthetic data (AlphaGo Zero learned entirely from self-play) and reasoning models like o1 that spend more compute at inference, thinking longer to answer better, which is its own new scaling axis. New architectures are the other hope, but nothing has unseated the transformer yet, usually because the alternatives aren't numerically stable.