Scaling laws are one of the most critical empirical findings in deep learning. The observation is simple in form: the training loss
This predictability makes scaling laws highly valuable in practice. A common workflow is to fit scaling laws on a handful of small runs and then extrapolate to estimate the token and compute requirements for larger models.有了这定律,心里有底。先跑几个小规模实验,拟合出曲线。往后要多大的模型,要多少算力,算一算就出来了。
| Symbol | Note |
|---|---|
| Model size, measured in parameter count. | |
| Training dataset size, usually measured in token count. | |
| Training compute in FLOPs. As a useful approximation, |
|
| Irreducible loss | |
| Test loss / test loss prediction function; can also refer to training loss, since they are strongly correlated. | |
| Generalization error. |
Early days: ML loss predictability早年间:机器学习损失的预测#
The predictability of generalization error with scale had already been investigated before scaling laws became a mainstream concept.缩放定律成主流前,早有人琢磨过规模与泛化误差的关系。
Amari et al. (1992) derived four types of learning curves using a Bayesian approach and the annealed approximation.1992 年,Amari 等人用了贝叶斯方法和退火近似,推导出四种学习曲线。
- Deterministic learning algorithm, noiseless data, one unique solution:
, where is some constant.确定性算法,数据无噪,解唯一:ϵ∼c⋅D−1,c 是常数。 - Deterministic learning algorithm, noiseless data, multiple equivalent solutions:
; the learning is faster with each new data point, because the model only learns the optimal manifold of parameters, instead of finding the single solution point.确定性算法,数据无噪,多解等价:ϵ∼c⋅D−2。新数据越多,学得越快。模型只管最优参数流形,不用死磕某一个点。 - Deterministic learning algorithm, noisy data:
; noises in data make learning harder.确定性算法,数据有噪:ϵ∼c⋅D−1/2。数据乱,学起来就费劲。 - Stochastic learning algorithm, noisy data:
; here the irreducible loss is the residual error that a stochastic learner cannot reduce further, for example when the model runs out of capacity on large data. All four types of learning curves follow a power law:随机算法,数据有噪:ϵ∼c⋅D−1+E。E 是消不掉的残差,比如模型容量到头了。四种曲线,都走幂律。
where
One of the earliest empirical studies by Hestness et al. (2017) explained the relationship between generalization error, model size and data. For a given training data size, they identified the best-fit model size via grid search and then plotted loss against training dataset size. Across four different domains in deep learning (neural machine translation, image classification, language modeling, and speech recognition), a recurring pattern was observed where:2017 年,Hestness 等人做了早期的实证研究,理清了误差、模型大小、数据量三者的关系。他们用网格搜索找最优模型,再画出损失随数据量的变化。在神经翻译、图像分类、语言模型、语音识别四个领域,规律反复出现:
- Generalization error scales as a power law across a set of factors (e.g. data size).泛化误差随数据量等因素,呈幂律变化。
- Model improvements shift the error curve but do not seem to affect the power-law exponent.模型改进能平移误差曲线,但改不了幂律指数。
- Interestingly, architecture changes the offset (
) of the power-law fit but does not change the exponent ( ). The slope of the power law appears to be a property of the problem domain rather than the model architecture.架构变了,幂律的截距 E 会变,但指数 α 不变。斜率是问题本身的属性,跟模型架构没关系。 - The number of model parameters
needed to fit a dataset of size also scales as a power law.要拟合 D 大小的数据集,需要的参数量 N,也符合幂律。
A conceptual illustration breaks the learning curve into three stages. In the small-data region, when there are not enough learning signals, the model performs only slightly better than random guessing. In the middle (“power-law region”), we observe a power-law relationship between loss, data, and model size. The final irreducible-error region can be attributed to factors such as noise in the data.学习曲线分三段。数据少时,信号不足,模型跟瞎猜差不多。中间是“幂律区”,损失、数据、模型大小呈幂律关系。最后是“不可约误差区”,多半是数据噪声闹的。
Rosenfeld et al. (2020) pushed this further by trying to model error as a joint function of both model size
which can be combined into a joint form:合在一起就是:
where
Thus, they can build a prediction model in the form of a simple parametric function with
Side note: These early works lean on classical learning-theory intuition like the VC dimension (the cardinality of the largest set of points a model can shatter) as a proxy for capacity, but in modern deep learning work the VC dimension is often too coarse to explain the behavior and the empirical power laws turned out to be much cleaner and more practical than the worst-case bounds that theory provides.注:早期工作爱用 VC 维(衡量模型容量)做理论支撑。但在现代深度学习里,VC 维太粗,解释不了现象。实证出来的幂律,比理论上的最坏情况界限要干净、实用得多。
Scaling Laws in Data-Infinite Region数据无限区域的缩放定律#
Kaplan et al.’s Scaling LawsKaplan 等人的缩放定律#
Kaplan et al. (2020) popularized the concept of scaling laws in the language modeling community. They found that the cross-entropy test loss
List of key findings:核心发现:
- The loss
scales as a power law with , , and individually; for optimal performance all three must scale in tandem.L 随 N、D、C 单独呈幂律。想效果好,三者得一块儿涨。 - Training curves follow predictable power laws whose parameters are roughly independent of model size.训练曲线遵循幂律,参数基本不随模型大小变。
- Larger models are more sample-efficient, meaning that they reach a given loss with fewer optimization steps and fewer data points than small models.大模型更省样本。同样的损失,大模型用的步数和数据更少。
- Architectural details (width, aspect ratio, etc.) matter less than sheer scale.架构细节(宽度、长宽比等)没规模重要。
- Train loss and test loss are positively correlated. (Sounds trivial but this is the foundation for pretraining work. On the other hand, whether pretraining loss improvement transfers to posttraining evaluation needs separate studies.)训练损失和测试损失正相关。这听着废话,却是预训练的基石。至于预训练损失降了,下游任务能不能好,得另说。
- Given a fixed compute budget, it is more efficient to train a very large model and stop before convergence than to train a smaller model all the way to convergence. This finding is where the Chinchilla scaling laws (the next section) disagree: Kaplan et al. overestimated the optimal model size as their fitted exponent was larger.算力固定时,练个超大模型,半途而废,比练个小模型练到收敛要划算。Chinchilla 论文不同意这点,认为 Kaplan 高估了最优模型大小。
They summarize the joint dependence on
A nice consequence of this form is that the extent of overfitting (i.e. model is complex or data is small) depends predominantly on the ratio
The most influential and, in hindsight, most contested conclusion was the compute-optimal allocation. Kaplan et al. found
Another useful analysis in Kaplan et al. approximates the number of training FLOPs needed based on
Given a standard config where
Then we count backward-pass FLOPs as twice the forward-pass FLOPs, because backpropagation runs two matrix multiplications, for gradients with respect to the input activations and the weights, respectively. Thus, in total, the training FLOPs per token are approximately
Chinchilla Scaling LawsChinchilla 缩放定律#
The Chinchilla paper (Hoffmann et al. 2022) studied the relationship between the optimal model size
The central question is on the best strategy to allocate resources given a constraint
The Chinchilla paper presented three neatly designed methods for scaling laws fitting.Chinchilla 论文给了三种拟合方法。
The empirical experiments scanned over 400 models, with sizes from 70M to over 16B parameters and training tokens from 5B to 500B. The experiments were under the assumption that every training token is unique (the infinite-data regime). All runs used a cosine learning-rate schedule decaying by 10x over the training horizon. Sweeping over model sizes traces out the compute-optimal frontier.实验跑了 400 多个模型,参数从 7000 万到 160 亿,token 从 50 亿到 5000 亿。假设所有 token 都不重复。余弦衰减调学习率。扫一遍模型大小,就能画出算力最优边界。
Method 1: Fix model sizes, vary the token budget方法 1:固定模型大小,变数据量#
For each parameter count
Method 2: IsoFLOP profiles方法 2:等算力曲线(IsoFLOP)#
Fix a compute budget
Method 3: Parametric fit方法 3:参数拟合#
Fit the same parametric function as in Rosenfeld et al. (2020) directly,直接拟合 Rosenfeld 那套函数。
We can actually get a closed form approximation of optimal
First let’s reduce the expression to contain only
When
To find the optimal
Chinchilla arrives at its answer through three complementary methods whose final results agree with each other, and this is part of why the result was quite convincing.三种方法结论一致,这让结果很有说服力。
The claim in the Chinchilla paper that most large models (at the time, ~2022) were undertrained is supported by a famous demonstration: under the same compute budget as Gopher (Rae et al. 2021; 280B parameter count, 300B token budget), they trained Chinchilla (70B parameter count, 1.4T token budget), a model 4x smaller but trained on roughly 4x more tokens and it outperformed Gopher across the board.Chinchilla 证明大模型练不够:他们用 Gopher(2800 亿参数,3000 亿 token)同样的算力,练了 Chinchilla(700 亿参数,1.4 万亿 token)。模型小了 4 倍,数据多了 4 倍,效果全面吊打 Gopher。
Reconciling Kaplan and Chinchilla调和 Kaplan 与 Chinchilla#
The Chinchilla scaling laws disagree with Kaplan et al. as follows:Chinchilla 这么反驳 Kaplan:
- Instead of “grow the model faster than the data” (
), for every doubling of model size, you should also double the number of training tokens ( ).别“模型长得比数据快”(Nopt∝C0.73),模型翻倍,数据也得翻倍(Nopt∝C0.5)。 - Instead of “train a big model and stop before convergence,” you should train a smaller model on more data.别“大模型练半截就停”,练小一点,多喂数据。
Both papers still agree on the same underlying principle, but they disagree on where the optimal size-vs-token tradeoff lies. Why do they disagree so much?原理一致,结论打架。为什么?
Difference 1: Kaplan et al. experimented mostly on small models. Kaplan et al. experimented mostly on smaller models, while the Chinchilla paper’s experiments reached more than 10x larger scales. When we extrapolate in log-log space, a small difference in the fit can result in large differences (See toy simulation).差异 1:Kaplan 实验模型太小。Kaplan 跑的是小模型,Chinchilla 规模大 10 倍。对数空间里,拟合的一点点偏差,外推后差之千里。
Difference 2: Embedding parameter count matters for small models.
In the small-parameter regime, embedding parameters are a non-negligible fraction of the total and thus counting them or not matters. Pearce & Song (2024) did a thorough analysis along this line. Let’s use
- Kaplan et al.:
(non-embedding)Kaplan:N∖E∗∝C∖E0.73 - Chinchilla:
(total)Chinchilla:N∗∝C0.50(总参数)
To bridge them, they fit a relationship between total parameters
This form has nice properties of being strictly increasing and
Plugging this into the Chinchilla laws equation,代入 Chinchilla 方程:
The relationship between
As shown in the visualization above, as
Why power law?为什么是幂律?#
Power laws are widely observed across many domains outside AI, such as in Zipf’s law, scale-free networks, urban scaling laws, and many other complex systems. The recurring pattern is that large events are rare, small events are common and the relationship between size and frequency often follows a straight line at log-log scale.幂律在 Zipf 定律、网络科学、城市规模里到处都是。大事件少,小事件多,对数坐标下就是直线。
Why do LLM scaling laws also have the shape of a power law?LLM 为什么也这样?
Inspired partly by different domains displaying different exponents (Hestness et al. 2017), one early explanation by Sharma & Kaplan (2020) hypothesizes that language modeling can be viewed as doing regression on a low-dimensional manifold of data. More model parameters can induce a finer partition of the data manifold and therefore smaller generalization error. In the simplest terms, if a model of effective size
A later hypothesis (Michaud et al. 2023, Brill 2024) assumes that knowledge or skills are learned in discrete chunks (“quantized”) and that the frequency distribution of these skills follows a power law. The model learns common skills first and rare skills later, resulting in a smooth power-law decay in loss.后来有人猜(Michaud 等人,2023):知识是离散的“块”,频率分布符合幂律。模型先学常见的,再学罕见的,损失就平滑下降。
I only listed two hypotheses here, but there are more studies on explaining the shape of power-law scaling through spectral tails of data, kernel eigenvalues, natural-language statistics, or phase transitions in training dynamics.还有人从数据谱特征、核特征值、自然语言统计等角度解释。学问多着呢。
Scaling Laws in Data-Limited Region数据受限区域的缩放定律#
Classic scaling laws assume effectively unlimited unique data, no repetition, and no multi-epoch training. As the model size grows significantly, we are running out of enough high-quality unique tokens. In fact, some arguments about how long scaling in AI can continue are centered on whether we are hitting a “data wall”.经典定律假设数据无限、无重复、不跑多轮。现在数据快用完了,这就是“数据墙”。
It is also worth emphasizing that the dataset behind
The study by Hernandez et al. (2022) focused on a controlled version: a mostly-unique dataset with a small fraction of repeated data. Starting from a large dataset, the data mix keeps 90% non-repeated but replaces the remaining 10% with repeats of a tiny portion of the original. By training a Transformer model for 100B tokens, they observed a double-descent phenomenon, that is, the test loss can actually get worse and then better again as a function of how much the repeated data is emphasized, an effect that becomes more pronounced as the repeated fraction grows.Hernandez 等人 (2022) 做了受控实验:90% 不重复,10% 重复。跑 1000 亿 token,发现“双下降”现象:重复数据一多,测试损失先坏再好。
The flat or increasing trend in the middle of training is possibly due to memorization of repeated data. Learning curves with such shapes make scaling law fitting less accurate. They also concluded repeated data hurts some OOD evaluation and downstream fine-tuning. However, their data mix is constructed in a more lab-like setup, and repetition in real-world data is often more nuanced (e.g. different data has different levels of repetition, semantic repetition, etc.).中间平坦或上升,可能是记住了重复数据。这让缩放定律拟合不准。重复数据还伤下游微调。但现实里的重复比实验室里复杂得多。
Rather than saying data repetition hurts training, we are more interested in how to fit scaling laws, given that the unique high-quality data is not infinite and we likely have to repeat data during training.数据有限,不得不重复,怎么拟合定律?
Muennighoff et al. (2023) took on the research question of how compute should be allocated optimally when model training is data-constrained. Specifically, they empirically studied the impact of data repetition across roughly 400 experiments, 10M–9B parameters, data sizes up to 900B tokens, and up to 1500 epochs. The exact same dataset is repeated each epoch, shuffled between epochs, and evaluated on a held-out test set.Muennighoff 等人 (2023) 研究了重复数据下的算力分配。跑了 400 多个实验,数据量到 9000 亿,最长跑 1500 轮。
The key modeling adjustment is to decompose the total token count
They then update the Chinchilla parametric fit (method 3) to use effective (discounted) data
The intuition is that a token’s value decays exponentially as it is repeated. In their modeling, each repetition costs the token a
A symmetric formulation handles excess model size,
Their empirical fit finds that excess parameters decay faster in value than repeated data,
Most recently, Lovelace et al. (2026) revisited the same problem with a different approach. Rather than modeling overparameterization as a diminishing return on effective model size, Lovelace et al. model the interaction between model size
When they plot the fit residual for a fixed model size across a range of data-repetition levels, the observation is intuitive: more epochs cause more damage, and interestingly larger models are more sensitive to repetition. This hints that the loss penalty is likely a function of both model size and data size.数据重复越多,模型越大,过拟合越严重。损失惩罚是两者的函数。
An explicit overfitting penalty term was introduced and built around the capacity ratio
where:其中:
is the repetition count;RD 是重复次数;- the scalar
is a learnable parameter;P 是可学习参数; - the exponent
(the 2nd learnable parameter) lets the penalty scale nonlinearly with the capacity ratio ;κ 让惩罚与容量比非线性相关; - the separate exponent
(the 3rd learnable parameter) on the repetition count decouples repetition nonlinearity from .δ 解耦了重复非线性。
The added term (in red) is a direct overfitting penalty that grows with both how many times you repeat the data and how over-parameterized the model is relative to the unique data available.红色的加项,直接反映了重复数据和过拟合带来的惩罚。
They also did a case study on how weight decay impacts training with the limited-data constraint and found that strong weight decay reduces the overfitting penalty caused by data repetition.他们还发现,强权重衰减能缓解重复数据带来的过拟合。
Both modeling approaches by Muennighoff et al. and Lovelace et al. are constructed from empirical curve fitting, so it is still unclear why data-constrained scaling laws should have exactly these forms and why each free parameter is needed. Curious about more theoretical work along this line.这俩模型都是经验拟合,理论依据还不够。期待更多理论研究。
Trickiness of Fitting Scaling Laws in Reality现实中拟合缩放定律的坑#
Despite its clean form, in practice, scaling law fitting can be surprisingly sensitive to seemingly trivial procedural choices, like how you count parameters, how you round the precision, how you sum or average the loss, etc.定律虽美,但参数怎么算、精度怎么取、损失怎么平均,都会影响结果。
Because a scaling law is only fit on the (relatively small, relatively cheap) models that we can afford to train, and the prediction is extrapolated for a model orders of magnitude larger. In such a setup, choices that look like rounding error may lead to wild differences in prediction.因为定律是在小模型上拟合的,外推到大模型,一点点舍入误差,结果就差出十万八千里。
Meanwhile, scaling-law fitting assumes the only changing factor is scale, which means that the model architecture, optimizer, learning rate schedule, batch ramp, data mix, tokenizer, and other design choices should remain the same. Another underlying assumption is that all these settings should have been carefully tuned, as cases like undertrained models can lead to a different conclusion.拟合假设只有规模在变,架构、优化器、学习率、数据混合都得死死固定。要是模型没练透,结论全错。
The disagreement between results by Kaplan et al. and Chinchilla is one example to showcase the trickiness of scaling laws fitting.Kaplan 和 Chinchilla 的打架就是个例子。
A second example is a follow-up analysis investigating why Chinchilla method 3 is slightly off from the other two methods. Besiroglu et al. (2024) extracted the raw
- A high loss scale in the L-BFGS-B minimizer, caused by averaging Huber-loss values over examples instead of summing them, which led to premature termination of the optimization. The early stopping of loss minimization during both the original fit and bootstrapping produced inconsistent estimates and implausibly narrow confidence intervals.Huber 损失平均方式不对,导致优化器提前停止。拟合出的置信区间窄得离谱。
- The reported
and were rounded to 2 digits of precision, which made the derived look more off than they really were.α 和 β 舍入精度太低,导致 A、B 偏差。
Toy simulation模拟演示#
Here is a toy simulation widget, created by ChatGPT, designed to demonstrate three specific failure modes.ChatGPT 做的模拟器,演示三个翻车点。
We assume the ground truth function is:假设真理函数是:
and thus
The simulation plots the loss prediction
- Loss precision: rounding losses from high to low decimal points can change the fitted parameter values.损失精度:舍入位数变了,拟合参数就变。
- Loss noise: perturbing loss values by only a multiplier of milli-loss (0.001) units leads to different fit.损失噪声:扰动一点点,拟合结果就乱。
- Fit-region sensitivity: fitting only small models, only medium models, or all models gives different apparent scaling laws.拟合区域:只用小模型、只用中模型或全用,结论都不一样。
Citation引用#
Please cite this work as:引用本文,请写:
Weng, Lilian. "Scaling Laws, Carefully". Lil'Log (Jun 2026). https://lilianweng.github.io/posts/2026-06-24-scaling-laws/
Or use the BibTex citation:或用 BibTex 格式:
@article{weng2026scaling,
title = {Scaling Laws, Carefully},
author = {Weng, Lilian},
journal = {lilianweng.github.io},
year = {2026},
month = {June},
url = "https://lilianweng.github.io/posts/2026-06-24-scaling-laws/"
}
References参考文献
[1] S. Amari, N. Fujita, and S. Shinomoto. “Four Types of Learning Curves. Neural Computation.” 4(4):605–618, 1992.[1] S. Amari, N. Fujita, S. Shinomoto. “Four Types of Learning Curves. Neural Computation.” 4(4):605–618, 1992.
[2] Hestness et al. “Deep Learning Scaling is Predictable, Empirically.” arXiv preprint arXiv:1712.00409, 2017.[2] Hestness 等. “Deep Learning Scaling is Predictable, Empirically.” arXiv preprint arXiv:1712.00409, 2017.
[3] Rosenfeld et al. “A Constructive Prediction of the Generalization Error Across Scales.” ICLR 2020.[3] Rosenfeld 等. “A Constructive Prediction of the Generalization Error Across Scales.” ICLR 2020.
[4] Kaplan et al. “Scaling Laws for Neural Language Models.” arXiv preprint arXiv:2001.08361, 2020.[4] Kaplan 等. “Scaling Laws for Neural Language Models.” arXiv preprint arXiv:2001.08361, 2020.
[5] Hoffmann et al. “Training Compute-Optimal Large Language Models.” NeurIPS 2022.[5] Hoffmann 等. “Training Compute-Optimal Large Language Models.” NeurIPS 2022.
[6] Pearce and Song. “Reconciling Kaplan and Chinchilla Scaling Laws.” TMLR 2024.[6] Pearce, Song. “Reconciling Kaplan and Chinchilla Scaling Laws.” TMLR 2024.
[7] Bahri et al. “Explaining Neural Scaling Laws.” arXiv preprint arXiv:2102.06701, 2021.[7] Bahri 等. “Explaining Neural Scaling Laws.” arXiv preprint arXiv:2102.06701, 2021.
[8] Sharma and Kaplan. “A Neural Scaling Law from the Dimension of the Data Manifold.” arXiv preprint arXiv:2004.10802, 2020.[8] Sharma, Kaplan. “A Neural Scaling Law from the Dimension of the Data Manifold.” arXiv preprint arXiv:2004.10802, 2020.
[9] Hernandez et al. “Scaling Laws and Interpretability of Learning from Repeated Data.” arXiv preprint arXiv:2205.10487, 2022.[9] Hernandez 等. “Scaling Laws and Interpretability of Learning from Repeated Data.” arXiv preprint arXiv:2205.10487, 2022.
[10] Muennighoff et al. “Scaling Data-Constrained Language Models.” NeurIPS 2023.[10] Muennighoff 等. “Scaling Data-Constrained Language Models.” NeurIPS 2023.
[11] Lovelace et al. “Prescriptive Scaling Laws for Data Constrained Training.” arXiv preprint arXiv:2605.01640, 2026.[11] Lovelace 等. “Prescriptive Scaling Laws for Data Constrained Training.” arXiv preprint arXiv:2605.01640, 2026.
[12] Besiroglu et al. “Chinchilla Scaling: A Replication Attempt.” arXiv preprint arXiv:2404.10102, 2024.[12] Besiroglu 等. “Chinchilla Scaling: A Replication Attempt.” arXiv preprint arXiv:2404.10102, 2024.
[13] Michaud et al. “The Quantization Model of Neural Scaling” NeurIPS 2023.[13] Michaud 等. “The Quantization Model of Neural Scaling” NeurIPS 2023.
[14] Brill. “Neural Scaling Laws Rooted in the Data Distribution.” arXiv preprint arXiv:2412.07942, 2024.[14] Brill. “Neural Scaling Laws Rooted in the Data Distribution.” arXiv preprint arXiv:2412.07942, 2024.
[15] Rae et al. “Scaling Language Models: Methods, Analysis & Insights from Training Gopher.” arXiv preprint arXiv:2112.11446, 2021.[15] Rae 等. “Scaling Language Models: Methods, Analysis & Insights from Training Gopher.” arXiv preprint arXiv:2112.11446, 2021.