Chapter 9 · Section 9.6 · 50 min

Emergence, prediction, and test-time scaling

Ask GPT-3 models of increasing size to add two three-digit numbers, with a couple of examples in the prompt. The small ones score close to zero. Then, somewhere around 13 billion parameters, accuracy shoots up. Plotted against scale, the curve looks less like a power law than like a light switch. Wei et al. (2022) collected dozens of such cases and called them emergent abilities, abilities that are absent in smaller models and present in larger ones, appearing at a scale nobody predicted in advance.

If that picture is right, it undercuts everything else in this chapter. Scaling laws predict loss beautifully, but nobody deploys a model for its loss. If useful abilities, or dangerous ones, switch on suddenly at unpredictable scales, then the smooth curves tell us little about what the next model will be able to do. In 2023 Schaeffer, Miranda, and Koyejo argued that much of the suddenness is an illusion created by how we score models, and their argument is one of the most useful pieces of measurement hygiene in the field.

This section examines both sides, then shows how labs actually predict downstream performance from small models, looks at the newer scaling axes of reinforcement learning and test-time compute, and closes with a list of what scaling laws cannot tell you.

What emergence means

Wei et al. (2022) gave the definition plainly. "An ability is emergent if it is not present in smaller models but is present in larger models." On a plot of performance against scale, emergence looks like near-chance performance up to some threshold, then a sharp rise. Their examples, measured with few-shot prompting, include these.

taskwhere it emerges (training FLOPs)
modified arithmetic, 3-digit addition and subtractionabout 2×10222\times10^{22} (GPT-3, 13B) and 102310^{23} (LaMDA, 68B)
IPA transliteration, word unscrambling, Persian QAaround the same scale
TruthfulQAonly at Gopher's scale, about 5×10235\times10^{23} (280B)
MMLU, 57 subjectsnear chance up to about 102210^{22}, above it from 33 to 5×10235\times10^{23} (70B to 280B)
word-in-context (WiC)at chance up to about 5×10235\times10^{23}, above it only with PaLM at 2.5×10242.5\times10^{24} (540B)

Wei et al. also noticed something important in their own data. For six BIG-Bench tasks, the models' cross-entropy loss on the correct answers kept improving smoothly at small scales, where exact match, BLEU, and accuracy sat flat near chance. The models were getting better all along. The metric just did not show it. As they put it, this "does not explain why downstream metrics are emergent or enable us to predict the scale at which emergence occurs." That gap is where the critique begins.

Sudden changes also happen during training, a different but related phenomenon. Induction heads, the copying circuit built by hand in §4.7, form in a brief phase change early in training, visible as a bump in the loss curve, which you watched happen in §6.8, and small networks trained on algorithmic tasks can generalize abruptly long after they have memorized their training set, which Power et al. (2022) called grokking.

The metric-choice critique

Schaeffer et al. (2023) start from a simple model. Suppose the per-token cross-entropy of a family of models falls as a power law in parameters NN, as every law in this chapter says it does,

LCE(N)=(cN)a,c>0,  a>0.\mathcal{L}_{\text{CE}}(N) = \left(\frac{c}{N}\right)^{a}, \qquad c > 0,\; a > 0 .

The probability that the model gets one token of the answer right is then about p(N)=e−LCE(N)p(N) = e^{-\mathcal{L}_{\text{CE}}(N)}, which rises smoothly toward 1. Now score an answer of mm tokens in two ways.

  • Exact match requires every token to be right, so accuracy(N)≈p(N)m\text{accuracy}(N) \approx p(N)^{m}.
  • Token edit distance counts the wrong tokens, so it is about m (1−p(N))m\,(1 - p(N)).

In plain words, the same smooth improvement in per-token probability is raised to the mm-th power by exact match, and merely scaled by mm by edit distance.

The power is what creates the switch. Take m=10m = 10. If per-token accuracy improves from 0.80 to 0.95, a modest and steady gain, exact match goes from 0.810=0.1070.8^{10} = 0.107 to 0.9510=0.5990.95^{10} = 0.599, and if per-token accuracy is 0.5 it is 0.510≈0.0010.5^{10} \approx 0.001, indistinguishable from zero. A nonlinear metric turns a gentle slope into a cliff, and the longer the answer, the sharper and later the cliff.

∂ Where the cliff sits and how steep it is

Exact match crosses a level qq (say q=12q = \tfrac12) when pm=qp^m = q, that is when LCE=−log⁡q/m\mathcal{L}_{\text{CE}} = -\log q / m. With LCE=(c/N)a\mathcal{L}_{\text{CE}} = (c/N)^a, that happens at

N∗(m)=c(m−log⁡q)1/a.N^\ast(m) = c\left(\frac{m}{-\log q}\right)^{1/a} .

