Part V · 第 21 章 专题 · 21.2Part V · Ch. 21 Special Topics · 21.2

Scaling LawScaling Laws

把数据、参数或算力加大 10 倍,损失会降多少?在很宽的范围里,答案是一条幂律:在双对数坐标上是一条直线,每多 10 倍,损失乘上同一个因子。本节先说明幂律从哪里来(数据要把输入空间“填满”),再在浏览器里现场训练一族大小不同的网络,看它们的前沿连成直线;然后学习怎样拟合和外推 scaling law、为什么外推会出错、算力固定时参数和数据该怎么分(Kaplan 与 Chinchilla 之争)、“涌现能力”是不是指标造成的错觉,最后回到机器人最大的瓶颈:数据。 Make the data, the parameters or the compute 10 times larger: how much does the loss fall? Over a wide range the answer is a power law: a straight line on log-log axes, where every factor of 10 multiplies the loss by the same factor. This lesson first shows where power laws come from (data has to "fill" the input space), then trains a family of networks of different sizes live in your browser and lets you watch their frontier line up into a straight line. Then: how to fit and extrapolate a scaling law and why extrapolation fails, how to split a fixed compute budget between parameters and data (the Kaplan versus Chinchilla debate), whether "emergent abilities" are an artefact of the metric, and finally the robot's biggest bottleneck: data.

