ai.si
Field notes

From AI to SI

With a Fixed Training Budget, Should a Lab Use a Bigger Model or More Data?

Bottom line

At comparable training compute, Chinchilla used fewer parameters and more training tokens than Gopher. A lab applying that result needs to check its usable data, target workload and cost of serving the trained model.

Examples feed a model, its outputs pass through a check, and selected material loops back to the examples.

In a learning loop, follow the information that changes the next attempt and identify what checks it.

For a range of dense models, it appeared optimal to spend increases in the available computation on roughly equal proportional increases in parameters and training tokens. This was most strikingly demonstrated when the authors trained a model with far fewer parameters, but on several times more tokens, than Gopher, and got better results on most tasks for a similar total computation. However, there are several considerations to determine before concluding that this is what one would want to do. What quantity does one most want to minimize? How much good quality data is available? How much of the total expenditure will be on inference? Training Compute-Optimal Large Language Models

Number of parameters only indicates, roughly, how big a network each token is run through. Number of training tokens does not indicate how much each token is "worked on" by the network. Two scaling studies reached different conclusions about the best allocation of that budget.

Two ways to spend the same budget

Imagine having a budget of computation sufficient to run 10 billion parameters over 200 billion tokens. Alternatively, run 20 billion parameters over 100 billion tokens. To a reasonable degree of approximation these would require the same computation, since, very approximately, computation is proportional to the product of the two. There are various qualifications, such as length of sequence run through the model at one time, cost of the inner products for the attention mechanism, and whether all parameters or only those involved in the feed-forward layers are included. See, for example, Hoffmann et al., Appendix F

So with double the parameters, you have that many more "dials" to turn, to capture features in the data. But you have trained on half as many training tokens. Training on 400 billion tokens with 10 billion parameters would require approximately twice the computation, so that is not comparable to the original question, but rather to what happens with more money overall. Of course, to vary one, you must vary the other in the opposite direction, to keep the computation constant.

None of this assumes the optimum lies at 10 billion parameters, or 20 billion. One can do a series of runs over a range of sizes, varying the token count to match the compute budget, using comparable data mixtures and training details. Plot held-out loss against the number of parameters. If loss rises at both small and large model sizes, inspect the minimum. Do this for various budgets of computation to see how it varies. One such curve guides the decision for its own compute budget.

How the earlier fit favored larger models

Kaplan et al. looked at test set cross-entropy over a range of numbers of parameters, amounts of training data and total computation. The cross-entropy will tend to decrease as the model predicts the next words more accurately. That would be expected to help many applications, but there is no necessity that any given question put to it would be correctly answered. So "optimal" is optimal for this particular test set measure. Scaling Laws for Neural Language Models

They concluded that, because bigger models learned more quickly per iteration, as computation was increased it was beneficial to increase model size more rapidly than the amount of data. Also, they recommended stopping training of some sizes of model well short of an asymptote on the training curve, as continued training to an asymptote was less efficient, in terms of final performance per unit computation, than training a different model.

It would be wrong to compare per-iteration cost. If the larger model required twice the computation per iteration, but only one third of the number of iterations to reach the desired level of test set performance, total computation would be about two thirds as much. On the other hand, if it required 75% as many iterations, total computation would be 1.5 times as much. So a bigger model could learn from each example more and yet take more total computation. The actual experiments determine which is the greater effect.

How Chinchilla matched compute across runs

One of the variations tried by Hoffmann et al. was to fix total computation and vary model size, with corresponding variation in the number of training tokens to keep total computation constant. Each run stops when it reaches its intended budget. They varied the length of the learning rate schedule to correspond to the length of run. Presumably, interrupting a longer run to take weights part-way through would give different results from a run planned to finish at that point. These are shown as a set of isoFLOP curves. Hoffmann et al., Figure 3 and Appendix B

