B ROKEN N EURAL S CALING L AWS
A BSTRACT
We present a smoothly broken power law functional form (referred to by us as a broken neural scaling law (BNSL)) that accurately models and extrapolates the scaling behaviors of deep neural networks (i.e. how the evaluation metric of interest varies as the amount of compute used for training, number of model parameters, training dataset size, or upstream performance varies) for various architectures and for each of various tasks within a large and diverse set of upstream and downstream tasks, in zero-shot, prompted, and fine-tuned settings.
This set includes large-scale vision, language, audio, video, diffusion, generative modeling, multimodal learning, contrastive learning, AI alignment, robotics, out-of-distribution generalization, continual learning, uncertainty estimation / calibration, adversarial robustness, molecules, computer programming/coding, arithmetic, unsupervised/self-supervised learning, and reinforcement learning (single agent and multi-agent).
When compared to other functional forms for neural scaling behavior, this functional form yields extrapolations of scaling behavior that are considerably more accurate on this set.
Moreover, this functional form accurately models and extrapolates scaling behavior that other functional forms are incapable of expressing such as the non-monotonic transitions present in the scaling behavior of phenomena such as double descent and the delayed, sharp inflection points present in the scaling behavior of tasks such as arithmetic.
Lastly, we use this functional form to glean insights about the limit of the predictability of scaling behavior.
Code is available at https://github.com/ethancaballero/
broken_neural_scaling_laws I NTRODUCTION
The amount of compute used for training, number of model parameters, and training dataset size of the most capable artificial neural networks keeps increasing and will probably keep rapidly increasing for the foreseeable future.
However, no organization currently has direct access to these larger resources of the future; and it has been empirically verified many times that methods which perform best at smaller scales often are no longer the best performing methods at larger scales (e.g., one of such examples can be seen in Figure 2 (right) of Tolstikhin et al.
To work on, identify, and steer the methods that are most probable to stand the test-of-time as these larger resources come online, one needs a way to predict how all relevant performance evaluation metrics of artificial neural networks vary in all relevant settings as scale increases.
Neural scaling laws (Cortes et al., 1994; Hestness et al., 2017; Rosenfeld et al., 2019; Kaplan et al., 2020; Zhai et al., 2021;
Abnar et al., 2021; Alabdulmohsin et al., 2022; Brown et al., 2020) aim to predict the behavior of large-scale models from smaller, cheaper experiments, allowing to focus on the best-scaling architectures, algorithms, datasets, and so on.
The upstream/in-distribution test loss typically (but not always!) falls off as a power law with increasing data, model size and compute.
However, the downstream/out-of-distribution performance, and other evaluation metrics of interest (even upstream/in-distribution evaluation metrics) are often less predictable, sometimes exhibiting inflection points (on a linear-linear plot) and non-monotonic behaviors.
Discovering universal scaling laws that accurately model a wide range of potentially unexpected behaviors is clearly important not only for identifying that which scales best, but also for AI safety, as predicting the emergence of novel capabilities at scale could prove crucial to responsibly developing and deploying increasingly advanced AI systems.
The functional forms of scaling laws evaluated in previous work are not up to this challenge.
One salient defect is that they can only represent monotonic functions.
They thus fail to model the striking phenomena of double-descent (Nakkiran et al., 2021), where increased scale temporarily decreases test performance before ultimately leading to further improvements.
Many also lack the expressive power to model inflection points (on a linear-linear plot), which can be observed empirically for many downstream tasks, and even some upstream tasks, such as our N -digit arithmetic task, or the modular arithmetic task introduced by Power et al.
(2022) in their work on “grokking”.
To overcome the above limitations, we present broken neural scaling laws (BNSL) - a functional form that generalizes power laws (linear in log-log plot) to “smoothly broken” power laws, i.e. a smoothly connected piecewise (approximately) linear function in a log-log plot.
An extensive empirical evaluation demonstrates that BNSL accurately model and extrapolate the scaling behaviors for various architectures and for each of various tasks within a large and diverse set of upstream and downstream tasks, in zero-shot, prompted, and fine-tuned settings.
This set includes large-scale vision, language, audio, video, diffusion, generative modeling, multimodal learning, contrastive learning, AI alignment, robotics, out-of-distribution generalization, continual learning, uncertainty estimation / calibration, adversarial robustness, molecules, computer programming/coding, arithmetic, unsupervised/self-supervised learning, and reinforcement learning (single agent and multi-agent).
When compared to other functional forms for neural scaling behavior, this functional form yields extrapolations of scaling behavior that are considerably more accurate on this set.
It captures well the non-monotonic transitions present in the scaling behavior of phenomena such as double descent and the delayed, sharp inflection points present in the scaling behavior of tasks such as arithmetic.
T HE F UNCTIONAL F ORM OF B ROKEN N EURAL S CALING L AWS
individual power laws (dashed lines that are yellow, blue, red, and green) that it is composed of overlaid on top of it.
The 1st and 2nd break are very smooth; the 3rd break is very sharp.
See Section 2 for more details.
The general functional form of a broken neural scaling law (BNSL) is given as follows:
[Equation]
where y represents the performance evaluation metric (e.g. prediction error, cross entropy, calibration error, BLEU score percentage, reward, Elo rating, or FID score) ( downstream or upstream ) and x represents a quantity that is being scaled (e.g. number of model parameters, amount of compute used for training, training dataset size, or upstream performance).
The remaining parameters a, b, c 0 , c 1 ...c n , d 1 ...d n , f 1 ...f n are unknown constants that must be estimated by fitting the above functional form to the ( x, y ) data points.
(In our experiments, SciPy curve-fitting library (Virtanen et al., 2020) was used.)
The constants in equation 1 are interpreted as follows.
Constant n represents the number of (smooth) “breaks” (i.e. transitions) between n + 1 consecutive approximately linear (on a log-log plot) segments, for a total of n + 1 approximately linear segments (on a log-log plot); when n = 0 , equation 1 becomes y = a + bx − c 0 .
Constant a represents the limit as to how far the value of y (performance evaluation metric) can be reduced (or maximized) even if x (the quantity being scaled) goes to infinity.
Constant b represents the offset of functional form on a log-log plot (analogous to the intercept b in y =
mx + b on a linear-linear plot).
Constant c 0 represents the slope of the first approximately linear region on a log-log plot.
Constant c i represents the difference in slope of the ( i ) th approximately linear region and ( i + 1) th approximately linear region on a log-log plot.
Constant d i represents where on the x-axis the break between the ( i ) th and the ( i + 1) th approximately linear region (on a log-log plot) occurs.
Constant f i represents the sharpness of break between the ( i ) th and the ( i + 1) th approximately linear region on a log-log plot; smaller (nonnegative) values of f i yield a sharper break and intervals (before and after the ( i ) th break) that are more linear on a log-log plot; larger values of f i yield a smoother break and intervals (before and after the ( i ) th break) that are less linear on a log-log plot.
For mathematical analysis and explanation of why Equation 1 is smoothly piece-wise (approximately) linear function on a log-log plot, see Appendix A.1.
For mathematical decomposition of
Equation 1 into the power law segments it is composed of (e.g. as in Figure 1), see Appendix A.2.
Note that, while an intuition for using such smoothly connected approximately piece-wise linear (in log-log plot) function was that, with enough segments, it could fit well any smooth univariate scaling function, it remained unclear whether BNSL would also extrapolate well; yet as we demonstrate below, it extrapolates quite accurately.
Additionally, we find that the number of breaks needed to accurately model an entire scaling behavior is often quite small.
R ELATED W ORK
To the best of our knowledge, Cortes et al.
(1994) was the first paper to model the scaling of multilayer neural network’s performance as a power law (also known as a scaling law) (plus a constant) of the form y =
ax b + c in which x refers to training dataset size and y refers to test error; we refer to that functional form as M2.
Hestness et al.
(2017) showed that the functional form, M2, holds over many orders of magnitude.
Rosenfeld et al.
(2019) demonstrated that the same functional form, M2, applies when x refers to model size (number of parameters).
Kaplan et al.
(2020) brought “neural” scaling laws to the mainstream and demonstrated that the same functional form, M2, applies when x refers to the amount of compute used for training.
Abnar et al.
(2021) proposed to use the same functional form, M2, to relate downstream performance to upstream performance.
Zhai et al.
(2021) introduced the functional form y = a ( x + d ) b + c , (referred to by us as M3) where d represents the scale at which the performance starts to improve beyond the random guess loss (a constant) and transitions to a power law scaling regime.
Alabdulmohsin et al.
(2022) proposed functional form ( y − ϵ ∞ ) /
(( ϵ 0 − y ) a ) =
bx c , (referred to by us as M4) where ϵ ∞ is irreducible entropy of the data distribution and ϵ 0 is random guess performance, for relating scale to performance and released a scaling laws benchmark dataset that we use in our experiments.
Hernandez et al.
(2021) described a smoothly broken power law functional form (consisting ofconstants after reducing redundant variables) in equation 6.1 of their paper, when relating scale and downstream performance.
While this functional form can be summed with an additional constant representing unimprovable performance to obtain a functional form whose expressivity is equivalent to our BNSL with a single break, it is important to note that (i) Hernandez et al.
(2021) describes this form only in the specific context, when exploring how fine-tuning combined with transfer learning scales as a function of the model size - thus, their functional form contains a break only with respect to number of model parameters but not with respect to other input quantities which we do explore such as dataset size, amount of compute, and upstream performance; (ii) Hernandez et al.
(2021) mentioned this equation in passing and as a result did not try to fit or verify this functional form on any data; (iii) they arrived at it simply via combining the scaling law for transfer (that was the focus of their work) with a scaling law for pretraining data; (iv) they did not identify it as a smoothly broken power law, or note any qualitative advantages of this functional form; (v) they did not discuss the family of functional forms with multiple breaks.
Finally, we would like to mention that smoothly broken power law functional forms, equivalent to equation 1, are commonly used in the astrophysics literature (e.g. dam (2017)) as they happen to model well a variety of physical phenomena.
This inspired us to investigate their applicability to a wide range of deep neural scaling phenomena as well.
T HEORETICAL L IMITATIONS OF P REVIOUSLY P ROPOSED S CALING L AWS
Our use of BNSLs is inspired by the observation that scaling is not always well predicted by a simple power law; nor are many of the modifications which have been applied in previous works sufficient to capture the qualitative properties of empirical scaling curves.
Here we show mathematically two qualitative defects of these functional forms:
They are strictly monotonic (first-order derivative does not change its sign) and thus unable to fit double descent phenomena.
They cannot express inflection points (second-order derivative does not change its sign), which are frequently observed empirically.
An exception to this is M4, proposed by Alabdulmohsin et al.
Note that these functional forms can exhibit inflection points on the log-log axes which are commonly used for plotting scaling data (as it was observed in several prior works).
However, for inflection points on a linear-linear plot, the extra expressiveness of broken neural scaling laws appears to be necessary (and sufficient).
Figure 3 and Figure 4, provide examples of BNSLs producing nonmonotonic behavior and inflection points, respectively, establishing the capacity of this functional form to model these phenomena that occur in real scaling behavior.
[Table]
M1, M2, M3 functional forms cannot model non-monotonic behavior or inflection points: First, recall that expressions of the form m n can only take the value 0 if m = 0 .
We now examine the expressions for the first and second derivatives of M1, M2, M3, provided in Table 1, and observe that they are all continuous and do not have roots over the relevant ranges of their variables, i.e. x > 0 in general and b < 0 in the case of M3 (we require x > 0 because model size, dataset size, and compute are always non-negative).
This implies that, for any valid settings of the parameters a, b, c, d, x , these functional forms are monotonic (as the first derivative never changes sign), and that they lack inflection points (since an inflection point must have f ′′ ( x ) = 0 ).
M4 functional form cannot model non-monotonic behavior.
The case of M4 is a bit different, since the relationship between y and x in this case is expressed as an inverse function, i.e.
[Equation]
However, non-monotonicity of y as an inverse function y =
g − 1 ( x ) is ruled out, since that would imply two different values of x = g ( y ) can be obtained for the single value of y – this is impossible, since f ( y ) maps each y deterministically to a single value of x .
As a result, M4 cannot express non-monotonic functions.
M4 functional form can model inflection points.
It is easy to see that if y = g − 1 ( x ) had an inflection point, then x = g ( y ) would have it as well.
This is because an inflection point is defined as a point x where f ( x ) changes from concave to convex, which implies that g ( y ) changes from convex to concave, since the inverse of a convex function is concave; the root(s) of g ′′ ( y ) are the point(s) at which this change occurs.
Using Wolfram Alpha 1 and matplotlib (Hunter, 2007), we observe that
M4 is able to express inflection points, e.g. ( a, b, c, ϵ 0 , ϵ ∞ , x, y ) =
(1 , 1 , − 2 , 3 / 4 , 1 / 4 , 1 / √ 3 , 5 / 8 ), or ( a, b, c, ϵ 0 , ϵ ∞ , x, y )
= (2 , 1 , − 3 , 2 / 3 , 1 / 3 , ( − 5 / 6 + √ 3 / 2) 1 / 3 , 1 / √ 3) .
E MPIRICAL R ESULTS : F ITS AND E XTRAPOLATIONS OF F UNCTIONAL F ORMS
We now show the fits and extrapolations of various functional forms.
In all plots here and onward and in the appendix, black points are points used for fitting a functional form, green points are the held-out points used for evaluating extrapolation of functional form fit to the black points, and a red line is the BNSL that has been fit to black points.
100% of the plots in this paper here and onward and in the appendix contain green point(s) for evaluating extrapolation.
Please refer to Appendix Section A.6 for further experimental details on fitting BNSL.
Except when stated otherwise , each plot contains a single break of a BNSL fit to black points that are smaller (along the x-axis) than the green points.
All the extrapolation evaluations reported in the tables are reported in terms of root mean squared log error (RMSLE) ± root standard log error.
See Appendix A.3 for definition of RMSLE and Appendix
A.4 for definition of root standard log error.
[Table]
M1 ↑
M2 ↑
M
[Equation]
M4 ↑
[Table]
↑
[Table]
5. V ISION
Using the scaling laws benchmark of Alabdulmohsin et al.
(2022), we evaluate how well various functional forms extrapolate performance on vision tasks as training dataset size increases.
In this large-scale vision subset of the benchmark, the tasks that are evaluated are error rate on each of various few-shot downstream image classification (IC) tasks; the downstream tasks are: Birds(Welinder et al., 2010), Caltech101 (Fei-Fei et al., 2004), CIFAR-100 (Krizhevsky et al., 2009), and
ImageNet (Deng et al., 2009).
The following architectures of various sizes are pretrained on subsets of JFT-300M (Sun et al., 2017): big-transfer residual neural networks (BiT) (Kolesnikov et al., 2020), MLP mixers (MiX) (Tolstikhin et al., 2021), and vision transformers (ViT) (Dosovitskiy et al., 2020).
As can be seen in Tables 2 and 3, BNSL yields extrapolations with the lowest RMSLE (Root Mean Squared Logarithmic Error) for 69.44% of tasks of any of the functional forms, while the next best functional form performs the best on only 13.89% of the tasks.
To view plots of BNSL on each of these tasks, see figures 22, 23, 24, 28 in Appendix A.24.
To view plots of M1, M2, M3, M4 on each of these tasks, see Appendix A.4 of Alabdulmohsin et al.
In Section A.8, we additionally show that BNSL yields accurate extrapolations of performance on large-scale downstream vision tasks when amount of compute used for (pre-)training is on the xaxis and compute is scaled in the manner that is Pareto optimal with respect to the performance evaluation metric on the y-axis (downstream accuracy in this case).
In Section A.9, we additionally show that BNSL yields accurate extrapolations of the scaling behavior of diffusion generative models of images when amount of compute used for (pre-)training is on the x-axis and compute is scaled in the manner that is Pareto optimal with respect to the performance evaluation metric on the y-axis (NLL and FID score in this case).
In Section A.10, we additionally show that BNSL yields accurate extrapolations of the scaling behavior of generative models of video.
In Section A.20, we show that BNSL yields accurate extrapolations of robotics scaling behavior (out-of-distribution generalization and in-distribution generalization).
In Section A.19, BNSL accurately extrapolates the scaling behavior of continual learning.
In Section A.15, BNSL accurately extrapolates the scaling behavior of adversarial robustness.
In Section A.22, we show that BNSL accurately extrapolates the scaling behavior of the downstream performance of multimodal contrastive learning (i.e. non-generative unsupervised learning).
In Section A.11, we additionally show that BNSL yields accurate extrapolations of the scaling behavior when data is pruned Pareto optimally (such that each point along the x-axis uses the subset of the dataset that yields the best performance (y-axis value) for that dataset size (x-axis value)).
In Section A.12, we additionally show that BNSL yields accurate extrapolations when upstream performance is on the x-axis and downstream performance is on the y-axis.
In Section A.7, we additionally show that BNSL accurately extrapolates to scales that are an order of magnitude larger than the maximum (along the x-axis) of the points used for fitting.
[Table]
for more
5. L ANGUAGE
Using the scaling laws benchmark of Alabdulmohsin et al.
(2022), we evaluate how well various functional forms extrapolate performance on language tasks as the (pre-)training dataset size increases.
In this large-scale language subset of the benchmark, the tasks that are evaluated are error rates on each of the various downstream tasks from the BIG-Bench (BB) (Srivastava et al., 2022) benchmark and upstream test cross-entropy of various models trained to do language modeling (LM) and neural machine translation (NMT).
All LM and BB tasks use a decoder-only language model.
As can be seen in Tables 2 and 4, BNSL yields extrapolations with the lowest RMSLE (Root Mean
Squared Logarithmic Error) for 75% of tasks of any of the functional forms, while the next best functional form performs the best on only 10% of the tasks.
To view all plots of the BNSL on each of these tasks, see Figures 25, 26, 27 in Appendix A.24.
To view plots of M1, M2, M3, and M4 on these tasks, see Figure 8 of Alabdulmohsin et al.
In Section A.13, we additionally show that BNSL yields accurate extrapolations of performance on large-scale downstream language tasks when number of model parameters is on the x-axis.
In Section A.14, we show that BNSL accurately models and extrapolates the scaling behavior of sparse models (i.e. sparse, pruned models and sparsely gated mixture-of-expert models).
In Section A.23, we additionally show that BNSL yields accurate extrapolations of performance on large-scale downstream audio (speech recognition) tasks.
In Section A.16, we show BNSL accurately models and extrapolates the scaling behavior with finetuning dataset size on the x-axis and the scaling behavior of computer programming / coding.
In Section A.21, we additionally show BNSL accurately models and extrapolates the scaling behavior of tasks involving molecules.
In Section A.17, we additionally show BNSL accurately models and extrapolates the scaling behavior of uncertainty estimation / calibration
[Table]
5. R EINFORCEMENT L EARNING
We show that BNSL accurately models and extrapolates the scaling behaviors of various multi-agent and single-agent reinforcement learning algorithms trained in various environments.
In the top left plot and top right plot and bottom left plot of Figure 2, BNSL accurately models and extrapolates the scaling behavior of the AlphaZero algorithm trained to play the game Connect Four from Figure 4 and Figure 5 and Figure 3 respectively of Neumann & Gros (2022); the x-axes respectively are compute (FLOPs) used for training, training dataset size (states), and number of model parameters.
In Figure 2 bottom left and bottom right respectively, BNSL accurately models and extrapolates the scaling behavior of the Phasic Policy Gradient (PPG) algorithm
(Cobbe et al., 2021) trained to play the Procgen (Cobbe et al., 2020) game called StarPilot and the scaling behavior of the Proximal
Policy Optimization (PPO) algorithm (Schulman et al., 2017) trained to play the Procgen (Cobbe et al., 2020) game called Heist.
In Section A.18, we find BNSL accurately extrapolates the scaling behavior of a pretrained language model finetuned (i e. aligned) via Reinforcement Learning from Human Feedback (RLHF) to be helpful from Figure 1 of Bai et al.
5. N ON -M ONOTONIC S CALING
We show that BNSL accurately models and extrapolates non-monotonic scaling behaviors that are exhibited by Transformers (Vaswani et al.
in double descent (Nakkiran et al., 2021) in Figure 3.
Various other functional forms are mathematically incapable of expressing non-monotonic behaviors (as shown in Section 4).
5. I NFLECTION P OINTS
We show that BNSL is capable of modeling and extrapolating the scaling behavior of tasks that have an inflection point on a linear-linear plot such as the task of arithmetic (4-digit addition).
Here we model and extrapolate the scaling behavior of a transformer model (Vaswani et al.
with respect to the training dataset size on the 4-digit addition task.
Various other functional forms are mathematically incapable of expressing inflection points on a linear-linear plot (as shown in Section 4) and as a result, are mathematically incapable of expressing and modeling inflection points (on a linear-linear plot) that are present in the scaling behavior of 4-digit addition.
In Figure 4 left, we show that BNSL expresses and accurately models the inflection point present in the scaling behavior of 4-digit addition and as a result accurately extrapolates the scaling behavior of 4 digit addition.
For further details about the hyperparameters please refer to the Appendix Section A.5.
T HE L IMIT OF THE P REDICTABILITY OF S CALING B EHAVIOR
We use BNSL to glean insights about the limit of the predictability of scaling behavior.
Recent papers (Ganguli et al., 2022; Wei et al., 2022a) have advertised many tasks as having “unpredictable” “emergent” “phase transition/change” scaling behavior, the most famous of which is the task of arithmetic.
In the previous section and in Figure 4 left, we successfully predicted (i.e. extrapolated) the scaling behavior of 4-digit addition (arithmetic).
However, we are only able to accurately extrapolate the scaling behavior if given some points from training runs with a training dataset size of at least 720, and the break in which the scaling behavior of 4-digit addition transitions from one power law to another steeper power-law happens at around training dataset size of 415.
Ideally, one would like to be able to extrapolate the entire scaling behavior by fitting only points from before the break.
In Figure 4 right, we use a noiseless simulation of the BNSL of 4-digit addition to show what would happen if one had infinitely many training runs / seeds to average out all the noisy deviation between runs such that one could recover (i.e. learn via a curve-fitting library such as SciPy (Virtanen et al., 2020))
the learned constants of the BNSL as well as possible.
When using this noiseless simulation, we find that we are only able to accurately extrapolate the scaling behavior if given some points from training runs with a training dataset size of at least 415, which is very close to the break.
This has a few implications:
1) When the scaling behavior exhibits greater than
0 breaks that are sufficiently sharp, there is a limit as to how small the maximum (along the x-axis) of the points used for fitting can be if one wants to perfectly extrapolate the scaling behavior, even if one has infinitely many seeds / training runs.
If an additional break of sufficient sharpness happens at a scale that is sufficiently larger than the maximum (along the x-axis) of the points used for fitting, there does not (currently) exist a way to extrapolate the scaling behavior after that additional break.
If a break of sufficient sharpness happens at a scale sufficiently smaller than the maximum (along the x-axis) of the points used for fitting, points smaller (along the x-axis) than that break are often useless for improving extrapolation.
C ONCLUSIONS
Summary.
We have presented a smoothly broken power law functional form that accurately models and extrapolates the scaling behaviors of artificial neural networks for various architectures and for each of various tasks from a very large and diverse set of upstream and downstream tasks.
This set includes large-scale vision, language, audio, video, diffusion, generative modeling, multimodal learning, contrastive learning, AI alignment, robotics, out-of-distribution generalization, continual learning, uncertainty estimation / calibration, adversarial robustness, molecules, computer programming/coding, arithmetic, unsupervised/self-supervised learning, and reinforcement learning (single agent and multi-agent).
When compared to other functional forms for neural scaling behavior, this functional form yields extrapolations of scaling behavior that are considerably more accurate on this set.
Additionally, this functional form accurately models and extrapolates scaling behavior that other functional forms are incapable of expressing such as the non-monotonic transitions present in the scaling behavior of phenomena such as double descent and the delayed, sharp inflection points present in the scaling behavior of tasks such as arithmetic.
Finally, we used this functional form to obtain insights about the limit of the predictability of scaling behavior.
E THICS S TATEMENT
We place relatively high probability on the claim that variants of smoothly broken power laws perhaps are the “true” functional form of the scaling behavior of all(?) things that involve artificial neural networks.
Due to the fact that BNSL is a variant of smoothly broken power laws, an ethical concern one might have about our work is that revealing BNSL might differentially (Hendrycks & Mazeika, 2022) improve A(G)I capabilities progress relative to A(G)I safety/alignment progress.
A counter-argument is that BNSL will also allow the A(G)I safety/alignment field to extrapolate the scaling behaviors of its methods for aligning A(G)I systems and as a result will also accelerate alignment/safety progress.
Existing scaling laws besides BNSL struggle especially to model downstream performance, e.g. on safety-relevant evaluations (especially evaluations (such as interpretability and controllability) that might exhibit non-monotonic scaling behavior in the larger scale systems of the future); we believe our work could differentially help in forecasting emergence of novel capabilities (such as reasoning (Wei et al., 2022b)) or behaviors (such as deception or dishonesty (Evans et al., 2021; Lin et al., 2021)), and thus help avoid unpleasant surprises.
A potential limitation of the current approach is the need to collect enough samples of the system’s performance (i.e. the (x,y) points required for estimating the scaling laws parameters).
A small number of samples sometimes may not be sufficient to accurately fit and extrapolate the BNSL functional form, and obtaining a large number of such samples can sometimes be costly.
This has the ethical implication that entities with more compute to gather more points maybe will have considerably more accurate extrapolations of scaling behavior than entities with less compute.
As a result, entities with less compute (e.g. academia) maybe will have less foresight than entities with more compute (e.g. Big Tech), which could maybe exacerbate the gap between entities with more compute (e.g. Big Tech) and entities with less compute (e.g. academia).
A CKNOWLEDGMENTS
We are thankful for useful feedback and assistance from Kartik Ahuja, Ibrahim Alabdulmohsin,
Ankesh Anand, Jacob Buckman, Guillaume Dumas, Leo Gao, Andy Jones, Behnam Neyshabur,
Gabriel Prato, Stephen Roller, Michael Trazzi, Tony Wu and others.
A A PPENDIX A. A NALYSIS AND E XPLANATION OF WHY BNSL IS SMOOTHLY CONNECTED PIECEWISE ( APPROXIMATELY ) LINEAR FUNCTION ON A LOG - LOG PLOT
Analysing Equation 1 reveals why BNSL is smoothly connected piecewise (approximately) linear function on a log-log plot.
Considering y as a function of z := log( x ) , applying logarithms to both sides and setting a = 0 yields:
[Equation]
We can now see the terms in the sum resemble the well-known softplus function: softplus( x ) :
= log(1 + exp ( x )) , which smoothly interpolates between the constant 0 function and the identity.
By plotting one such term for different values of c i , d i , f
i , it is easy to confirm that they influence the shape of the curve as described in Section 2.
A. D ECOMPOSITION OF B ROKEN N EURAL S CALING L AW INTO POWER LAW SEGMENTS THAT IT IS COMPOSED OF
We now show a way to decompose a BNSL (Equation 1) with 3 breaks into the power law segments that it is composed of.
This decomposition is what we used to produce segments 1-4 overlaid in
Figure 1 and is usable when values of f in Equation 1 are not too large.
This decomposition pattern is straight-forward to extend to n breaks.
segment 1 = b ∗ ( x ) − ( c 0 ) segment 2 = b ∗ ( d 1 ) − ( c 0 ) ∗ ( x /d 1 ) − ( c 1 + c 0 ) segment 3 = b ∗ ( d 1 ) − ( c 0 ) ∗ ( d 2 /d 1 ) − ( c 1 + c 0 ) ∗ ( x /d 2 ) − ( c 2 + c 1 + c 0 ) segment 4 = b ∗ ( d 1 ) − ( c 0 ) ∗ ( d 2 /d 1 ) − ( c 1 + c
0 ) ∗ (
[Table] [Table]
2 ) −
[Table]
∗ (
[Table] [Table]
) − (
[Table]
A. D EFINITION OF R OOT M EAN S QUARED L OG E RROR
Root Mean Squared Log Error =
RMSLE = (cid:118)(cid:117)(cid:117)(cid:116)
( n (cid:88) i =
( log ( y i ) − log (ˆ y i )) 2 ) /n
A. D EFINITION OF R OOT S TANDARD L OG E RROR
error =
( log ( y i ) − log (ˆ y i )) 2 ) µ error = 1 N
N (cid:88) i = error σ error = (cid:118)(cid:117)(cid:117)(cid:116)
N −
N (cid:88) i = ( error i − µ error )
Root Standard Log Error = (cid:115) µ error + σ error (cid:112) len (ˆ y ) − √ µ error
A. E XPERIMENTAL DETAILS OF S ECTION 5.
We perform an extensive set of experiments to model and extrapolate the scaling behavior for the 4-digit arithmetic addition task with respect to the training dataset size.
Our code is based on the minGPT implementation (Karpathy, 2020).
We set the batch size equal to the training dataset size.
We do not use dropout or a learning rate decay here.
Each experiment was run on a single V
GPU and each run took less than 2 hours.
For our experiments we train the transformer model using the following set of hyperparameters:
[Table] [Table]
A. E XPERIMENTAL DETAILS OF FITTING BNSL
We fit BNSL as follows: We first use scipy.optimize.brute to do a grid search of the values of the constants ( a, b, c 0 , c 1 ...c n , d 1 ...d n , f 1 ...f n ) of BNSL that best minimize the mean squared log error (MSLE) between the real data and the output of BNSL.
We then use the values obtained from the grid search as the initialization of the non-linear least squares algorithm of scipy.optimize.curve fit.
We then use the non-linear least squares algorithm of scipy.optimize.curve fit to minimize the mean squared log error (MSLE) between the real data and the output of BNSL.
The version of MSLE we use for such optimization is the following numerically stable variant:
Numerically Stable
[Equation]
A.
E
XTRAPOLATION TO S
CALES THAT ARE AN O RDER OF M AGNITUDE LARGER THAN THE
MAXIMUM ( ALONG THE X - AXIS ) OF THE POINTS USED FOR FITTING
In Figure we show that BNSL accurately extrapolates to scales that are an order of magnitude larger than the maximum (along the x-axis) of the points used for fitting.
The upstream task is supervised pretraining of MLP mixers (MiX)
(Tolstikhin et al., 2021)
i
A.
[Table]
In Figure 6 via fitting BNSL we additionally obtain accurate extrapolations of scaling behavior of large-scale downstream vision tasks when compute (FLOPs) used for (pre-)training is on the xaxis and compute is scaled in the manner that is Pareto optimal with respect to the performance evaluation metric (downstream accuracy in this case).
The experimental scaling data was obtained from Figure 2 of Zhai et al.
(2021) and as a result in Table 6 we compare extrapolation of BNSL to the extrapolation of M3 (which was proposed in Zhai et al.
; we find that BNSL that yields extrapolations of scaling behavior that are more accurate on these tasks.
A. E XTRAPOLATION R ESULTS FOR D IFFUSION G ENERATIVE M ODELS OF I MAGES
In Figure 7, we show that BNSL accurately extrapolates the scaling behavior of Diffusion Generative
Models of Images from Figure 10 of Nichol & Dhariwal (2021) when Negative Log-likelihood (NLL) or Frechet Inception Distance (FID) score is on the y-axis and compute used for training is on the x-axis compute is scaled in the manner that is Pareto optimal with respect to the performance evaluation on the y-axis
A. E XTRAPOLATION R ESULTS FOR G ENERATIVE M ODELS OF V IDEO
Upstream Test Cross-Entropy is on the y-axis.
Videos scraped from the web are the evaluation dataset.
During training, compute (used for training autoregressive transformer) on the x-axis is scaled in the manner that is Pareto optimal with evaluation
In Figure we show that BNSL accurately extrapolates the scaling behavior of generative models of video.
Each frame is downsampled to a pixel resolution of 64x64; each frame is then tokenized via a pretrained 16x16 VQVAE (Van Den Oord et al., 2017) to obtain 256 tokens per frame.consecutive frames are then input to an autoregressive transformer as a
4096 (16x16x16) sequence.
The dataset is 100 hours of videos scraped from the web.
See section 2 of Henighan et al.
A. E XTRAPOLATION R ESULTS WHEN D ATA IS P RUNED
[Figure]
ARETO O PTIMALLY
In Figure 9, we show that BNSL accurately extrapolates the scaling behavior when data is pruned
Pareto optimally (such that each point along the x-axis uses the subset of the dataset that yields the best performance (y-axis value) for that dataset size (x-axis value
Figure 3D
Sorscher et al
A.
[Figure]
In Figure 10, we show that BNSL accurately extrapolates the scaling behavior when upstream performance is on the x-axis and downstream performance is on the y-axis.
The upstream task is supervised pretraining of ViT (Dosovitskiy et al., 2020) on subsets of JFT-300M (Sun et al., 2017).
The downstream task is 20-shot ImageNet classification.
The experimental data of this scaling behavior is obtained from Figure 5 of Abnar et al.
A
We find in general for each of every modality that the variance between seeds is higher when number of model parameters is on x-axis (as opposed to e.g. training dataset size on the x-axis).
Table H.1 of the GPT-3 arXiv paper (Brown et al., 2020) release includes results for 8 numbers of model parameters.
In Figure 11, we include examples of when 8 numbers of model parameters (7 for fitting, and largest held-out to evaluate extrapolation) are sufficient for obtaining accurate downstream extrapolation from BNSL due to variance between seeds being low enough.
For many other downstream tasks with number of model parameters on the x-axis, the variance between seeds is much higher such that a number considerably larger than 7 points along the curve is needed to obtain an accurate extrapolation.
[Figure]
In Figure we find BNSL accurately extrapolates the scaling behavior of various sparse models (i e. sparse, pruned models and sparsely gated mixture-of-expert models).
A. E XTRAPOLATION R ESULTS FOR A DVERSARIAL R OBUSTNESS
In Figure we find BNSL accurately extrapolates the scaling behavior of adversarial robustness.
The adversarial test set is constructed via a projected gradient descent (PGD) attacker (Madry et al., 2018) of 20 iterations.
During training, adversarial examples for training are constructed by PGD attacker of 30 iterations.
A. E XTRAPOLATION R ESULTS WITH F INETUNING D ATASET S IZE ON THE X- AXIS ( AND ALSO FOR C OMPUTER P ROGRAMMING / C ODING )
In Figure we find BNSL accurately models and extrapolates the scaling behavior with finetuning dataset size on the x-axis
(i e. model that is pretrained on a large amount of mostly english text from the internet and then finetuned on a large amount of python code)
. A. E XTRAPOLATION R ESULTS FOR U NCERTAINTY E STIMATION / C ALIBRATION
In Figure we find BNSL accurately extrapolates the scaling behavior of downstream uncertainty estimation / calibration on BIG-Bench (Srivastava et al.
[Figure]
E XTRAPOLATION R ESULTS FOR AI A LIGNMENT VIA RLHF
In Figure we find BNSL accurately extrapolates the scaling behavior of a pretrained language model finetuned (i e. aligned) via Reinforcement Learning from Human Feedback (RLHF) to be helpful from Figure 1 of Bai et al.
The y-axis is Elo score based on crowdworker preferences.
The x-axis is the number of model parameters that the language model contains.
A.
E XTRAPOLATION R ESULTS FOR C ONTINUAL L EARNING ( I . E . C ATASTROPHIC F ORGETTING )
In Figure we find that BNSL accurately extrapolates the scaling behavior of continual learning
A. E XTRAPOLATION R ESULTS FOR R OBOTICS (O UT - OF -D ISTRIBUTION G ENERALIZATION AND I N - DISTRIBUTION G ENERALIZATION )
In Figure 18, we find BNSL accurately extrapolates the scaling behavior of a transporter (Zeng et al., 2021) model trained via imitation learning to do robotic control tasks.
Plots with “unseen-colors” in the plot title evaluate on a test set that contains colors that are unseen (i.e. out-of-distribution) with respect to the training set.
Plots with “seen-colors” in the plot title evaluate on a test set that contains colors that are seen (i.e. in-distribution) with respect to the training set.
[Figure]
E XTRAPOLATION R ESULTS FOR M OLECULES
In Figure 19, we find BNSL accurately extrapolates the scaling behavior of Neural Equivariant
Interatomic Potentials (NequIP) graph neural networks (Batzner et al., 2022) trained via minimizing the weighted sum of energy and a force loss terms in order to predict the forces of molecules.
A. E XTRAPOLATION R ESULTS FOR D OWNSTREAM P ERFORMANCE OF M ULTIMODAL C ONTRASTIVE L EARNING ( I . E . N ON -G ENERATIVE U NSUPERVISED L EARNING )
In Figure we show that BNSL accurately extrapolates the scaling behavior of the Downstream
Performance of Multimodal Contrastive Learning (i e. Non-Generative Unsupervised Learning).
A. E XTRAPOLATION R ESULTS FOR D OWNSTREAM P ERFORMANCE ON A UDIO T ASKS
In Figure we show that BNSL accurately extrapolates the scaling behavior of the Downstream
Performance on Audio Tasks.
A. P LOTS OF BNSL E XTRAPOLATIONS ON S CALING L AWS B ENCHMARK OF
[Figure]
[Figure] [Figure]