约 45 分钟~45 min 前置:16.2 损失、泛化与正则化 · 1.13 最小二乘与伪逆 · 17.3 Transformer 与 AttentionPrereqs: 16.2 Losses, generalization & regularization · 1.13 Least squares & the pseudo-inverse · 17.3 Transformers & attention 6 个交互6 interactives

    1为什么机器人需要它Why robots need this

    假设你的团队有一笔预算:可以再采 1 万条遥操作示教,可以把策略网络放大 10 倍,也可以买更多 GPU 把现有模型训练得更久。三件事都花钱,花的还是不同的钱:示教花的是人的时间,网络放大花的是训练和机器人上的推理算力,训练更久花的是集群时间。你想在花钱之前知道哪一项最划算。

    语言和视觉模型过去几年的一个重要发现是:测试损失随数据量 \(D\)、参数量 \(N\) 和训练算力 \(C\) 的变化,在好几个数量级的范围里都非常规律,近似是幂律 \(L\propto N^{-\alpha}\)。这种规律叫 scaling law。有了它,就能用一串小规模实验拟合出直线,再外推到大规模,预测大模型的损失、决定参数和数据的配比。GPT-3、Chinchilla 这样的大模型就是这样规划出来的。

    对机器人,这个问题更尖锐:机器人数据极其昂贵(每一条示教都要人花几十秒到几分钟去遥操作,22.3 节),模型还要在机器人自己的计算机上以控制频率实时运行。16.2 节讨论的是“给定数据,怎样泛化得好”;本节问的是下一个问题:多给多少数据、多大的模型,能换来多少进步,以及这种预测什么时候会失灵。

    Suppose your team has a budget: you could collect 10,000 more teleoperated demonstrations, make the policy network 10 times larger, or buy more GPUs and train the current model longer. All three cost money, and different kinds of money: demonstrations cost human time, a bigger network costs training compute and inference compute on the robot, longer training costs cluster time. You want to know which is the best deal before you spend.

    One of the key findings for language and vision models in recent years is that the test loss depends on the amount of data \(D\), the number of parameters \(N\) and the training compute \(C\) in a remarkably regular way over many orders of magnitude, approximately as a power law \(L\propto N^{-\alpha}\). Such a regularity is called a scaling law. With one, you can fit a straight line to a series of small experiments, extrapolate it to large scale, predict a large model's loss and decide the ratio of parameters to data. Large models such as GPT-3 and Chinchilla were planned this way.

    For robots the question is sharper: robot data are extremely expensive (each demonstration takes a person tens of seconds to minutes of teleoperation, Lesson 22.3), and the model has to run in real time at control rate on the robot's own computer. Lesson 16.2 asked "given the data, how do we generalize well"; this lesson asks the next question: how much progress do more data and a bigger model buy, and when does that prediction break down.

    2直觉:幂律从哪里来Intuition: where power laws come from

    先看幂律长什么样。如果 \(L=A\,n^{-\alpha}\),两边取对数得 \(\log L=\log A-\alpha\log n\):在双对数坐标上是一条直线,斜率是 \(\hl{slope}{-\alpha}\)。它的含义是“每多 10 倍数据,损失乘以 \(10^{-\alpha}\)”,不管你现在在哪个位置。\(\alpha=1\) 时 10 倍数据换来 10 倍更低的损失;\(\alpha=0.1\) 时只换来 1.26 倍,想把损失降一半要多 1000 倍的数据。指数 \(\alpha\) 就是“规模的回报率”。

    为什么会是幂律?一个能完全看清楚的例子:机器人要从样本里学一个光滑函数(比如某种状态下的抓取质量),而它用最简单的办法:最近邻,查询时直接返回离它最近的那个训练样本的值。误差有多大,取决于最近的样本有多远。如果 \(n\) 个样本均匀撒在一个 \(d\) 维的单位立方体里,每个样本“管辖”的体积约为 \(1/n\),对应的边长(也就是到最近样本的典型距离)\(h\propto n^{-1/d}\)。光滑函数的误差正比于距离,平方误差正比于 \(h^2\propto n^{-2/d}\):一条幂律,指数由输入空间的维数决定。

    下图在 \(d=1,2,4,8\) 维里做这个实验(目标函数是 \(d\) 个正弦之和,样本和测试点都均匀随机)。拖动 \(n\),看左边的几何和右边的双对数曲线。

    First, what a power law looks like. If \(L=A\,n^{-\alpha}\), taking logs gives \(\log L=\log A-\alpha\log n\): a straight line on log-log axes, with slope \(\hl{slope}{-\alpha}\). It means "every 10 times more data multiplies the loss by \(10^{-\alpha}\)", wherever you are now. With \(\alpha=1\), 10 times the data buys a 10 times lower loss; with \(\alpha=0.1\) it buys only a factor of 1.26, and halving the loss takes 1000 times more data. The exponent \(\alpha\) is the "return on scale".

    Why a power law? An example you can see completely: a robot learns a smooth function from samples (say the grasp quality as a function of the state), and it uses the simplest method there is: nearest neighbour, which answers a query with the value of the closest training sample. The error depends on how far away that closest sample is. If \(n\) samples are spread uniformly in a \(d\)-dimensional unit cube, each sample "owns" a volume of about \(1/n\), whose side length (the typical distance to the nearest sample) is \(h\propto n^{-1/d}\). For a smooth function the error is proportional to the distance, so the squared error is proportional to \(h^2\propto n^{-2/d}\): a power law, with an exponent set by the dimension of the input space.

    The figure below runs this experiment in \(d=1,2,4,8\) dimensions (the target is a sum of \(d\) sines; samples and test points are uniform at random). Drag \(n\) and watch the geometry on the left and the log-log curves on the right.

    FIG 1数据要把空间填满:最近邻误差 ∝ \(n^{-2/d}\),维数越高,直线越平Data must fill the space: nearest-neighbour error ∝ \(n^{-2/d}\), and the higher the dimension, the flatter the line
    左:\(d=1\) 时画的是青色的真实函数、琥珀色的最近邻预测(阶梯)和样本:底边的蓝色短竖线标出每个样本的位置(\(n\le300\) 时曲线上也画出蓝点);\(d\ge2\) 时画的是样本在前两个坐标 \((x_1,x_2)\) 上的投影(蓝点),14 个测试点(琥珀色空心圈)各用一条琥珀色线段连到它在全部 \(d\) 维里的最近样本。右:300 个测试点上的均方误差随 \(n\) 的变化(双对数):红 \(d=1\),绿 \(d=2\),蓝 \(d=4\),紫 \(d=8\);当前维数画得更粗,同色虚线是斜率 \(-2/d\) 的理论直线,灰色竖线是当前的 \(n\)。样本是嵌套的:\(n\) 增大时只添加新样本,不重抽。 Left: for \(d=1\), the cyan true function, the amber nearest-neighbour prediction (a staircase) and the samples: blue ticks along the bottom mark each sample's position (with blue dots on the curve too while \(n\le300\)); for \(d\ge2\), the samples projected onto their first two coordinates \((x_1,x_2)\) (blue dots), and 14 test points (hollow amber rings), each joined by an amber segment to its nearest sample in all \(d\) dimensions. Right: the mean squared error over 300 test points against \(n\) (log-log): red \(d=1\), green \(d=2\), blue \(d=4\), purple \(d=8\); the current dimension is drawn thicker, the dashed line of the same colour is the theoretical slope \(-2/d\), and the grey vertical line marks the current \(n\). The samples are nested: increasing \(n\) only adds new samples, nothing is redrawn.
    试一试Try this
    • 选 \(d=1\),把 \(n\) 拖到 1024 或更多:误差比 \(n=16\) 时低了约 2000 倍,拟合斜率约 −2.02(数据翻倍,误差变成四分之一)。Choose \(d=1\) and drag \(n\) to 1024 or more: the error is about 2000 times lower than at \(n=16\), with a fitted slope of about −2.02 (double the data, a quarter of the error).
    • 选 \(d=8\),把 \(n\) 拖到最右端 4096:相对 \(n=64\) 多了 64 倍数据,误差只降了约 2.6 倍(理论 \(64^{1/4}\approx2.8\)),离最近样本的平均距离仍有 0.31(立方体边长是 1)。看左图:最近邻在投影上几乎是随机的。Choose \(d=8\) and drag \(n\) all the way to 4096: 64 times the data of \(n=64\) cuts the error only about 2.6 times (theory \(64^{1/4}\approx2.8\)), and the mean distance to the nearest sample is still 0.31 (the cube has side 1). Look left: in the projection the nearest neighbours look almost random.

    拟合斜率(\(n\) 从 64 到 4096):\(d=1\) 为 −2.02,\(d=2\) 为 −1.03,\(d=4\) 为 −0.53,\(d=8\) 为 −0.24,几乎正好是 \(-2/d\)。换成“要把误差降到十分之一需要多少倍数据”:\(d=1\) 约 3 倍,\(d=2\) 10 倍,\(d=4\) 100 倍,\(d=8\) 一万倍。这就是维数灾难的定量形式。

    这个玩具模型抓住了真实 scaling law 的两个要点。第一,指数取决于数据的内在维数(数据实际占据的流形的维数),而不是原始输入的维数:一张 224×224 的图像有 15 万个像素,但同一个场景的图像只在一个低得多的维度里变化。Sharma 与 Kaplan(2022)论证了神经网络的指数近似为 \(4/d\)(网络是分段线性的近似器,误差 \(\propto h^2\),比最近邻的 \(\propto h\) 好一阶)。第二,指数通常很小:语言模型的实测指数在 0.05 到 0.1 左右(第 7 节),对应很高的内在维数,所以每一点进步都需要成倍的规模。机器人的情况类似:物体、位姿、光照、背景、本体……决定动作的因素很多,所以机器人数据的“填满”格外困难(第 8 节)。

    Fitted slopes (for \(n\) from 64 to 4096): −2.02 for \(d=1\), −1.03 for \(d=2\), −0.53 for \(d=4\), −0.24 for \(d=8\), almost exactly \(-2/d\). In terms of "how many times more data to cut the error tenfold": about 3 times for \(d=1\), 10 for \(d=2\), 100 for \(d=4\), ten thousand for \(d=8\). This is the curse of dimensionality in quantitative form.

    The toy model captures two essentials of real scaling laws. First, the exponent depends on the intrinsic dimension of the data (the dimension of the manifold the data actually occupy), not on the raw input dimension: a 224×224 image has 150 thousand pixels, but images of one scene vary along far fewer dimensions. Sharma and Kaplan (2022) argued that for neural networks the exponent is about \(4/d\) (a network is a piecewise-linear approximator with error \(\propto h^2\), one order better than nearest neighbour's \(\propto h\)). Second, the exponents are usually small: the measured exponents for language models are around 0.05 to 0.1 (Section 7), which corresponds to a high intrinsic dimension, so every bit of progress takes many times the scale. Robots are in a similar position: many factors decide the action (objects, poses, lighting, background, embodiment…), which is why "filling" the space with robot data is especially hard (Section 8).

    核心洞见Key insight

    幂律 = 双对数坐标上的直线 = “每多 10 倍,损失乘以同一个因子”。指数衡量规模的回报率,它由数据的内在维数(以及模型逼近函数的方式)决定,往往很小。所以 scaling law 既是好消息(进步可预测),也是坏消息(进步很贵)。

    Power law = straight line on log-log axes = "every factor of 10 multiplies the loss by the same factor". The exponent measures the return on scale; it is set by the intrinsic dimension of the data (and by how the model approximates functions), and it is usually small. So a scaling law is both good news (progress is predictable) and bad news (progress is expensive).

    3动手:现场训练一族网络,看前沿连成直线Play: train a family of networks live and watch the frontier line up

    最近邻是非参数方法,它的“模型大小”就是数据本身。神经网络有固定数量的参数 \(N\),训练要花算力。Kaplan 等人(2020)的经典做法是:训练一族大小不同的模型,每个都用新鲜数据(每个样本只用一次)训练,把每个模型的测试损失画成训练算力的函数。算力按标准近似 \(C\approx6ND\) 计:每个样本前向约 \(2N\) 次浮点运算(每个参数一次乘一次加),反向约 \(4N\) 次,\(D\) 是见过的样本数。

    下图在浏览器里同时训练 6 个单隐藏层 GELU 网络,宽度 2 到 64(20 到 578 个参数),学习一台两连杆机械臂的逆动力学:输入 6 个数 \((\mathbf q,\dot{\mathbf q},\ddot{\mathbf q})\),输出 2 个关节力矩 \(\boldsymbol\tau=M(\mathbf q)\ddot{\mathbf q}+\mathbf b(\mathbf q,\dot{\mathbf q})\)(8.3 节的模型:每根连杆 1 kg、1 m,质心在中点,重力 9.81 m/s²;力矩除以 12 归一化)。每一步用 16 个新采的样本,Adam,学习率 0.01 按余弦衰减到零,共 6000 步。

    Nearest neighbour is non-parametric: its "model size" is the data itself. A neural network has a fixed number of parameters \(N\), and training it costs compute. The classic recipe of Kaplan et al. (2020): train a family of models of different sizes, each on fresh data (every sample used once), and plot each model's test loss as a function of its training compute. Compute is counted with the standard approximation \(C\approx6ND\): about \(2N\) floating-point operations per sample forward (one multiply and one add per parameter) and about \(4N\) backward, where \(D\) is the number of samples seen.

    The figure below trains 6 one-hidden-layer GELU networks at once in your browser, widths 2 to 64 (20 to 578 parameters), on the inverse dynamics of a two-link arm: 6 inputs \((\mathbf q,\dot{\mathbf q},\ddot{\mathbf q})\), 2 outputs, the joint torques \(\boldsymbol\tau=M(\mathbf q)\ddot{\mathbf q}+\mathbf b(\mathbf q,\dot{\mathbf q})\) (the model of Lesson 8.3: links of 1 kg and 1 m with the centre of mass at the midpoint, gravity 9.81 m/s²; torques divided by 12 to normalize). Each step uses 16 freshly drawn samples, Adam, learning rate 0.01 with cosine decay to zero, 6000 steps in all.

    FIG 26 个网络的学习曲线:小模型先赢,大模型后赢,下包络是一条幂律Learning curves of 6 networks: small models win early, big ones win late, and the lower envelope is a power law
    左:测试均方误差(500 个固定测试点)随训练算力 \(C=6ND\) 的变化,双对数坐标。宽度 2/4/8/16/32/64 依次是 红/琥珀/绿/青/蓝/紫;粗虚线是所有曲线的下包络(每个算力下最好的那个模型);加了传感器噪声时,灰色水平虚线是噪声地板 \(\sigma^2\)。右:每个模型当前的损失随参数量 \(N\) 的变化(双对数),同色实心点;灰色虚线是对它们的直线拟合;加噪声时,空心圈是减去 \(\sigma^2\) 之后的值。训练只在画面可见时进行;每次重置都用固定的随机种子。 Left: the test mean squared error (500 fixed test points) against training compute \(C=6ND\), on log-log axes. Widths 2/4/8/16/32/64 are red/amber/green/cyan/blue/purple; the thick dashed line is the lower envelope of all curves (the best model at each compute); with sensor noise added, the grey horizontal dashed line is the noise floor \(\sigma^2\). Right: each model's current loss against its parameter count \(N\) (log-log), filled dots in the same colours; the grey dashed line is a straight-line fit through them; with noise, the hollow rings are the values minus \(\sigma^2\). Training runs only while the figure is on screen; every reset uses a fixed random seed.
    • 无噪声、余弦学习率,按“训练”直到 6000 步结束:在 \(10^6\) FLOPs 处下包络属于宽度 2 或 4 的小模型,在最大算力处属于宽度 64 的模型。读数里的“包络斜率”约 −0.77(默认种子),“损失-参数斜率”约 −1.07。No noise, cosine learning rate: press "Train" and let it run to the end (6000 steps). At \(10^6\) FLOPs the envelope belongs to a small model (width 2 or 4), at the largest compute to the width-64 model. The readout's "envelope slope" is about −0.77 (default seed) and the "loss–parameter slope" about −1.07.
    • 把传感器噪声设为 σ = 0.05 并训练到结束:最大的模型停在 0.0053 附近,降不到噪声地板 0.0025 以下;损失-参数直线的斜率从 −1.07 变平到约 −0.93,减去 \(\sigma^2\) 后又回到约 −1.11。Set the sensor noise to σ = 0.05 and train to the end: the largest model stops near 0.0053 and cannot go below the noise floor of 0.0025; the loss–parameter line flattens from −1.07 to about −0.93, and subtracting \(\sigma^2\) brings it back to about −1.11.
    • 无噪声,把学习率改成“恒定 0.01”,用默认种子训练到结束:宽度 64 的模型最后反而比宽度 32 的差(约 0.013 对 0.0045),因为恒定学习率下 Adam 的随机抖动没有被衰减掉。No noise, switch the learning rate to "constant 0.01" and train to the end with the default seed: the width-64 model ends up worse than the width-32 one (about 0.013 against 0.0045), because with a constant learning rate Adam's random jitter is never annealed away.

    读图的三个要点。(1) 每条曲线都有平台:开始时所有网络都卡在约 0.5(这大约是目标的方差:只学到了平均值),然后迅速降到 0.09 左右的一个“肩”(占方差大部分的重力项学会了,惯性项和科氏项还没有),再继续下降,最后在一个由容量决定的水平上变平。小模型下降得早,但很快就“装不下”了;大模型每一步更贵,起步慢,但能降得更低。(2) 下包络是“给定算力能达到的最低损失”,它依次经过越来越大的模型,近似是一条直线:在默认种子下从 \(2.5\times10^6\) FLOPs 的 0.094 降到 \(3.2\times10^8\) FLOPs 的 0.0028,斜率约 −0.77(换种子在 −0.65 到 −0.80 之间)。这就是“算力的 scaling law” \(L^\ast(C)\propto C^{-\gamma}\)。(3) 把每个模型训练到最后的损失对 \(N\) 作图,6 个点(0.089、0.053、0.023、0.011、0.0050、0.0027)也近似在一条斜率约 −1.07 的直线上。

    任务 2 揭示了不可约损失:测试目标带噪声时,再大的模型也只能逼近 \(\sigma^2\),曲线在双对数坐标上向上弯,直线拟合的斜率被低估。正确的形式是 \(L=\hl{floor}{E}+A\,N^{-\alpha}\),其中 \(E\) 是数据本身的熵(噪声、真正的随机性),只有 \(L-E\) 才服从幂律。任务 3 是 Kaplan 与 Chinchilla 结论不同的原因之一(第 5 节):超参数,尤其是学习率衰减的长度,必须和每次训练的长度匹配;配错了,大模型显得比实际差,你就会低估规模的回报。

    Three things to read off. (1) Every curve has plateaus: at first all networks sit at about 0.5 (roughly the variance of the targets: they have learned only the mean), then drop quickly to a shoulder near 0.09 (the gravity terms, which carry most of the variance, are learned; the inertial and Coriolis terms are not yet), keep falling, and finally flatten at a level set by their capacity. Small models drop early but soon "run out of room"; big models are more expensive per step and start slower, but go lower. (2) The lower envelope is "the lowest loss reachable with a given compute"; it passes through larger and larger models and is close to a straight line: with the default seed it goes from 0.094 at \(2.5\times10^6\) FLOPs to 0.0028 at \(3.2\times10^8\) FLOPs, a slope of about −0.77 (between −0.65 and −0.80 for other seeds). This is the "scaling law in compute" \(L^\ast(C)\propto C^{-\gamma}\). (3) Plotting each model's loss at the end of training against \(N\), the 6 points (0.089, 0.053, 0.023, 0.011, 0.0050, 0.0027) also lie close to a straight line, with slope about −1.07.

    Task 2 reveals the irreducible loss: when the test targets are noisy, even an infinitely large model can only approach \(\sigma^2\), so the curve bends upward on log-log axes and a straight-line fit underestimates the slope. The right form is \(L=\hl{floor}{E}+A\,N^{-\alpha}\), where \(E\) is the entropy of the data itself (noise, genuine randomness), and only \(L-E\) follows the power law. Task 3 is one reason the conclusions of Kaplan and of Chinchilla differ (Section 5): hyperparameters, above all the length of the learning-rate decay, must match the length of each training run; get that wrong and big models look worse than they are, so you underestimate the return on scale.

    核心洞见Key insight

    单个模型的学习曲线会变平;scaling law 描述的是前沿:每个算力下最好的模型。要测得准,每个规模都必须调好(学习率、衰减长度),并且要把不可约的地板 \(E\) 从幂律里分出来。

    A single model's learning curve flattens; a scaling law describes the frontier: the best model at each compute. To measure it properly every scale must be tuned (learning rate, decay length), and the irreducible floor \(E\) must be separated from the power law.

    4拟合与外推:直线会骗人Fitting and extrapolating: straight lines can lie

    scaling law 的价值在于外推:用便宜的小实验预测昂贵的大实验。做法是1.13 节的最小二乘,在对数空间里做:纯幂律对 \(\log L\) 和 \(\log N\) 拟合一条直线;带地板的形式 \(E+AN^{-\alpha}\) 有三个参数,这里对 \(E\) 做网格搜索、对每个 \(E\) 拟合 \(\log(L-E)\) 的直线,选对数残差平方和最小的那个。在对数空间拟合,是因为不同随机种子之间的波动通常近似是乘性的(下图假设为 1%)。

    下图的数据点来自一个隐藏的“真实规律”,加上 1% 的乘性噪声,每半个数量级一个模型,从 \(10^6\) 到 \(10^{12}\) 个参数。真实规律默认是 Chinchilla 拟合公式中的参数项 \(1.69+406.4\,N^{-0.34}\)(数据无限时的损失)。你只能“看到”拟合范围里的点;任务是预测 \(10^{12}\) 处的损失。

    The value of a scaling law lies in extrapolation: predicting an expensive large experiment from cheap small ones. The method is the least squares of Lesson 1.13, done in log space: the pure power law fits a straight line to \(\log L\) against \(\log N\); the form with a floor, \(E+AN^{-\alpha}\), has three parameters, and here we grid-search \(E\), fit a straight line to \(\log(L-E)\) for each \(E\), and keep the one with the smallest sum of squared log residuals. We fit in log space because the run-to-run variation between random seeds is usually roughly multiplicative (the figure below assumes 1%).

    The data points in the figure below come from a hidden "true law" plus 1% multiplicative noise, one model every half order of magnitude from \(10^6\) to \(10^{12}\) parameters. By default the true law is the parameter term of Chinchilla's fitted formula, \(1.69+406.4\,N^{-0.34}\) (the loss with unlimited data). You only "see" the points inside the fit range; the job is to predict the loss at \(10^{12}\).

    FIG 3外推 scaling law:忽略地板会许诺不存在的进步,范围太窄则什么都定不下来Extrapolating a scaling law: ignore the floor and you are promised progress that does not exist; fit too narrow a range and nothing is pinned down
    左(双对数):蓝色实心点是拟合范围内的测量值,灰色空心圈是范围外(拟合时看不到)的点;紫色的两个竖条把手标出拟合范围的两端,可以拖动。琥珀色是拟合曲线及其外推,琥珀色阴影是 200 次参数自助法(每次重抽每个点的 1% 噪声并重新拟合)在每个 \(N\) 处的 10%–90% 范围;青色虚线是隐藏的真实规律,绿色水平虚线是真实的地板 \(E\)(纯幂律预设中没有);红色竖线是目标 \(N=10^{12}\)。右:200 次自助拟合在 \(10^{12}\) 处的预测值的直方图(琥珀色),青色竖线是真实值。 Left (log-log): filled blue dots are the measurements inside the fit range, grey hollow rings the points outside it (invisible to the fit); the two purple bar handles mark the ends of the fit range and can be dragged. Amber is the fitted curve and its extrapolation, and the amber shading is the 10%–90% range at each \(N\) over 200 parametric bootstrap fits (each redraws every point's 1% noise and refits); the dashed cyan curve is the hidden true law and the green horizontal dashed line the true floor \(E\) (absent in the pure-power-law preset); the red vertical line is the target \(N=10^{12}\). Right: a histogram (amber) of the 200 bootstrap predictions at \(10^{12}\); the cyan vertical line is the true value.
    • 真实规律保持“幂律 + 地板”,拟合范围的右端不超过 \(10^9\),把拟合形式换成“直线(纯幂律)”:在 \(10^{12}\) 处它预测的损失远低于真实值;当它许诺的进步(从最后一个测量点算起)达到真实进步的 2.5 倍以上时任务完成(默认范围 \(10^6\)–\(10^8\) 时为 2.7 倍;只拟合两三个点时比值会小一些)。Keep the true law "power law + floor", keep the right end of the fit range at or below \(10^9\), and switch the fit form to "straight line (pure power law)": at \(10^{12}\) it predicts a loss far below the truth; the task completes once the progress it promises (counted from the last measured point) is at least 2.5 times the real progress (2.7 times with the default range \(10^6\)–\(10^8\); with only two or three points the ratio is smaller).
    • 选真实规律“规律改变”(\(10^9\) 以后幂律指数从 0.34 变成 0.1,好比数据开始不够用),用“幂律 + 地板”拟合一个右端不超过 \(10^9\)、跨度至少两个数量级的范围:真实值落在整个自助法范围之外(高于它)。小规模的数据里没有任何迹象。Choose the true law "regime change" (beyond \(10^9\) the exponent drops from 0.34 to 0.1, as if data started to run short), and fit "power law + floor" to a range that ends at or below \(10^9\) and spans at least two orders of magnitude: the true value lies outside (above) the whole bootstrap range. Nothing in the small-scale data hints at it.

    具体数字(默认噪声种子)。用 \(10^6\)–\(10^8\) 的 5 个点:带地板的拟合在 \(10^{12}\) 处预测 1.70(自助法范围 1.54–1.85),真实值 1.72,很好;同样的点用直线拟合,预测 0.49,因为直线以为损失可以一直降到零。把范围扩大到 \(10^9\),直线的预测变成 0.68,它许诺的进步是真实进步的 5 倍:更多的点并不能挽救错误的函数形式。另一面,如果只拟合一个数量级(比如 \(10^{6.5}\)–\(10^{7.5}\)),带地板的拟合的自助法范围从 0.43 一直到 1.61:三个参数在这么短的直线上根本分不开,地板 \(E\) 尤其定不下来。

    “规律改变”是最危险的情形:小规模的点和默认情形完全一样,任何拟合方法都看不出来,但真实曲线在 \(10^9\) 之后变平了,用 \(10^6\)–\(10^9\) 拟合的地板模型预测 1.63(范围 1.57–1.68),而真实值是 1.87,许诺的进步是实际的 3 倍。现实中这类“断点”确实出现过:数据开始重复、换了一种评测、模型进入了新的工作区间(Caballero 等,2023 把这种形状叫作 broken neural scaling laws)。外推的距离越远,越要怀疑。

    Concrete numbers (default noise seed). With the 5 points from \(10^6\) to \(10^8\): the fit with a floor predicts 1.70 at \(10^{12}\) (bootstrap range 1.54–1.85) against a true 1.72, which is good; a straight line through the same points predicts 0.49, because a straight line believes the loss can fall all the way to zero. Extend the range to \(10^9\) and the straight line predicts 0.68, promising 5 times the real progress: more points cannot rescue the wrong functional form. On the other side, fit only one order of magnitude (say \(10^{6.5}\)–\(10^{7.5}\)) and the bootstrap range of the floor fit runs from 0.43 to 1.61: three parameters cannot be separated on such a short stretch, least of all the floor \(E\).

    The "regime change" is the most dangerous case: the small-scale points are identical to the default case, so no fitting method can see it coming, but the true curve flattens beyond \(10^9\). The floor model fitted on \(10^6\)–\(10^9\) predicts 1.63 (range 1.57–1.68), the truth is 1.87, and the promised progress is 3 times the real one. Such "breaks" do happen in practice: data starts to repeat, the evaluation changes, the model enters a new regime (Caballero et al., 2023 call these shapes broken neural scaling laws). The further you extrapolate, the more suspicious you should be.

    5算力固定时,参数和数据怎么分With fixed compute, how to split it between parameters and data

    算力 \(\hl{iso}{C\approx6ND}\) 是参数量和数据量的乘积。预算固定时,模型大一点就只能少看一些数据,反之亦然。最好的配比是多少?Kaplan 等人(2020)的结论是模型应该比数据长得快得多:\(N_{\rm opt}\propto C^{0.73}\)。两年后 Hoffmann 等人(2022,DeepMind)用 400 多个模型、每个规模都把学习率衰减调到与训练长度匹配,得到了不同的结论:参数和数据应该同比例增长,\(N_{\rm opt}\propto C^{a}\)、\(D_{\rm opt}\propto C^{b}\),\(a\approx b\approx0.5\),相当于每个参数约 20 个 token。他们按这个配比训练了 700 亿参数、1.4 万亿 token 的 Chinchilla,算力与 2800 亿参数、3000 亿 token 的 Gopher 相近,却在大多数评测上更好。

    他们的第三种方法直接拟合 \(L(N,D)=E+A/N^\alpha+B/D^\beta\)。原文给出的系数后来被 Besiroglu 等人(2024)复核时发现与原文的另外两种方法不一致;下图用的是这次复核重新拟合的系数(\(E=1.82\),\(A=482\),\(B=2085\),\(\alpha=0.348\),\(\beta=0.366\)),它给出的最优配比约为每参数 20 个 token,与 Chinchilla 一致。注意:这些数字属于特定的数据集、分词器和模型族(17.5 节),不能直接搬到机器人上,但形状和推理可以。

    Compute \(\hl{iso}{C\approx6ND}\) is the product of parameters and data. With a fixed budget, a bigger model must see less data, and the other way round. What is the best split? Kaplan et al. (2020) concluded that the model should grow much faster than the data: \(N_{\rm opt}\propto C^{0.73}\). Two years later Hoffmann et al. (2022, DeepMind) trained over 400 models, tuning the learning-rate decay at every scale to match the training length, and reached a different conclusion: parameters and data should grow in equal proportion, \(N_{\rm opt}\propto C^{a}\), \(D_{\rm opt}\propto C^{b}\) with \(a\approx b\approx0.5\), which comes to about 20 tokens per parameter. Following that recipe they trained Chinchilla, 70 billion parameters on 1.4 trillion tokens, with about the same compute as Gopher (280 billion parameters, 300 billion tokens), and it did better on most evaluations.

    Their third method fits \(L(N,D)=E+A/N^\alpha+B/D^\beta\) directly. When Besiroglu et al. (2024) re-examined it, the published coefficients turned out to be inconsistent with the paper's other two methods; the figure below uses the coefficients of that re-fit (\(E=1.82\), \(A=482\), \(B=2085\), \(\alpha=0.348\), \(\beta=0.366\)), which give an optimal split of about 20 tokens per parameter, consistent with Chinchilla. Mind that these numbers belong to a particular dataset, tokenizer and model family (Lesson 17.5) and do not carry over to robots as they are; the shape and the reasoning do.

    FIG 4等算力线上的 U 形谷:Chinchilla 式的最优配比,以及机器人上“模型大小有上限”时怎么办The U-shaped valley along an iso-compute line: the Chinchilla-style optimum, and what to do when the robot caps the model size
    左:横轴参数量 \(N\),纵轴训练 token 数 \(D\)(都取对数);底色是损失 \(L(N,D)\),越青 = 越低;灰色斜虚线是等算力线 \(C=10^{18},10^{19},\dots\),紫色斜线是当前点所在的等算力线;琥珀色是最优配比路径 \(N_{\rm opt}(C)\);红色圆是你的配比,可以拖动。打开上限时,蓝色竖线是 \(N\le10^9\)。右:沿等算力线的损失随 \(N\) 的变化(10 的整数次幂的 \(C\) 画成灰色细线,当前 \(C\) 画成紫色),琥珀色点是每条曲线的最低点,红点是你的配比。 Left: parameters \(N\) on the horizontal axis, training tokens \(D\) on the vertical (both logarithmic); the background is the loss \(L(N,D)\), more cyan = lower; grey diagonal dashed lines are iso-compute lines \(C=10^{18},10^{19},\dots\), the purple diagonal is the iso-compute line through the current point; amber is the optimal path \(N_{\rm opt}(C)\); the red disc is your allocation, and it can be dragged. With the cap on, the blue vertical line is \(N\le10^9\). Right: the loss along iso-compute lines as a function of \(N\) (thin grey for whole powers of 10 of \(C\), purple for the current \(C\)); amber dots are the minima of each curve, the red dot is your allocation.
    • 从默认的 Gopher 式配比(2800 亿参数、3000 亿 token,比同算力的最优点差 1.08%)出发,拖动红圆,在算力至少 \(10^{21}\) 的地方让损失与该算力下的最优值相差小于 0.3%。看读数里的 token/参数比:约 20。Starting from the default Gopher-like allocation (280 billion parameters, 300 billion tokens, 1.08% worse than the optimum at the same compute), drag the red disc to a point with at least \(10^{21}\) compute whose loss is within 0.3% of the optimum for that compute. Check the tokens-per-parameter ratio in the readout: about 20.
    • 打开“机器人上限 \(N\le10^9\)”,把红圆放在上限处(\(N\ge5\times10^8\)),把算力推到 \(10^{23}\) 以上:损失降到约 2.2 就停住了(上限下的地板 \(E+A/N^\alpha=2.17\)),而在 \(10^{23}\) 的算力下,不设上限的最优值是 2.03。Turn on the "robot cap \(N\le10^9\)", put the red disc at the cap (\(N\ge5\times10^8\)) and push the compute above \(10^{23}\): the loss stalls at about 2.2 (the floor under the cap, \(E+A/N^\alpha=2.17\)), while the uncapped optimum at \(10^{23}\) is 2.03.

    几个读数。按复核后的公式,最优点的 token/参数比随算力缓慢变化:\(10^{18}\) 时约 26,\(10^{22}\) 时约 20,\(10^{24}\) 时约 18。等算力线上的谷很平:在 Gopher 的算力下,参数量偏离最优值 2 倍(0.3 个数量级),损失只差 0.25%;但 Gopher 的配比偏了约 4 倍,按这个公式,一个最优配比只需要它一半的算力就能达到同样的损失。GPT-3 式的配比(1750 亿参数、3000 亿 token)效率约 61%。

    反过来,“过度训练”一个小模型也有它的道理。Meta 的 Llama 3 8B 用了约 15 万亿 token 训练,远超每参数 20 个 token;按图中的公式,同样的损失用最优配比只要约 18% 的算力。为什么要多花 5 倍多的训练算力?因为推理成本由 \(N\) 决定,而模型要被调用无数次。机器人更是如此:策略必须在机器人自己的计算机上以 10–50 Hz 运行,\(N\) 有硬上限。任务 2 显示了上限的后果:上限下的损失有自己的地板 \(E+A/N_{\max}^\alpha\),再多的数据也越不过去;在到达那个地板之前,把预算花在数据上是对的。

    A few readings. Under the re-fitted formula the optimal tokens-per-parameter ratio drifts slowly with compute: about 26 at \(10^{18}\), about 20 at \(10^{22}\), about 18 at \(10^{24}\). The valley along an iso-compute line is flat: at Gopher's compute, being off the optimal parameter count by a factor of 2 (0.3 orders of magnitude) costs only 0.25% in loss; but Gopher's allocation is off by about a factor of 4, and by this formula an optimal allocation would reach the same loss with half the compute. A GPT-3-like allocation (175 billion parameters, 300 billion tokens) has an efficiency of about 61%.

    Conversely, "over-training" a small model has its reasons. Meta's Llama 3 8B was trained on about 15 trillion tokens, far beyond 20 tokens per parameter; by the formula in the figure an optimal allocation would reach the same loss with about 18% of the compute. Why spend over 5 times the training compute? Because inference cost is set by \(N\), and the model will be called countless times. Robots even more so: the policy must run at 10–50 Hz on the robot's own computer, so \(N\) has a hard cap. Task 2 shows the consequence of the cap: under it the loss has its own floor \(E+A/N_{\max}^\alpha\) that no amount of data can cross; until you reach that floor, spending the budget on data is right.

    6“涌现”是真的吗:指标的作用Is "emergence" real? The role of the metric

    损失平滑下降,可很多能力看起来是突然出现的:模型小于某个规模时某项任务的成功率接近零,越过某个规模后迅速上升。Wei 等人(2022)把这类现象称为涌现能力,并收集了许多例子。Schaeffer、Miranda 与 Koyejo(2023)提出了另一种解释:很多“涌现”来自指标而不是模型。全对才算对的指标(精确匹配、整个任务成功)把平滑的逐步进步变成了陡峭的曲线;换成连续的指标,跳变往往消失。

    机器人上的版本:一个长时程任务(比如收拾桌子)由 \(k\) 个子步骤组成,必须每一步都成功。设每一步的对数损失随规模平滑地按幂律下降 \(\hl{ell}{\ell(N)}=(N/10^7)^{-0.5}\),每一步的成功率 \(\hl{pstep}{p(N)}=e^{-\ell(N)}\),整个任务的成功率是 \(\hl{pk}{p^k}=e^{-k\ell(N)}\)。下图比较三种指标。

    The loss falls smoothly, yet many abilities seem to appear suddenly: below some scale a task's success rate is near zero, beyond it the rate climbs fast. Wei et al. (2022) called such phenomena emergent abilities and collected many examples. Schaeffer, Miranda and Koyejo (2023) proposed another explanation: much "emergence" comes from the metric, not the model. All-or-nothing metrics (exact match, whole-task success) turn smooth step-by-step progress into a steep curve; switch to a continuous metric and the jump often disappears.

    The robot version: a long-horizon task (say clearing a table) consists of \(k\) sub-steps, and every one must succeed. Let the per-step log-loss fall smoothly as a power law in scale, \(\hl{ell}{\ell(N)}=(N/10^7)^{-0.5}\), so each step succeeds with probability \(\hl{pstep}{p(N)}=e^{-\ell(N)}\) and the whole task with \(\hl{pk}{p^k}=e^{-k\ell(N)}\). The figure compares three metrics.

    FIG 5平滑的逐步进步 + 全对才算对的指标 + 稀疏的评测 = 看起来的“涌现”Smooth per-step progress + an all-or-nothing metric + sparse evaluation = apparent "emergence"
    横轴是模型规模 \(N\)(对数)。青色是每一步的量:每步成功率 \(p(N)\),在对数损失视图里则是每步的对数损失 \(\ell(N)\);另一条曲线是所选的指标:红 = 整个任务成功 \(p^k\),绿 = 部分得分(第一次失败前完成的步骤占 \(k\) 的比例的期望),紫 = 整个任务的对数损失 \(k\ell(N)\)(这时纵轴总是对数的,曲线越低越好)。选“7 个模型 × 20 次试验”时,红色方块(只在“整个任务成功”指标下)是在 \(10^6,10^7,\dots,10^{12}\) 处各做 20 次试验得到的成功率,测得 0 的画在底边上(二项分布抽样,种子固定;“重新试验”换一组)。 The horizontal axis is model scale \(N\) (logarithmic). Cyan is the per-step quantity: the per-step success \(p(N)\), or in the log-loss view the per-step log-loss \(\ell(N)\); the other curve is the chosen metric: red = whole-task success \(p^k\), green = partial credit (the expected fraction of the \(k\) steps completed before the first failure), purple = the whole-task log-loss \(k\ell(N)\) (its vertical axis is always logarithmic, and lower is better). With "7 models × 20 trials", the red squares (whole-task success metric only) are the success rates measured with 20 trials at each of \(10^6,10^7,\dots,10^{12}\), with measured zeros drawn on the bottom edge (binomial samples with a fixed seed; "New trials" draws another set).
    • 把步骤数设为 \(k\ge10\),指标选“整个任务成功”,先看线性纵轴(\(k=20\) 时 \(10^{8.5}\) 以下几乎是零),再把纵轴换成对数:成功率早就在上升了(\(k=20\) 时),从 \(2\times10^7\) 附近的百万分之一,到 \(10^8\) 时的千分之二,一路爬升好几个数量级,只是在线性坐标上看不见。Set the number of steps to \(k\ge10\) and the metric to "whole-task success"; look at the linear axis first (for \(k=20\) it is almost zero below \(10^{8.5}\)), then switch the vertical axis to logarithmic: the success rate was rising all along (for \(k=20\)), from one in a million near \(2\times10^7\) to two in a thousand at \(10^8\), climbing through several orders of magnitude that are invisible on a linear scale.

    数字。\(k=20\) 时,任务成功率在 \(N=10^{8.9}\) 达到 10%、在 \(10^{11.6}\) 达到 90%;在这两点,每一步的成功率分别是 0.891 和 0.995:每一步只是从“还不错”变成“几乎完美”,整个任务却从“几乎从不成功”变成“几乎总成功”。“7 个模型 × 20 次试验”的测量值(\(k=20\),默认种子)是 0、0、0、0.10、0.35、0.85、0.95:前三个规模都是 0/20,看上去能力是在 \(10^9\) 附近“出现”的。真正平滑的是对数损失 \(k\ell(N)\),它在双对数坐标上是一条直线,从来没有跳变。

    一个反直觉的细节:在对数横轴上,\(p^k\) 从 10% 升到 90% 跨越的宽度与 \(k\) 无关(这里总是 2.68 个数量级,第 7 节推导),\(k\) 只把整条曲线往右推。所以“越长的任务越陡”并不对,真正的变化是:长任务的上升被推迟到逐步成功率已经很高的区间,而在那之前它一直贴着零。这场争论并没有完全结束:也有研究认为某些能力即使用连续指标也表现出急剧变化。实际的教训是:报告连续指标(对数损失、部分得分),把试验次数和置信区间写清楚,不要用两三个规模的成功率去宣称能力“出现”了。机器人评测常常每个条件只做 10–50 次试验:20 次试验、真实成功率 50% 时,95% 置信区间约为 ±22 个百分点。

    Numbers. For \(k=20\) the task success reaches 10% at \(N=10^{8.9}\) and 90% at \(10^{11.6}\); at those two points the per-step success is 0.891 and 0.995: each step only goes from "fairly good" to "almost perfect", while the whole task goes from "almost never" to "almost always". The "7 models × 20 trials" measurements (\(k=20\), default seed) are 0, 0, 0, 0.10, 0.35, 0.85, 0.95: the first three scales all score 0/20, so the ability seems to "appear" near \(10^9\). What is really smooth is the log-loss \(k\ell(N)\), a straight line on log-log axes that never jumps.

    A counter-intuitive detail: on a logarithmic horizontal axis, the width over which \(p^k\) climbs from 10% to 90% does not depend on \(k\) (here it is always 2.68 orders of magnitude; Section 7 derives it); \(k\) only shifts the whole curve to the right. So "longer tasks are steeper" is not right; what really changes is that the rise of a long task is delayed to where per-step success is already high, and until then it hugs zero. The debate is not entirely settled: some work argues that certain abilities change sharply even under continuous metrics. The practical lesson: report continuous metrics (log-loss, partial credit), state the number of trials and the confidence intervals, and do not claim that an ability "emerged" from success rates at two or three scales. Robot evaluations often run only 10–50 trials per condition: with 20 trials and a true success rate of 50%, the 95% confidence interval is about ±22 percentage points.

    7数学The math

    幂律、局部斜率与地板Power laws, local slopes and floors

    纯幂律 \(L(x)=A\,x^{-\alpha}\)(\(x\) 是 \(N\)、\(D\) 或 \(C\))满足 \(L(\lambda x)=\lambda^{-\alpha}L(x)\):放大 \(\lambda\) 倍,损失乘以 \(\lambda^{-\alpha}\),与起点无关,这种尺度不变性正是它在双对数坐标上是直线的原因。带地板的形式 \(L=\hl{floor}{E}+A\,x^{-\alpha}\) 的局部斜率是

    $$\frac{d\log L}{d\log x}=-\alpha\,\frac{L-E}{L},$$

    远离地板时(\(L\gg E\))接近 \(-\alpha\),接近地板时趋于零:这就是 FIG 2 加噪声后和 FIG 3 里曲线向上弯的原因。在一段有限的范围里用直线去拟合,得到的是这段范围里的平均局部斜率,它系统性地小于 \(\alpha\),而且外推时会一直保持这个斜率,所以会低估地板、高估进步。

    A pure power law \(L(x)=A\,x^{-\alpha}\) (with \(x\) being \(N\), \(D\) or \(C\)) satisfies \(L(\lambda x)=\lambda^{-\alpha}L(x)\): scale up by \(\lambda\) and the loss is multiplied by \(\lambda^{-\alpha}\), wherever you start; this scale invariance is exactly why it is a straight line on log-log axes. The form with a floor, \(L=\hl{floor}{E}+A\,x^{-\alpha}\), has the local slope

    $$\frac{d\log L}{d\log x}=-\alpha\,\frac{L-E}{L},$$

    close to \(-\alpha\) far above the floor (\(L\gg E\)) and tending to zero near it: that is why the curves bend upward in FIG 2 with noise and in FIG 3. A straight line fitted over a finite range measures the average local slope over that range, which is systematically smaller than \(\alpha\), and extrapolation keeps that slope forever, so it underestimates the floor and overestimates the progress.

    在对数空间里拟合Fitting in log space

    设测量值 \(L_i=L(x_i)\,e^{\varepsilon_i}\),\(\varepsilon_i\sim\mathcal N(0,s^2)\)(乘性噪声)。纯幂律的最大似然估计就是 \(y_i=\log L_i\) 对 \(u_i=\log x_i\) 的普通最小二乘(1.13 节):

    $$\hat\alpha=-\frac{\sum_i(u_i-\bar u)(y_i-\bar y)}{\sum_i(u_i-\bar u)^2},\qquad \operatorname{Var}(\hat\alpha)=\frac{s^2}{\sum_i(u_i-\bar u)^2}.$$

    分母是拟合点在 \(\log x\) 上的分散程度:范围窄一半,\(\hat\alpha\) 的标准差大一倍;而外推到距离中心 \(\Delta u\) 处,\(\log L\) 的预测误差约为 \(\Delta u\cdot\mathrm{sd}(\hat\alpha)\),随外推距离线性增长。带地板时 \(\log L=\log(E+Ae^{-\alpha u})\) 对 \(E\) 非线性;FIG 3 对 \(E\) 做网格搜索,对每个 \(E\) 做上面的线性拟合。当拟合范围很窄、\(L-E\) 在范围内变化不大时,\(E\)、\(A\)、\(\alpha\) 几乎可以互相替代(残差几乎一样),这就是 FIG 3 里一个数量级的拟合定不下来的原因。

    Let the measurements be \(L_i=L(x_i)\,e^{\varepsilon_i}\) with \(\varepsilon_i\sim\mathcal N(0,s^2)\) (multiplicative noise). The maximum-likelihood estimate of a pure power law is ordinary least squares of \(y_i=\log L_i\) on \(u_i=\log x_i\) (Lesson 1.13):

    $$\hat\alpha=-\frac{\sum_i(u_i-\bar u)(y_i-\bar y)}{\sum_i(u_i-\bar u)^2},\qquad \operatorname{Var}(\hat\alpha)=\frac{s^2}{\sum_i(u_i-\bar u)^2}.$$

    The denominator is the spread of the fitted points in \(\log x\): halve the range and the standard deviation of \(\hat\alpha\) doubles; and extrapolating to a distance \(\Delta u\) from the centre, the prediction error of \(\log L\) is about \(\Delta u\cdot\mathrm{sd}(\hat\alpha)\), growing linearly with the extrapolation distance. With a floor, \(\log L=\log(E+Ae^{-\alpha u})\) is nonlinear in \(E\); FIG 3 grid-searches \(E\) and does the linear fit above for each \(E\). When the range is narrow and \(L-E\) changes little across it, \(E\), \(A\) and \(\alpha\) can almost substitute for one another (the residuals are almost the same), which is why a one-decade fit in FIG 3 pins nothing down.

    为什么指数是 \(2/d\)Why the exponent is \(2/d\)

    \(n\) 个均匀样本在 \(d\) 维单位立方体里,一个测试点 \(\mathbf x\) 到最近样本的距离 \(r\) 满足 \(P(r>t)=(1-V_dt^d)^n\approx e^{-nV_dt^d}\)(\(V_d\) 是单位球体积),所以 \(r\) 的典型大小是 \((nV_d)^{-1/d}\),\(\mathbb E[r^2]\propto n^{-2/d}\)。对光滑的 \(f\),最近邻的误差 \(f(\mathbf x_{\rm nn})-f(\mathbf x)\approx\nabla f(\mathbf x)^\top(\mathbf x_{\rm nn}-\mathbf x)\),方向随机时其平方的期望是 \(\tfrac1d\|\nabla f\|^2\,\mathbb E[r^2]\),于是

    $$\text{MSE}(n)\propto n^{-2/d}.$$

    分段线性的近似(ReLU 网络、线性插值)的误差是 \(O(r^2)\),平方误差 \(\propto n^{-4/d}\);用 \(N\) 个参数把输入空间分成 \(N\) 块时,同样的论证给出 \(L\propto N^{-4/d}\),这是 Sharma 与 Kaplan(2022)把实测指数与数据流形内在维数联系起来的思路。一般地,函数越光滑、内在维数越低,指数越大。

    With \(n\) uniform samples in a \(d\)-dimensional unit cube, the distance \(r\) from a test point \(\mathbf x\) to its nearest sample satisfies \(P(r>t)=(1-V_dt^d)^n\approx e^{-nV_dt^d}\) (\(V_d\) is the volume of the unit ball), so \(r\) is typically \((nV_d)^{-1/d}\) and \(\mathbb E[r^2]\propto n^{-2/d}\). For a smooth \(f\) the nearest-neighbour error is \(f(\mathbf x_{\rm nn})-f(\mathbf x)\approx\nabla f(\mathbf x)^\top(\mathbf x_{\rm nn}-\mathbf x)\), whose square has expectation \(\tfrac1d\|\nabla f\|^2\,\mathbb E[r^2]\) for a random direction, so

    $$\text{MSE}(n)\propto n^{-2/d}.$$

    A piecewise-linear approximation (a ReLU network, linear interpolation) has error \(O(r^2)\), squared error \(\propto n^{-4/d}\); when \(N\) parameters cut the input space into \(N\) pieces the same argument gives \(L\propto N^{-4/d}\), which is how Sharma and Kaplan (2022) linked measured exponents to the intrinsic dimension of the data manifold. In general, the smoother the function and the lower the intrinsic dimension, the larger the exponent.

    Kaplan 的三条定律Kaplan's three laws

    Kaplan 等人(2020)在 Transformer 语言模型上测得(\(N\) 不计嵌入层参数,损失是每个 token 的交叉熵,单位 nat):

    $$\begin{gathered}L(N)\approx\Big(\frac{N_c}{N}\Big)^{\alpha_N},\ \alpha_N\approx0.076;\qquad L(D)\approx\Big(\frac{D_c}{D}\Big)^{\alpha_D},\ \alpha_D\approx0.095;\\ L(C_{\min})\propto C_{\min}^{-0.050},\end{gathered}$$

    前两条分别是数据无限(训练到收敛)和模型足够大(早停)时的情形,第三条是 FIG 2 那样的算力前沿 \(\hl{front}{L^\ast(C)}\)。三个指数都很小:\(\alpha_N=0.076\) 意味着参数多 10 倍,损失只乘以 \(10^{-0.076}\approx0.84\)。他们还提出了联合形式 \(L(N,D)=\big[(N_c/N)^{\alpha_N/\alpha_D}+D_c/D\big]^{\alpha_D}\),并从对算力高效训练的分析(模型大小与训练步数的联合拟合)得出 \(N_{\rm opt}\propto C^{0.73}\)。这些纯幂律没有地板项,只在测量的范围里成立。

    Kaplan et al. (2020) measured on Transformer language models (with \(N\) excluding embedding parameters and the loss being the per-token cross-entropy in nats):

    $$\begin{gathered}L(N)\approx\Big(\frac{N_c}{N}\Big)^{\alpha_N},\ \alpha_N\approx0.076;\qquad L(D)\approx\Big(\frac{D_c}{D}\Big)^{\alpha_D},\ \alpha_D\approx0.095;\\ L(C_{\min})\propto C_{\min}^{-0.050},\end{gathered}$$

    the first two for unlimited data (trained to convergence) and for large enough models (early-stopped), the third the compute frontier \(\hl{front}{L^\ast(C)}\) as in FIG 2. All three exponents are small: \(\alpha_N=0.076\) means 10 times the parameters multiplies the loss by only \(10^{-0.076}\approx0.84\). They also proposed the joint form \(L(N,D)=\big[(N_c/N)^{\alpha_N/\alpha_D}+D_c/D\big]^{\alpha_D}\), and from their analysis of compute-efficient training (a joint fit in model size and training steps) derived \(N_{\rm opt}\propto C^{0.73}\). These pure power laws have no floor term and hold only over the measured range.

    算力最优配比的推导Deriving the compute-optimal allocation

    在约束 \(6ND=C\) 下最小化 \(L(N,D)=E+AN^{-\alpha}+BD^{-\beta}\)。代入 \(D=C/(6N)\):

    $$\begin{gathered}L(N)=E+AN^{-\alpha}+B\Big(\frac{6N}{C}\Big)^{\beta},\\ \frac{dL}{dN}=-\frac{\alpha A}{N^{\alpha+1}}+\frac{\beta B}{N}\Big(\frac{6N}{C}\Big)^{\beta}=0\ \Longrightarrow\ \alpha A\,N^{-\alpha}=\beta B\,D^{-\beta}.\end{gathered}$$

    最优点上,模型项和数据项按指数加权后相等:再多一点参数和再多一点数据带来的边际收益一样。解出

    $$\begin{gathered}\hl{nopt}{N_{\rm opt}(C)}=G\Big(\frac C6\Big)^{\frac{\beta}{\alpha+\beta}},\qquad D_{\rm opt}(C)=G^{-1}\Big(\frac C6\Big)^{\frac{\alpha}{\alpha+\beta}},\\ G=\Big(\frac{\alpha A}{\beta B}\Big)^{\frac1{\alpha+\beta}}.\end{gathered}$$

    复核后的系数给出 \(a=\beta/(\alpha+\beta)=0.513\)、\(b=0.487\):几乎对半分,算力多 100 倍,参数和数据各多约 10 倍(Kaplan 的 0.73 则意味着参数多 29 倍、数据只多 3.5 倍)。\(\alpha\approx\beta\) 是“同比例增长”的根源。把 \(N_{\rm opt},D_{\rm opt}\) 代回去,\(L^\ast(C)-E\propto C^{-\alpha\beta/(\alpha+\beta)}\),指数约 0.18:算力前沿本身也是带地板的幂律。若推理要求 \(N\le N_{\max}\),当 \(N_{\rm opt}(C)>N_{\max}\) 时最优解贴在约束上,\(L\to E+AN_{\max}^{-\alpha}\)(FIG 4 的任务 2)。

    Minimize \(L(N,D)=E+AN^{-\alpha}+BD^{-\beta}\) subject to \(6ND=C\). Substituting \(D=C/(6N)\):

    $$\begin{gathered}L(N)=E+AN^{-\alpha}+B\Big(\frac{6N}{C}\Big)^{\beta},\\ \frac{dL}{dN}=-\frac{\alpha A}{N^{\alpha+1}}+\frac{\beta B}{N}\Big(\frac{6N}{C}\Big)^{\beta}=0\ \Longrightarrow\ \alpha A\,N^{-\alpha}=\beta B\,D^{-\beta}.\end{gathered}$$

    At the optimum the model term and the data term, weighted by their exponents, are equal: a little more model and a little more data bring the same marginal gain. Solving,

    $$\begin{gathered}\hl{nopt}{N_{\rm opt}(C)}=G\Big(\frac C6\Big)^{\frac{\beta}{\alpha+\beta}},\qquad D_{\rm opt}(C)=G^{-1}\Big(\frac C6\Big)^{\frac{\alpha}{\alpha+\beta}},\\ G=\Big(\frac{\alpha A}{\beta B}\Big)^{\frac1{\alpha+\beta}}.\end{gathered}$$

    The re-fitted coefficients give \(a=\beta/(\alpha+\beta)=0.513\) and \(b=0.487\): almost an even split, so 100 times the compute means about 10 times the parameters and 10 times the data (Kaplan's 0.73 would mean 29 times the parameters and only 3.5 times the data). \(\alpha\approx\beta\) is the root of "grow both in proportion". Substituting \(N_{\rm opt},D_{\rm opt}\) back, \(L^\ast(C)-E\propto C^{-\alpha\beta/(\alpha+\beta)}\), an exponent of about 0.18: the compute frontier is itself a power law with a floor. If inference demands \(N\le N_{\max}\), then once \(N_{\rm opt}(C)>N_{\max}\) the optimum sits on the constraint and \(L\to E+AN_{\max}^{-\alpha}\) (task 2 of FIG 4).

    全对才算对的指标All-or-nothing metrics

    若每一步独立、对数损失为 \(\hl{ell}{\ell(N)}=cN^{-\alpha}\),整个任务成功率为 \(y=e^{-k\ell}\)。解出达到成功率 \(y\) 所需的规模:

    $$\log_{10}N_y=\frac1\alpha\log_{10}\frac{kc}{\ln(1/y)}.$$

    从 10% 到 90% 的宽度 \(\log_{10}N_{0.9}-\log_{10}N_{0.1}=\frac1\alpha\log_{10}\frac{\ln10}{\ln(1/0.9)}=\frac{1.34}{\alpha}\),与 \(k\) 无关(FIG 5 中 \(\alpha=0.5\),宽 2.68 个数量级),\(k\) 只使曲线平移 \(\frac1\alpha\log_{10}k\)。而 \(-\log y=k\ell(N)\) 本身是一条幂律。部分得分 \(\frac1k\sum_{j=1}^k p^j\) 在 \(p\) 不大时就已经离开零,上升得更早、更平缓。现实中各步并不独立、错误也可以纠正,但结论的方向不变:非线性的、阈值式的指标会把平滑的进步变成看似突然的跳变。

    If the steps are independent with log-loss \(\hl{ell}{\ell(N)}=cN^{-\alpha}\), the whole task succeeds with \(y=e^{-k\ell}\). The scale needed to reach success rate \(y\) is

    $$\log_{10}N_y=\frac1\alpha\log_{10}\frac{kc}{\ln(1/y)}.$$

    The width from 10% to 90% is \(\log_{10}N_{0.9}-\log_{10}N_{0.1}=\frac1\alpha\log_{10}\frac{\ln10}{\ln(1/0.9)}=\frac{1.34}{\alpha}\), independent of \(k\) (in FIG 5 \(\alpha=0.5\), a width of 2.68 orders of magnitude); \(k\) only shifts the curve by \(\frac1\alpha\log_{10}k\). And \(-\log y=k\ell(N)\) is itself a power law. Partial credit \(\frac1k\sum_{j=1}^k p^j\) leaves zero while \(p\) is still modest, rising earlier and more gently. Real steps are not independent and mistakes can be corrected, but the direction of the conclusion stands: nonlinear, thresholded metrics turn smooth progress into seemingly sudden jumps.

    8机器人中的它:数据瓶颈,以及多样性比数量重要In robotics: the data bottleneck, and why diversity beats quantity

    语言模型的 scaling law 是在“数据几乎无限”的前提下测出来的:Chinchilla 用了 1.4 万亿个 token,后来的模型用到十几万亿。机器人没有这样的数据。到 2024 年,公开的大型真实机器人数据集是这样的量级:RT-1(Brohan 等,2022)在 17 个月里用 13 台机器人采了约 13 万条示教、覆盖 700 多个任务;DROID(Khazatsky 等,2024)由 50 位采集者在 12 个月里于 564 个场景采了 7.6 万条轨迹(350 小时);Open X-Embodiment(2023)汇集了 21 个机构、22 种机器人的 100 多万条轨迹。粗略估一下:即使每条轨迹有 100 个控制步,100 万条也只是 \(10^8\) 个“动作样本”,比 Chinchilla 的 token 数少四个数量级,而且每一条都要人亲手遥操作(22.3 节)。

    数据这么贵,问题就变成:同样的示教预算,怎样采最有用?FIG 1 的结论是“数据要填满策略会遇到的空间”。对机器人,最难填满的维度往往不是物体在桌上的位置,而是环境:不同的厨房、桌面、光照、物体实例。下图是一个模拟实验:策略要从示教里学会抓取偏移量,动作取决于物体位置 \(\mathbf s\in[-1,1]^2\) 和 3 个环境因素 \(\mathbf z\in[-1,1]^3\)(比如桌面高度、光照造成的视觉偏差、物体形状),\(\mathbf a=\mathbf s+\mathbf g(\mathbf z)\),\(\mathbf g\) 是一个平滑的非线性函数。数据集由 \(E\) 个环境、每个环境 \(M\) 条示教组成;策略是一个基于 150 个随机傅里叶特征的岭回归(一种平滑的全局函数逼近器),在 300 个全新环境中的随机状态上测试,误差小于 0.1 算成功。

    Language-model scaling laws were measured under "almost unlimited data": Chinchilla used 1.4 trillion tokens, later models over ten trillion. Robots have nothing like it. As of 2024, large public real-robot datasets are of this order: RT-1 (Brohan et al., 2022) collected about 130 thousand demonstrations over 700+ tasks with 13 robots in 17 months; DROID (Khazatsky et al., 2024) has 76 thousand trajectories (350 hours) collected by 50 people in 564 scenes over 12 months; Open X-Embodiment (2023) pooled over a million trajectories from 22 robot types at 21 institutions. A rough estimate: even at 100 control steps per trajectory, a million trajectories is only \(10^8\) "action samples", four orders of magnitude fewer than Chinchilla's tokens, and every one was teleoperated by hand (Lesson 22.3).

    With data this expensive the question becomes: for the same demonstration budget, what is most useful to collect? FIG 1's conclusion was "the data must fill the space the policy will meet". For a robot the hardest dimensions to fill are often not where the object sits on the table but the environment: different kitchens, tabletops, lighting, object instances. The figure below is a simulated experiment: a policy must learn a grasp offset from demonstrations, where the action depends on the object position \(\mathbf s\in[-1,1]^2\) and 3 environment factors \(\mathbf z\in[-1,1]^3\) (say table height, a lighting-induced visual bias, object shape): \(\mathbf a=\mathbf s+\mathbf g(\mathbf z)\) with \(\mathbf g\) a smooth nonlinear function. A dataset consists of \(E\) environments with \(M\) demonstrations each; the policy is ridge regression on 150 random Fourier features (a smooth, global function approximator), tested on random states in 300 brand-new environments, with success meaning an error below 0.1.

    FIG 6多样性对数量:同样多的示教,分给更多环境,新环境里的成功率高得多Diversity versus quantity: the same number of demonstrations spread over more environments succeeds far more often in new ones
    左:在新环境中的成功率,行是环境数 \(E\),列是每个环境的示教数 \(M\)(都是 1 到 64,按 2 的幂);越绿 = 越高,格子里写着百分数;点一个格子选中它(琥珀色框)。紫色虚线框出总示教数 \(E\times M=256\) 的格子。网格是逐个环境累加算出来的,首次出现在屏幕上时开始计算。右:成功率随环境数 \(E\) 的变化(对数横轴),每条线固定 \(M\):红 \(M=1\),琥珀 \(M=4\),绿 \(M=16\),蓝 \(M=64\);空心圈是选中的格子。 Left: the success rate in new environments, rows = number of environments \(E\), columns = demonstrations per environment \(M\) (both 1 to 64 in powers of 2); more green = higher, with the percentage written in each cell; click a cell to select it (amber frame). The dashed purple outline marks the cells with \(E\times M=256\) demonstrations in total. The grid is built up one environment at a time, starting when it first appears on screen. Right: success against the number of environments \(E\) (log horizontal axis), one line per fixed \(M\): red \(M=1\), amber \(M=4\), green \(M=16\), blue \(M=64\); the hollow ring is the selected cell.
    • 在紫色框(总共 256 条示教)里依次点选“4 个环境 × 64 条”和“64 个环境 × 4 条”:默认种子下成功率是 15% 对 69%。Inside the purple outline (256 demonstrations in total), select "4 environments × 64 demos" and then "64 environments × 4 demos": with the default seed the success rates are 15% against 69%.
    • 点选“8 个环境 × 64 条”和“64 个环境 × 8 条”(都从 8 × 8 = 26% 出发,示教各多 8 倍):每个环境多采示教几乎没用(27%),多采环境把成功率推到 72%。Select "8 environments × 64 demos" and "64 environments × 8 demos" (both 8 times the demonstrations of 8 × 8 = 26%): more demonstrations per environment barely help (27%), more environments push success to 72%.

    每一行在 \(M\approx8\) 之后就基本不变了:一个环境里,物体位置这两个维度很快被覆盖,再多的示教只是重复。每一列却一路上升,而且即使有 64 个环境,成功率也只有约 70%:3 维的环境空间还远没有被填满,这和 FIG 1 里 \(n^{-2/d}\) 的逻辑一样。真实实验得出过同样的结论。RT-1 的消融实验比较了“减少每个任务的示教数”和“减少任务种类”(后者只去掉了 3% 的数据,却去掉了 25% 的任务),发现减少多样性的伤害大得多,作者的结论是数据多样性比数据数量更关键。Lin 等人(2025)用手持夹爪(UMI 式,22.3 节)采了 4 万多条示教,在真实机器人上做了 1.5 万多次测试,发现策略在新环境、新物体上的泛化能力随训练环境数和物体数近似按幂律增长,而每个环境或物体的示教数超过某个阈值后,再增加几乎没有效果。

    Each row hardly changes beyond \(M\approx8\): within one environment the two dimensions of object position are covered quickly, and more demonstrations only repeat. Each column keeps rising, and even with 64 environments success is only about 70%: the 3-dimensional environment space is still far from filled, the same logic as \(n^{-2/d}\) in FIG 1. Real experiments have reached the same conclusion. RT-1's ablation compared "fewer demonstrations per task" with "fewer kinds of task" (the latter removed only 3% of the data but 25% of the tasks) and found the loss of diversity far more damaging; the authors concluded that data diversity is more essential than data quantity. Lin et al. (2025) collected over 40 thousand demonstrations with hand-held grippers (UMI-style, Lesson 22.3), ran over 15 thousand tests on real robots, and found that a policy's generalization to new environments and objects grows roughly as a power law in the number of training environments and objects, while beyond some threshold more demonstrations per environment or object have little effect.

    真实系统里In real systems

    绕过数据瓶颈的四条路。(1) 仿真:并行 GPU 仿真能产生几乎无限的经验,代价是仿真与现实的差距(23.1、23.2 节)。(2) 跨本体汇集:Open X-Embodiment 报告,用汇集数据训练的 RT-X 模型表现出正迁移:在多种机器人上超过了只用该机器人自己的数据训练的模型。(3) 借用互联网规模的预训练:视觉-语言模型已经在海量图文上“填满”了物体和场景的语义空间,机器人数据只需要教动作(21.1 节的预训练与微调)。(4) 采得更聪明:按环境和物体的多样性来分配采集预算(FIG 6、Lin 等,2025),而不是在一个场景里反复示教。 模型大小:RT-1 只有约 3500 万参数,就是为了在机器人上实时运行;FIG 4 的上限推理说明,推理受限时应把算力花在更多(更多样的)数据上。 评测:机器人的“损失”不是成功率,验证损失低不代表闭环表现好(16.2 节误区 2);成功率需要大量真实试验,每个条件几十次试验时置信区间仍有十几到二十几个百分点(FIG 5),所以机器人上的 scaling 曲线远比语言模型的嘈杂。目前机器人 scaling law 的证据仍然有限,大多是在特定任务族、特定数据采集方式下得到的。

    Four routes around the data bottleneck. (1) Simulation: massively parallel GPU simulation produces almost unlimited experience, at the price of the sim-to-real gap (Lessons 23.1 and 23.2). (2) Pooling across embodiments: Open X-Embodiment reports that RT-X models trained on the pooled data show positive transfer: on several robots they outperform models trained only on that robot's own data. (3) Borrowing internet-scale pre-training: vision-language models have already "filled" the semantic space of objects and scenes from huge image–text corpora, so robot data only needs to teach the actions (pre-training and fine-tuning, Lesson 21.1). (4) Collecting smarter: allocate the collection budget by diversity of environments and objects (FIG 6, Lin et al., 2025) instead of demonstrating over and over in one scene. Model size: RT-1 has only about 35 million parameters, precisely so that it runs in real time on the robot; the cap argument of FIG 4 says that when inference is the limit, compute should go into more (and more diverse) data. Evaluation: a robot's "loss" is not its success rate, and a low validation loss does not mean good closed-loop behaviour (Pitfall 2 of Lesson 16.2); success rates need many real trials, and with a few dozen trials per condition the confidence interval is still ten to twenty-odd percentage points wide (FIG 5), so robot scaling curves are far noisier than those of language models. The evidence for robot scaling laws is still limited, mostly obtained for particular task families and particular ways of collecting data.

    9常见误区Common pitfalls

    误区 1:把双对数图上的直线一直延长下去Pitfall 1: extending a straight line on a log-log plot forever

    纯幂律假设损失能降到零,而任何有噪声或真正随机性的数据都有地板 \(E\)。用直线外推会系统性地高估进步(FIG 3:同样的点,直线许诺的进步是真实的 2.7 到 5 倍)。外推时用带地板的形式,用自助法或多个随机种子给出范围,并且只外推一两个数量级;更远处可能有你看不到的断点。

    A pure power law assumes the loss can fall to zero, but any data with noise or genuine randomness has a floor \(E\). Extrapolating a straight line systematically overestimates progress (FIG 3: from the same points, the line promises 2.7 to 5 times the real progress). Extrapolate with a floor, give a range from the bootstrap or several random seeds, and extrapolate by only one or two orders of magnitude; further out there may be breaks you cannot see.

    误区 2:把别人的指数和系数搬过来用Pitfall 2: borrowing someone else's exponents and coefficients

    scaling law 的系数属于特定的数据分布、分词方式、模型族、优化器和评测指标。Chinchilla 的“每参数 20 个 token”说的是它的数据和它的 token,对机器人的动作 token(17.5 节)、图像或轨迹没有直接意义。即使在语言模型里,换一种拟合方法,结论也可能变(Besiroglu 等对 Chinchilla 第三种方法的复核)。要用,就在自己的问题上用小规模实验重新测。

    The coefficients of a scaling law belong to a particular data distribution, tokenization, model family, optimizer and evaluation metric. Chinchilla's "20 tokens per parameter" speaks of its data and its tokens; it means nothing directly for robot action tokens (Lesson 17.5), images or trajectories. Even within language models a different fitting method can change the conclusion (Besiroglu et al.'s re-examination of Chinchilla's third method). If you want one, measure it again on your own problem with small-scale experiments.

    误区 3:每个规模用同一套超参数Pitfall 3: one set of hyperparameters for every scale

    学习率、衰减长度、批大小的最优值随模型大小和训练长度变化。用一套固定的设置,大模型往往被“调坏”,scaling 曲线就会变平甚至反转(FIG 2 的恒定学习率:最大的模型反而更差)。Kaplan 与 Chinchilla 结论不同,主要原因之一就是学习率衰减的长度是否与每次训练的 token 数匹配。比较不同规模时,每个规模都要调。

    The best learning rate, decay length and batch size change with model size and training length. With one fixed setting, large models are often "mis-tuned" and the scaling curve flattens or even reverses (the constant learning rate of FIG 2: the largest model ends up worse). One of the main reasons Kaplan and Chinchilla disagree is whether the learning-rate decay length was matched to each run's token count. When comparing scales, tune every scale.

    误区 4:用阈值式指标宣称“涌现”,或把损失当成能力Pitfall 4: claiming "emergence" from a thresholded metric, or taking loss for capability

    任务成功率这样全对才算对的指标会把平滑的进步变成看似突然的跳变,加上只评测几个规模、每个规模只有 20 次试验,几乎一定会“看到”涌现(FIG 5)。反过来,损失平滑下降也不保证你关心的那个能力会按时出现。同时报告连续指标和任务成功率,写明试验次数和置信区间。

    All-or-nothing metrics such as task success turn smooth progress into seemingly sudden jumps, and with only a few scales evaluated at 20 trials each you are almost certain to "see" emergence (FIG 5). Conversely, a smoothly falling loss does not guarantee that the ability you care about will arrive on schedule. Report a continuous metric alongside task success, with the number of trials and the confidence intervals.

    误区 5:只数示教的条数Pitfall 5: counting only the number of demonstrations

    scaling law 里的 \(D\) 默认是不重复的、来自目标分布的样本。同一个场景里的 1000 条示教,有效数据量远少于 1000 个不同场景各一条(FIG 6)。语言模型里,把数据重复几遍训练,前几遍和新数据差不多(Muennighoff 等,2023 报告约 4 个 epoch 以内),之后收益迅速递减。规划机器人数据时,把预算按环境、物体、任务的多样性来分配,并按场景划分验证集,才能测到真正的泛化。

    The \(D\) of a scaling law means non-repeated samples from the target distribution. A thousand demonstrations in one scene are worth far less than one demonstration in each of a thousand scenes (FIG 6). For language models, repeating data a few times is nearly as good as new data (Muennighoff et al., 2023 report this for up to about 4 epochs), after which returns diminish fast. When planning robot data, split the budget by diversity of environments, objects and tasks, and split validation by scene, so you measure real generalization.

    10小练习Check yourself

    1. 两个模型的测试损失:\(N=10^8\) 时 0.8,\(N=10^{10}\) 时 0.4。如果是纯幂律(无地板),指数 \(\alpha\) 和 \(N=10^{12}\) 处的预测分别是?1. Test losses of two models: 0.8 at \(N=10^8\) and 0.4 at \(N=10^{10}\). Assuming a pure power law (no floor), what are the exponent \(\alpha\) and the prediction at \(N=10^{12}\)?
    100 倍参数让损失减半:\(100^{-\alpha}=1/2\),\(\alpha=\log_{10}2/2\approx0.15\)。再 100 倍再减半:0.2。选项 C 是线性外推的思路(每 100 倍减 0.4),在对数坐标上不成立。注意:如果有地板 \(E>0\),真实值会高于 0.2(误区 1)。100 times the parameters halves the loss: \(100^{-\alpha}=1/2\), so \(\alpha=\log_{10}2/2\approx0.15\). Another factor of 100 halves it again: 0.2. Option C extrapolates linearly (minus 0.4 per factor of 100), which does not hold on log axes. Note: with a floor \(E>0\) the true value would be above 0.2 (Pitfall 1).
    2. 你的训练算力增加了 100 倍。按 Chinchilla 式的算力最优配比(\(a\approx b\approx0.5\)),参数量和训练数据量应该怎样变化?2. Your training compute grows 100-fold. Under a Chinchilla-style compute-optimal allocation (\(a\approx b\approx0.5\)), how should the parameter count and the training data change?
    \(N_{\rm opt}\propto C^{0.5}\)、\(D_{\rm opt}\propto C^{0.5}\),\(100^{0.5}=10\)。选项 B 是 Kaplan 的 \(N\propto C^{0.73}\)(\(100^{0.73}\approx29\),数据 \(100^{0.27}\approx3.5\))。选项 D 只在模型大小有硬上限、而且还没到上限下的地板时才合理(FIG 4 任务 2)。\(N_{\rm opt}\propto C^{0.5}\) and \(D_{\rm opt}\propto C^{0.5}\), and \(100^{0.5}=10\). Option B is Kaplan's \(N\propto C^{0.73}\) (\(100^{0.73}\approx29\), data \(100^{0.27}\approx3.5\)). Option D makes sense only when the model size has a hard cap and the floor under that cap has not been reached yet (task 2 of FIG 4).
    3. 一个 10 步的长时程任务,两个模型的整体成功率分别是 2% 和 60%。假设各步独立、每步成功率相同,两个模型的每步成功率大约是?3. On a 10-step long-horizon task two models succeed 2% and 60% of the time. Assuming independent steps with equal per-step success, what are the two per-step success rates roughly?
    \(p=y^{1/10}\):\(0.02^{0.1}\approx0.68\),\(0.6^{0.1}\approx0.95\)。整体成功率差 30 倍,每一步只从 68% 提高到 95%。这正是 FIG 5 的机制:全对才算对的指标放大了平滑的逐步进步,看上去像能力“出现”了。\(p=y^{1/10}\): \(0.02^{0.1}\approx0.68\) and \(0.6^{0.1}\approx0.95\). The whole-task success differs 30-fold while each step only improves from 68% to 95%. This is the mechanism of FIG 5: an all-or-nothing metric amplifies smooth per-step progress until it looks as if an ability "appeared".
    4. 一个最近邻式的模型,输入数据的内在维数是 6。要让均方误差减半,需要大约多少倍的数据?4. A nearest-neighbour-style model works on data whose intrinsic dimension is 6. Roughly how many times more data does it take to halve the mean squared error?
    \(\text{MSE}\propto n^{-2/d}=n^{-1/3}\)。\(\lambda^{-1/3}=1/2\Rightarrow\lambda=2^3=8\)。选项 D 的 64 倍是 \(2^d\),那是把典型距离(而不是平方误差)减半所需的数据量 \(2^d\),平方误差那时已经降到四分之一。\(\text{MSE}\propto n^{-2/d}=n^{-1/3}\). \(\lambda^{-1/3}=1/2\Rightarrow\lambda=2^3=8\). The 64 times of option D is \(2^d\), the data needed to halve the typical distance (not the squared error), by which point the squared error has fallen to a quarter.
    5. 你有 500 条遥操作示教的预算,目标是让策略在客户家里的新厨房里工作。哪种采集方案最可能泛化得好?5. You have a budget of 500 teleoperated demonstrations, and the policy must work in customers' new kitchens. Which collection plan is most likely to generalize?
    新厨房是环境维度上的新点,要靠环境的多样性来覆盖(FIG 6:同样 256 条,64 个环境比 4 个环境成功率高得多;RT-1 和 Lin 等的真实实验结论相同)。选项 A 和 C 把预算花在一个已经被覆盖的维度上,收益很快饱和;选项 D 的复制不增加任何信息(误区 5)。A new kitchen is a new point along the environment dimensions and can only be covered by environment diversity (FIG 6: with the same 256 demonstrations, 64 environments succeed far more often than 4; the real experiments of RT-1 and Lin et al. reached the same conclusion). Options A and C spend the budget on a dimension that is already covered, so the returns saturate quickly; copying in option D adds no information at all (Pitfall 5).

    11延伸阅读Further reading

    • J. Hestness et al., Deep Learning Scaling is Predictable, Empirically, arXiv, 2017 — 在翻译、语言模型、图像分类和语音上观察到误差随数据量的幂律power laws in data size across translation, language modelling, image classification and speech
    • J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu & D. Amodei, Scaling Laws for Neural Language Models, arXiv, 2020 — \(L(N)\)、\(L(D)\)、\(L(C)\) 三条定律与 \(C\approx6ND\)the three laws \(L(N)\), \(L(D)\), \(L(C)\) and \(C\approx6ND\)
    • J. Hoffmann et al., Training Compute-Optimal Large Language Models, NeurIPS 2022 — Chinchilla:参数与数据同比例增长Chinchilla: grow parameters and data in proportion
    • T. Besiroglu, E. Erdil, M. Barnett & J. You, Chinchilla Scaling: A Replication Attempt, arXiv, 2024 — FIG 4 所用的重新拟合系数the re-fitted coefficients used in FIG 4
    • U. Sharma & J. Kaplan, Scaling Laws from the Data Manifold Dimension, JMLR, 2022 — 指数 \(\approx4/d\) 与内在维数exponent \(\approx4/d\) and intrinsic dimension
    • Y. Bahri, E. Dyer, J. Kaplan, J. Lee & U. Sharma, Explaining Neural Scaling Laws, PNAS, 2024 — 方差受限与分辨率受限两种区间的理论a theory of variance-limited and resolution-limited regimes
    • E. Caballero, K. Gupta, I. Rish & D. Krueger, Broken Neural Scaling Laws, ICLR 2023 — 带断点的 scaling 曲线scaling curves with breaks
    • N. Muennighoff et al., Scaling Data-Constrained Language Models, NeurIPS 2023 — 数据重复多少遍还有用how many repetitions of the data still help
    • B. Sorscher, R. Geirhos, S. Shekhar, S. Ganguli & A. S. Morcos, Beyond Neural Scaling Laws: Beating Power Law Scaling via Data Pruning, NeurIPS 2022 — 挑选数据可以改变指数choosing the data can change the exponent
    • J. Wei et al., Emergent Abilities of Large Language Models, TMLR, 2022; R. Schaeffer, B. Miranda & S. Koyejo, Are Emergent Abilities of Large Language Models a Mirage?, NeurIPS 2023 — 涌现之争的两方the two sides of the emergence debate
    • R. Sutton, The Bitter Lesson, 2019 (essay) — 利用算力的通用方法最终胜出general methods that exploit computation win in the end
    • A. Brohan et al., RT-1: Robotics Transformer for Real-World Control at Scale, RSS 2023 — 13 万条示教,数据多样性与数量的消融130 thousand demonstrations, the diversity-versus-quantity ablation
    • Open X-Embodiment Collaboration, Open X-Embodiment: Robotic Learning Datasets and RT-X Models, arXiv, 2023 — 22 种机器人的汇集数据pooled data from 22 robot types
    • A. Khazatsky et al., DROID: A Large-Scale In-the-Wild Robot Manipulation Dataset, RSS 2024
    • F. Lin, Y. Hu, P. Sheng, C. Wen, J. You & Y. Gao, Data Scaling Laws in Imitation Learning for Robotic Manipulation, ICLR 2025 — 环境与物体的多样性比示教数量重要diversity of environments and objects matters more than the number of demonstrations