They used 3 ways of estimating the power-law relationship between optimum number of parameters and computation, getting exponents between 0.46 and 0.50. For optimum training tokens the corresponding range was 0.50 to 0.54. Kaplan et al.'s equivalent figures would have been 0.73 and 0.27. Of course these depend on the range of experiments available to be fitted. But they allow a rough idea of the effect of, say, increasing computation under each set of conclusions. Hoffmann et al., Table 2

With half-power exponents, if computation increased fourfold, each quantity would increase by the square root of 4, that is, doubled. With the exponents from Kaplan et al., model size would increase by four raised to 0.73, about 2.75-fold, and the number of tokens by four raised to 0.27, about 1.45-fold. The product would be 4, as it must be, to respect the fourfold increase in total computation. The difference is in how well the resulting model is predicted to perform. This calculation should not be taken as replicating their results.

What the large-scale comparison established

Having done these and other experiments over smaller ranges of model sizes and data, they then did a very large run, of 70 billion parameters over 1.4 trillion tokens. As above, this was said to be comparable to the computation used on Gopher, 280 billion parameters over about 300 billion tokens. Chinchilla outperformed Gopher on many test sets. Thus it supported the trend found over smaller models, on a much larger scale. So it is misleading to refer to "70 billion parameters" outperforming "280 billion parameters" without also mentioning the amount of data. Hoffmann et al., Tables 1 and 4

The two runs also differed in their sampling mixtures. So the wide range of tests is supportive of, but not a direct demonstration of, the effect of relative amounts of parameters and training data. For that purpose, the isoFLOP curves are more directly relevant. So one set of results indicates what happens if this policy is followed on a very large scale, while the other indicates that it is likely to be beneficial. Hoffmann et al., Appendix A and Section 3

It is the source of the often-quoted figure of 20 times as many tokens as parameters. 1.4 trillion divided by 70 billion is 20. This should not be confused with the power-law exponent, nor assumed to be the best ratio for all data. If there was a very different distribution over types of document, or substantial duplication, 20 tokens per parameter could be very misleading. There is nothing to prevent going over the same token more than once, but it may not add as much new information as another, different, token.

Where data and inference costs change the decision

So, if one knows one has 100 billion tokens of suitable material available, and money to spend on more computation, that does not help if one wants to train on several hundred billion. One could repeat the 100 billion, get more data, or train on other types of data. All would be different experiments, any of which could be done on a small scale to see what effect they had, if the test set was representative. No amount of extrapolation of curves can indicate what data one is allowed to access, or what form further data would take.

Or, if one expects to run the model to answer many queries per day, and both sizes of model would give an acceptable answer, one may prefer to pay for more training to get a model requiring less computation per query. Then minimizing test set error, for a given amount of training computation, is an incomplete specification of requirements. One would want to compare the total cost of training plus running the model to answer the expected number of queries per unit time, within specified limits of response time and quality of answer. Computation and cost may well vary independently, depending on efficiency of using available hardware.

And, of course, compare with the original reason for wanting the model. It may do badly at what one most wants it to do, despite good performance on other measures. For example, if it is to be used to produce a summary of specified documents, test on unseen examples of those documents, with an appropriate measure to detect spurious information. Then, if acceptable, further test it doing that job. A good cross-entropy on other material would be a reason to do so, but no substitute.

For a proposed run, identify the smallest experiment that could change the decision. It may be to train a smaller model for more tokens at matched compute on the same data distribution; or to repeat a similar experiment with an appropriate learning rate profile. Define what test set performance is to be measured, and what the model is to be used for. Then, if under consideration are two models both trainable within the available resources, there is no reason why the one with most parameters should get preferential claim on any further resources.

Vary the parameter and token counts inversely at fixed training compute, then report the resulting loss. Then any assertion that a sequence of such experiments is leading to ever more powerful models, should state which aspects (data distribution, type of model, test set, etc.) are assumed constant and which need to be experimented on.

References

All field notes