So doubling the answer length delays the apparent emergence by a factor 21/a2^{1/a} in model size. With a=0.44a = 0.44 (the widget's toy family), that is a factor of about 4.8.

The steepness against log⁡N\log N is

d pmdlog⁡N=m pm dlog⁡pdlog⁡N=m pm⋅a LCE,\frac{d\,p^m}{d\log N} = m\,p^{m}\,\frac{d\log p}{d\log N} = m\,p^{m}\cdot a\,\mathcal{L}_{\text{CE}} ,

using log⁡p=−LCE\log p = -\mathcal{L}_{\text{CE}} and dLCE/dlog⁡N=−a LCEd\mathcal{L}_{\text{CE}}/d\log N = -a\,\mathcal{L}_{\text{CE}}. At the crossing, pm=qp^m = q and LCE=−log⁡q/m\mathcal{L}_{\text{CE}} = -\log q/m, so the slope there is q a (−log⁡q)q\,a\,(-\log q), the same for every mm in units of log⁡N\log N. What changes with mm is where the rise happens, and the fact that before it exact match is exponentially close to zero. On a plot whose range starts below N∗N^\ast, a curve that is smooth on a logarithmic scale of accuracy looks like a step on a linear one.

Here is the toy model in numbers, for a family of eleven models from 10 million to 1 trillion parameters, with answers ten tokens long and a benchmark of 200 questions.

Python · cell 1

The per-token loss falls by the same factor, 10−0.22≈0.610^{-0.22} \approx 0.6, at every step, and per-token accuracy and edit distance improve steadily. Exact match is below 1 percent for every model up to 100 million parameters, which the 200-question benchmark reports as exactly zero, and then it climbs past one half within about two decades of scale. Nothing about the models changed abruptly. Only the scoring did.

Is an ability emergent, or is the metric making it look that way?
One family of models whose per-token loss falls smoothly with size. The same predictions are scored four ways on an answer several tokens long. Only some scores jump.
Loading interactive figure…
Warm-up

When does exact match appear to emerge?

Implement exact_match(N, c, a, m) returning e−m (c/N)ae^{-m\,(c/N)^a}, the toy model's exact-match accuracy on mm-token answers, and emergence_size(c, a, m, q=0.5) returning the size N∗N^\ast at which exact match equals qq. Both should work elementwise on arrays.

Hidden tests, hints, and AI help, from $1.99 a month.

Too few examples to see small numbers

The second half of the argument is about resolution. A test set of nn examples cannot report an accuracy between 0 and 1/n1/n. If a small model's true exact-match accuracy is 10−410^{-4} and the benchmark has 200 questions, the chance it scores even one is 1−(1−10−4)200≈21 - (1 - 10^{-4})^{200} \approx 2 percent, so it will almost always score exactly zero. A family of models whose accuracy rises smoothly from 10−510^{-5} to 10−110^{-1} on a log scale will show a row of zeros followed by a jump. This is the rule of three of §0.11 read backward. Zero successes in nn trials only bound the accuracy below about 3/n3/n, so a row of zeros on 200 questions says the small models are under 1.5 percent, not that they are at zero. Schaeffer et al. showed that with enough test data, all the models in their arithmetic study scored above zero.

Core

How big a test set do you need?

Implement prob_all_wrong(acc, n), the probability that a model with per-example accuracy acc gets none of n independent test examples right, and test_size_to_see(acc, conf=0.95), the smallest integer nn for which the probability of at least one correct answer is at least conf. Avoid floating-point loops over nn.

Hidden tests, hints, and AI help, from $1.99 a month.

The evidence

Schaeffer et al. tested their explanation three ways. They re-scored the GPT-3 and InstructGPT arithmetic results that had been cited as emergent, two-shot multiplication of two-digit numbers and addition of four-digit numbers, and found that the jumps under accuracy became smooth, predictable curves under token edit distance. They surveyed BIG-Bench and found that over 92 percent of the emergent abilities annotated there appear under just two metrics, multiple-choice grade and exact string match, both discontinuous. And they created emergence on demand in vision models, autoencoders on CIFAR-100 and Transformers on Omniglot, by scoring them with a sharp threshold metric. Their conclusion was that emergent abilities "appear due to the researcher's choice of metric" and "evaporate with different metrics or with better statistics."

Here is the same effect in a real experiment. We train MLPs of five sizes to add two four-digit numbers, and score them by per-digit accuracy and by exact match of the five-digit answer.

🔥 In PyTorchfor a machine with PyTorch

Per-digit accuracy climbs steadily from about 0.40 to 0.97, and the loss falls steadily with it. Exact match stays below 7 percent for the three smallest models and then leaps to 0.6 and 0.87. The same networks, the same predictions, two pictures.

Not all emergence is a mirage

The critique is powerful, but it does not settle everything, and a good answer in an interview acknowledges both sides.

  • Some tasks are genuinely all-or-nothing. A proof with one wrong step is wrong, and a program that fails one test does not work. For such tasks exact match is the metric users care about, and a sharp rise in it is a real change in what the model can do, even if a smooth quantity underlies it.
  • Knowing a smooth quantity exists is not the same as predicting the jump. To predict when exact match crosses 50 percent, you need the right underlying quantity, its exponent, and the mapping from it to the metric, which is the subject of the next part. Wei et al.'s point that smooth cross-entropy does not by itself predict where emergence happens still stands.
  • Some abilities track loss thresholds. Du et al. (2024) found that models of different sizes and amounts of data gain certain abilities once their pre-training loss falls "below a specific threshold", and perform at chance before. That is emergence with respect to loss rather than to parameters, and it is predictable if you can forecast loss.

The practical conclusion is to measure with continuous metrics during development (log-likelihood of the correct answer, edit distance, Brier score), use large enough test sets to resolve small probabilities, and treat a jump in a discontinuous metric as a prompt to look for the smooth quantity underneath.

Predicting downstream performance

Labs do not wait to see what a model can do. They predict it from small models before training, using variations of one idea. First forecast a smooth quantity that scales well with compute, then map it to the metric with a function fitted on models that already exist.

GPT-4. OpenAI predicted GPT-4's final loss on an internal codebase by "fitting a scaling law with an irreducible loss term", L(C)=aCb+c\mathcal{L}(C) = aC^{b} + c, to models trained with the same methodology using at most 10,000 times less compute, and predicted its pass rate on a subset of HumanEval coding problems from models with at most 1,000 times less compute, by fitting the mean log pass rate as a power law, −EP[log⁡pass_rate(C)]=αC−k-\mathbb{E}_P[\log \text{pass\_rate}(C)] = \alpha C^{-k} (OpenAI 2023). The prediction was shown for one of six difficulty buckets, and on the easiest bucket GPT-4 fell short of it, a reminder that even good forecasts have exceptions.

Llama 3. Meta used two steps (Dubey et al. 2024). First, for compute-optimal models from their isoFLOP study (up to 102210^{22} FLOPs), they related the normalized negative log-likelihood of the correct answer on a benchmark to training FLOPs. Second, they fitted a sigmoid mapping that log-likelihood to accuracy, using both the small scaling-law models and the existing Llama 2 models, which reach the high-accuracy part of the curve. Composing the two predicted the 405B model's ARC Challenge accuracy across four orders of magnitude of compute, and it "only slightly underestimates the final performance of the flagship Llama 3 model."

Over-trained models and averages. Gadre et al. (2024) related loss to the average top-1 error over 17 tasks, Err(L)=ϵ−k e−γL\text{Err}(\mathcal{L}) = \epsilon - k\,e^{-\gamma\mathcal{L}}, as described in §9.4.

Observational scaling laws. Ruan et al. (2024) skipped training altogether. Using about 100 public models from many families, they found that benchmark performance is well described by a low-dimensional "capability space", with families differing mainly in how efficiently they turn compute into those capabilities. With it they predicted several supposedly emergent abilities as smooth sigmoids from smaller models, and the agent performance of models such as GPT-4 from simpler benchmarks.

The two-step method is a classic interview task, so you will build it.

Interview

Predict downstream accuracy in two steps

The setup provides SMALL_C and SMALL_NLL, the training compute and the negative log-likelihood of correct answers for small scaling-law models, and FAMILY_NLL and FAMILY_ACC, the same likelihood and the benchmark accuracy for a family of existing models of many sizes. The benchmark has four choices, so chance is 0.25. Implement two_step_predict(C_target) that (1) fits the likelihood as a straight line in log⁡10C\log_{10}C using the small models, (2) fits accuracy as 0.25+0.75/(1+ek(nll−m))0.25 + 0.75/(1 + e^{k(\text{nll} - m)}) using the family, with scipy.optimize.curve_fit, and (3) returns the predicted accuracy at C_target. It should also work for an array of targets.

Hidden tests, hints, and AI help, from $1.99 a month.

New axes, reinforcement learning and test-time compute

For years "scaling" meant pretraining compute. Two other axes now matter as much, and both show scaling behavior of their own. They are developed fully in Chapter 18, so here we only connect them to this chapter.

Test-time compute. A model can spend more computation on each problem at inference time, by generating a longer chain of thought, sampling many answers and picking one, or searching with a verifier. OpenAI's o1 announcement reported that "the performance of o1 consistently improves with more reinforcement learning (train-time compute) and with more time spent thinking (test-time compute)" (OpenAI 2024). Brown et al. (2024) found that coverage, the fraction of problems solved by at least one of kk samples, grows smoothly over four orders of magnitude of kk, following an exponentiated power law, log⁡(coverage)≈a kb\log(\text{coverage}) \approx a\,k^{b}. On SWE-bench Lite, DeepSeek-Coder-V2-Instruct went from 15.9 percent with one sample to 56 percent with 250, past the single-sample state of the art of 43 percent at the time. Turning coverage into accuracy needs a way to pick the right sample, a verifier, which is the topic of §18.2.

Trading training for inference. Jones (2021), studying AlphaZero on the board game Hex, found that train-time and test-time compute trade off log-linearly, "for each additional 10× of train-time compute, about 15× of test-time compute can be eliminated." Snell et al. (2024) asked the same question for language models on math. Spending test-time compute adaptively, by problem difficulty, improved efficiency "by more than 4× compared to a best-of-N baseline", and in a FLOPs-matched comparison, on problems where a smaller model already had some success, test-time compute could "outperform a 14× larger model". On the hardest problems, and when inference would be heavy relative to pretraining, more pretraining remained the better buy. This is the same kind of trade-off as §9.4, with test-time compute as one more term in the budget (§18.7).

Reinforcement learning compute. Reinforcement learning on reasoning tasks (§18.4) also scales predictably, but its curves saturate. Khatri et al. (2025), in a study using more than 400,000 GPU-hours, fit reward against RL compute with a sigmoid, RC−R0=(A−R0)/(1+(Cmid/C)B)R_C - R_0 = (A - R_0)/(1 + (C_{\text{mid}}/C)^{B}), where AA is the asymptotic reward, BB the efficiency exponent, and CmidC_{\text{mid}} the compute at half the gain, and used early parts of runs to predict later ones. Some recipe choices raised the ceiling AA, while many others changed only the efficiency BB, reaching the same ceiling faster or slower. Telling the two apart from the early part of a run is the RL analogue of comparing two architectures' scaling laws.

Core

Coverage from repeated sampling

A set of problems has per-sample success probabilities p (one per problem). Implement coverage(p, k), the expected fraction of problems solved by at least one of k independent samples, which should accept an array of k values and return one coverage per k. Then implement samples_for_coverage(p, target), the smallest integer k whose coverage reaches target, or None if no k can (some problems have p = 0). Use doubling followed by bisection, not a linear scan, because the answer can be in the millions.

Hidden tests, hints, and AI help, from $1.99 a month.

What scaling laws cannot tell you

Scaling laws are the most reliable quantitative tool in modern AI, and that makes it easy to forget their limits. Here they are, gathered in one place.

  1. Which specific abilities appear, and when. Loss is an average over everything in the data. A particular skill can sit on a flat or a steep part of its own curve, and its metric can hide it. Ganguli et al. (2022) summarized this as an "unusual combination of predictable loss on a broad training distribution ... and unpredictable specific capabilities, inputs, and outputs."
  2. Whether bigger is better on every task. The Inverse Scaling Prize (McKenzie et al. 2023) collected tasks where larger models do worse, for reasons including a preference for repeating memorized text over following instructions, imitating undesirable patterns in the data, distractor tasks, and misleading few-shot examples. Some of these trends later turned U-shaped at still larger scales (Wei et al. 2023), which shows how unreliable extrapolating a downstream trend can be.
  3. How a model behaves where it was not measured. Safety properties, robustness to adversarial prompts, and behavior far from the training distribution are not functions of loss. They are measured, not extrapolated (§19.4).
  4. What a change in recipe will do. A law describes one architecture, data mixture, tokenizer, and training recipe. A new optimizer, a better data filter, or a mixture-of-experts layer (§13.1) shifts the constants and sometimes the exponents, and the only way to know is to fit again.
  5. Whether loss is the right target. Lower loss on web text is a proxy for usefulness, and post-training (§14.1) can move capabilities much more than the pretraining loss suggests.
  6. Where the floor really is. EE is fitted, not measured, and over a short range of scales it is poorly identified (§9.1). Statements like "we are close to the irreducible loss" are extrapolations of extrapolations.
  7. Whether the inputs will exist. A law that calls for 100 trillion high-quality tokens or a gigawatt of power says nothing about whether you can get them (§9.4).

Read more

Watch next

🎬 Jason Wei -- Emergence in Large Language Models (March 1st 2023) · Generative AI at MITThe author of the emergent abilities paper explains what he means by emergence and why it matters.
🎬 Are Emergent Abilities of Large Language Models a Mirage? - IEEE @ Stanford Unviersty · Brando MirandaA co-author presents the metric-choice critique and the experiments that make emergence appear and disappear.
🎬 Speculations on Test-Time Scaling (o1) · Sasha RushA careful survey of what is known about scaling test-time compute, as a bridge to Chapter 18.