Paper notes

Chain-of-thought prompting: exemplars with intermediate steps let large models solve multi-step problems

Chain-of-thought (CoT) prompting writes the intermediate steps into few-shot exemplars so a model reasons before it answers; with eight exemplars PaLM 540B rises from 17.9% to 56.9% on GSM8K. It rechecks the paper's tables and compares direct answers, filler dots and CoT on Qwen2.5 models.

Published Updated 44 min read

On this page
  1. Why this paper is worth reading
  2. Background: why direct answers fall short on multi-step reasoning
  3. Method: write the reasoning chain into the exemplars
  4. The paper’s experiments and conclusions
  5. Arithmetic reasoning: five datasets, five models
  6. Ablations and robustness
  7. Commonsense and symbolic reasoning
  8. Recheck: recomputing the paper’s numbers
  9. Hands-on: three prompt styles on three Qwen2.5 models
  10. Limitations and what came next
  11. What to take from this paper
  12. Further reading
  13. FAQ

“Chain-of-Thought Prompting Elicits Reasoning in Large Language Models” (Wei, Wang, Schuurmans, Bosma and others at Google Research; arXiv 2201.11903; NeurIPS 2022; the chain-of-thought paper below) introduced chain-of-thought prompting (CoT): each exemplar in a few-shot prompt is no longer just “question → answer” but “question → a series of intermediate reasoning steps → answer”, and a large enough language model facing a new question then also writes its steps before the conclusion. Nothing is trained and no parameter changes; only the way the exemplars are written. With eight handwritten exemplars the paper lifts PaLM 540B on the grade-school math benchmark GSM8K from 17.9% with standard prompting to 56.9%, above the earlier best of 55% from a fine-tuned GPT-3 with a verifier. Below about 10B parameters, though, chain of thought mostly does worse than answering directly.

This post does two things. Recheck: it recomputes Tables 1, 2 and 3 of the paper, including the gains, the role of the external calculator, the claim that chain of thought appears “at about 100B” and the correlation of difficulty with gain. Most numbers agree (the 40 numbers that Tables 1 and 2 both give for the same cell are identical), but several summaries need a discount: of the 65 cells of Table 2, chain of thought is worse in 30 of the 35 below 10B, with a mean gain of -2.1 points, then +4.2 between 10B and 100B and +11.2 above 100B, and the threshold depends on the model family (on GSM8K PaLM 62B already gains +20.3, LaMDA 68B only +2.5); PaLM 540B trails the earlier best on AQuA by 2.1 points, slightly more than the paper’s “within 2%”; and the external calculator lifts GPT-3 175B, Codex and PaLM 540B by only 0.9, 0.6 and 0.3 on average, while lowering all three on ASDiv. Small-scale reproduction: on Qwen2.5-0.5B, 1.5B-Instruct and 7B, with 120 self-made chained arithmetic problems of 2 to 7 steps and three exemplar sets, it compares direct answers, filler dots and chain of thought. Direct answers score 0.8%, 7.2% and 12.8%, chain of thought 52.8%, 68.6% and 93.6%; replacing the steps in the exemplars with dots of the same length does not help (0.8%, 5.3% and 11.9%); of the chains that end wrong, an external calculator rescues 71% (0.5B), 79% (1.5B) and 87% (7B), so most errors are slips in arithmetic, not wrong steps.

Why this paper is worth reading

  • It gave prompts a measurable, multiple-fold gain. Same model, same number of exemplars, only the presence of intermediate steps changes, and PaLM 540B reaches 3.2 times its standard-prompting accuracy on GSM8K (see the recheck below), with no training at all.
  • It is one of the most cited examples of an ability emerging with scale. Figure 4 and Table 2 of the paper show chain of thought below standard prompting for small models and clearly above it for large ones. This post counts Table 2 cell by cell and gets a finer picture than the paper’s prose.
  • It is the prequel to reasoning models. Self-consistency, zero-shot chain of thought, least-to-most prompting and the models that learn long chains of reasoning with reinforcement learning (see reasoning RL and the DeepSeek-R1 walkthrough) all continue along “write the intermediate steps out”.
  • The paper gives enough detail to recheck. A full table of five models by five arithmetic datasets, three ablations, robustness checks over annotators and exemplar sets, and an error analysis make it suited to being read by recomputing and running a small experiment.
  • It sits next to other pages here. Prompt writing is covered in Prompt Engineering; the ReAct walkthrough builds directly on chain of thought; Let’s Verify Step by Step, which scores every step of a chain, and the test-time compute walkthrough, which spends extra inference compute, are its successors.

Background: why direct answers fall short on multi-step reasoning

After 2020 the standard way to use a language model was few-shot prompting: put a few “question → answer” exemplars before the question and let the model copy the format (the GPT-3 recipe, see the GPT series note). It works well on tasks answerable in one step, and larger is better. But the paper’s introduction points out that scaling the model alone has not been enough to reach high performance on challenging tasks such as arithmetic, commonsense and symbolic reasoning (citing the Gopher report, Rae et al. 2021).

The two existing routes each have a weakness, and chain-of-thought prompting tries to keep the strengths of both:

Train or fine-tune to produce reasoningStandard few-shot promptingChain-of-thought prompting
Training neededYes, from scratch or fine-tuningNoNo
What the examples holdMany annotated reasoning tracesQuestions and answersQuestions, reasoning steps and answers, a handful is enough
Weakness the paper namesHigh-quality reasoning traces cost far more than input-output pairsWorks poorly on tasks that need reasoning, and scaling helps littleSmall models write fluent but illogical chains

The left column is represented by Ling et al. 2017 (training from scratch) and Cobbe et al. 2021 (fine-tuning GPT-3 to write solutions and training a verifier to score them; GSM8K comes from that paper); the “scratchpad” of Nye et al. 2021, which trains a model to write intermediate computation, belongs here too. Chain-of-thought prompting changes only the prompt, so one checkpoint serves many tasks.

Method: write the reasoning chain into the exemplars

A chain of thought is “a series of intermediate natural-language steps that lead to the final answer”, and each exemplar in the prompt is a triple of ⟨input, chain of thought, output⟩. Figure 1 of the paper contrasts the two ways of writing the same exemplar; the test question is about a cafeteria that had 23 apples, used 20 and bought 6 more:

Standard prompting
Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls.
   Each can has 3 tennis balls. How many tennis balls does he have now?
A: The answer is 11.
   ... (test question) ...
   Model output: A: The answer is 27.         <- wrong

Chain-of-thought prompting
Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls.
   Each can has 3 tennis balls. How many tennis balls does he have now?
A: Roger started with 5 balls. 2 cans of 3 tennis balls each is 6
   tennis balls. 5 + 6 = 11. The answer is 11.
   ... (test question) ...
   Model output: A: The cafeteria had 23 apples originally. They used 20
   to make lunch. So they had 23 - 20 = 3. They bought 6 more apples, so
   they have 3 + 6 = 9. The answer is 9.    <- correct

The paper lists four properties of this kind of prompt:

  1. In principle it lets the model decompose a multi-step problem into intermediate steps, so problems that need more reasoning steps can receive more computation.
  2. It offers an interpretable window into how the model might have reached an answer, and a chance to debug where a reasoning path went wrong (the paper adds that fully characterizing the model’s computation remains open).
  3. It applies to math word problems, commonsense reasoning and symbolic manipulation, and in principle to any task humans can solve with language.
  4. It can be elicited from a sufficiently large off-the-shelf model simply by putting chain-of-thought examples into the few-shot exemplars.

Setup: all arithmetic datasets share one set of eight handwritten exemplars (Appendix Table 20), except multiple-choice AQuA, which uses four exemplars and solutions from its training set; decoding is greedy; for LaMDA the paper reports the mean over five random seeds (different exemplar orders) and for the other models a single order. The authors stress that these exemplars were not tuned by prompt engineering and test robustness separately.

The paper’s experiments and conclusions

Arithmetic reasoning: five datasets, five models

The table below is the paper’s Table 1 as “standard prompting → chain of thought” (accuracy, %). GPT-3 is text-davinci-002 and Codex is code-davinci-002; the last row is the earlier best result the paper lists (fine-tuned models; the 55 on GSM8K is a fine-tuned GPT-3 with a verifier).

ModelGSM8KSVAMPASDivAQuAMAWPS
UL2 20B4.1 → 4.410.1 → 12.516.0 → 16.920.5 → 23.616.6 → 19.1
LaMDA 137B6.5 → 14.329.5 → 37.540.1 → 46.625.5 → 20.643.2 → 57.9
GPT-3 175B15.6 → 46.965.7 → 68.970.3 → 71.324.8 → 35.872.7 → 87.1
Codex19.7 → 63.169.9 → 76.474.0 → 80.429.5 → 45.378.7 → 92.6
PaLM 540B17.9 → 56.969.4 → 79.072.1 → 73.925.2 → 35.879.2 → 93.3
Earlier best5557.475.337.988.4

The paper draws three takeaways:

  • Chain of thought is an emergent ability of model scale. It does not help small models and yields gains only with models of about 100B parameters. The paper’s qualitative observation is that smaller models write fluent but illogical chains, which leads to lower accuracy than standard prompting.
  • The harder the problem, the larger the gain. GSM8K has the lowest baseline accuracy, and for the largest GPT and PaLM models performance more than doubled; on SingleOp, the easiest MAWPS subset that needs a single step, the improvement was negative or very small.
  • Compared with the earlier best. GPT-3 175B and PaLM 540B with chain of thought compare favorably with earlier state of the art, which typically fine-tunes a task-specific model on a labeled training set: PaLM 540B sets new bests on GSM8K, SVAMP and MAWPS (on SVAMP standard prompting already passed the earlier best) and comes within 2% on AQuA and ASDiv.

The authors also examined LaMDA 137B’s outputs on GSM8K by hand: of 50 random correct answers, all the chains were logically and mathematically correct except two that reached the right answer by coincidence; of 50 random wrong answers, 46% of the chains were almost correct (a calculator error, a symbol-mapping error or one missing step) and the other 54% had major errors of semantic understanding or coherence. A similar analysis of PaLM 62B against 540B showed that scaling to 540B fixes a large portion of the missing-step and semantic-understanding errors.

Ablations and robustness

Chain of thought might work for other reasons, and the paper rules out three of them with variants (Figure 5):

VariantWhat it doesResult
Equation onlyOutput only the equation to evaluate before the answerHelps little on GSM8K, because the questions are too semantically complex to translate into an equation without natural-language steps; helps on one- and two-step problems
Variable compute onlyOutput only as many dots as the characters in the needed equationAbout the same as the baseline, so extra tokens alone are not the reason
Reasoning after the answerGive the answer first, then the chainAbout the same as the baseline, so it is not just activating knowledge from pre-training; sequential reasoning written before the answer is what helps

For robustness, besides the original annotator A, two co-authors (B and C) independently wrote chains for the same exemplars, annotator A wrote a more concise version, and three further sets of eight exemplars were sampled from the GSM8K training set. On LaMDA 137B the results vary across versions, but all of them beat standard prompting by a wide margin, from which the paper concludes that successful chain of thought does not depend on a particular linguistic style. Appendix A.2 adds that it is also fairly robust to exemplar order and number.

Commonsense and symbolic reasoning

  • Commonsense reasoning (CSQA, StrategyQA, BIG-bench date understanding and sports understanding, SayCan): PaLM 540B with chain of thought reaches 75.6% on StrategyQA against the earlier best of 69.4%, and 95.4% on sports understanding against 84% for an unaided sports enthusiast; the gain on CSQA is minimal.
  • Symbolic reasoning (last-letter concatenation, coin-flip state tracking): PaLM 540B with chain of thought gets close to 100% in domain. More interesting is length generalization: the exemplars only show two-word names and the test uses names of three or four words (coin flip is set up the same way); standard prompting fails, while chain of thought keeps an upward scaling curve, at lower accuracy than in domain. The paper itself calls these toy tasks, since the exemplars already give the perfect solution structure, yet small models still fail, and this kind of abstract manipulation arises only at about 100B parameters.

Recheck: recomputing the paper’s numbers

The script needs no model: it copies Tables 1, 2 and 3 into code, recomputes the gains, counts the cells where chain of thought is worse, tests “harder problems gain more” and checks a few numbers in the appendix. Six parts, in the order of the output: the gains of Table 1 cell by cell, the external calculator, PaLM 540B against the earlier best, emergence, the correlation of difficulty and gain, and a few small slips in the appendix. Environment: Python 3.14.3, NumPy 2.4.2.

Full code (about 142 lines)
"""Recheck the chain-of-thought paper: recompute the gains in its tables and
count the cells where chain of thought does worse"""
import numpy as np

BENCH = ("GSM8K", "SVAMP", "ASDiv", "AQuA", "MAWPS")
PRIOR = (55.0, 57.4, 75.3, 37.9, 88.4)  # fine-tuned prior best
# Table 1: model -> (standard, CoT, printed gain, CoT + ext. calculator)
T1 = {
    "UL2 20B": (
        (4.1, 10.1, 16.0, 20.5, 16.6), (4.4, 12.5, 16.9, 23.6, 19.1),
        (0.3, 2.4, 0.9, 3.1, 2.5), (6.9, 28.3, 34.3, 23.6, 42.7)),
    "LaMDA 137B": (
        (6.5, 29.5, 40.1, 25.5, 43.2), (14.3, 37.5, 46.6, 20.6, 57.9),
        (7.8, 8.0, 6.5, -4.9, 14.7), (17.8, 42.1, 53.4, 20.6, 69.3)),
    "GPT-3 175B": (
        (15.6, 65.7, 70.3, 24.8, 72.7), (46.9, 68.9, 71.3, 35.8, 87.1),
        (31.3, 3.2, 1.0, 11.0, 14.4), (49.6, 70.3, 71.1, 35.8, 87.5)),
    "Codex": (
        (19.7, 69.9, 74.0, 29.5, 78.7), (63.1, 76.4, 80.4, 45.3, 92.6),
        (43.4, 6.5, 6.4, 15.8, 13.9), (65.4, 77.0, 80.0, 45.3, 93.3)),
    "PaLM 540B": (
        (17.9, 69.4, 72.1, 25.2, 79.2), (56.9, 79.0, 73.9, 35.8, 93.3),
        (39.0, 9.6, 1.8, 10.6, 14.2), (58.6, 79.8, 72.6, 35.8, 93.5)),
}
# Table 2: (model, size in B) -> (standard, CoT) on the five datasets
T2 = {
    ("UL2", 20): ((4.1, 10.1, 16.0, 20.5, 16.6), (4.4, 12.5, 16.9, 23.6, 19.1)),
    ("LaMDA", 0.42): ((2.6, 2.5, 3.2, 23.5, 3.2), (0.4, 1.6, 0.8, 8.3, 0.9)),
    ("LaMDA", 2): ((3.6, 3.3, 4.1, 22.9, 3.9), (1.9, 2.4, 3.8, 17.7, 3.1)),
    ("LaMDA", 8): ((3.2, 4.3, 5.9, 22.8, 5.3), (1.6, 3.4, 5.0, 18.6, 4.8)),
    ("LaMDA", 68): ((5.7, 13.6, 21.8, 22.3, 21.6),
                    (8.2, 18.8, 23.1, 20.2, 30.6)),
    ("LaMDA", 137): ((6.5, 29.5, 40.1, 25.5, 43.2),
                     (14.3, 37.5, 46.6, 20.6, 57.9)),
    ("GPT", 0.35): ((2.2, 1.4, 2.1, 18.1, 2.4), (0.5, 0.8, 0.8, 8.7, 1.1)),
    ("GPT", 1.3): ((2.4, 1.5, 2.6, 12.6, 3.1), (0.5, 1.7, 1.4, 4.3, 1.7)),
    ("GPT", 6.7): ((4.0, 6.1, 8.6, 15.4, 8.8), (2.4, 3.1, 3.6, 13.4, 3.5)),
    ("GPT", 175): ((15.6, 65.7, 70.3, 24.8, 72.7),
                   (46.9, 68.9, 71.3, 35.8, 87.1)),
    ("PaLM", 8): ((4.9, 15.1, 23.7, 19.3, 26.2), (4.1, 16.8, 25.2, 21.7, 30.5)),
    ("PaLM", 62): ((9.6, 48.2, 58.7, 25.6, 61.8),
                   (29.9, 46.7, 61.9, 22.4, 80.3)),
    ("PaLM", 540): ((17.9, 69.4, 72.1, 25.2, 79.2),
                    (56.9, 79.0, 73.9, 35.8, 93.3)),
}
# Table 3: big models on the MAWPS subsets (standard, CoT)
T3 = {
    "LaMDA 137B": ((73.2, 48.8, 43.0, 7.6), (76.2, 58.7, 51.9, 44.9)),
    "GPT-3 175B": ((90.9, 82.7, 83.3, 33.8), (88.8, 86.6, 81.3, 91.7)),
    "Codex": ((93.1, 86.8, 90.9, 44.0), (91.8, 93.1, 89.1, 96.2)),
    "PaLM 540B": ((94.1, 86.5, 93.9, 42.2), (94.1, 92.3, 91.9, 94.7)),
}


def pad(s, width):
    """Pad to a display width (a CJK character takes two cells)"""
    return s + " " * (width - sum(2 if ord(c) > 0x2e80 else 1 for c in s))


print("1. Table 1: recompute every gain (25 cells)")
bad = [f"{m} {b} {cot - std:.1f}/{g:.1f}"
       for m, (S, C, G, _) in T1.items()
       for b, std, cot, g in zip(BENCH, S, C, G)
       if abs(cot - std - g) > 0.051]
print("   cells that differ from the printed gain (recomputed/printed): "
      + ", ".join(bad))
same = [(("LaMDA", 137), "LaMDA 137B"), (("GPT", 175), "GPT-3 175B"),
        (("PaLM", 540), "PaLM 540B"), (("UL2", 20), "UL2 20B")]
gap = sum(abs(T2[k][i][j] - T1[m][i][j]) > 1e-9
          for k, m in same for i in (0, 1) for j in range(5))
print(f"   cells where Tables 1 and 2 disagree for the same model: {gap}")

print("\n2. External calculator: cells where adding it lowers the score")
for m, (S, C, G, X) in T1.items():
    drops = [f"{b} {x - c:+.1f}" for b, c, x in zip(BENCH, C, X) if x < c]
    mean = np.mean([x - c for c, x in zip(C, X)])
    print(f"   {m:<11}", f"mean {mean:+.1f}; lower on: "
          + (", ".join(drops) or "none"))

print("\n3. PaLM 540B against the fine-tuned prior best (points)")
S, C, G, X = T1["PaLM 540B"]
diff = [f"{b} {c - p:+.1f}" for b, c, p in zip(BENCH, C, PRIOR)]
print("   " + "  ".join(diff))
print(f"   with the external calculator: GSM8K {X[0] - PRIOR[0]:+.1f}")
times = [f"{m} {C[0] / S[0]:.1f}x"
         for m, (S, C, _, _) in T1.items() if m != "UL2 20B"]
print("   GSM8K, chain of thought as a multiple of standard: "
      + ", ".join(times))

print("\n4. Emergence: cells of Table 2 where chain of thought is worse "
      "(each model x 5 datasets)")
print("   " + pad("size", 14) + pad("cells", 8)
      + pad("worse", 8) + "mean gain")
for name, lo, hi in (("< 10B", 0, 10), ("10B - 100B", 10, 100),
                     (">= 100B", 100, 1e9)):
    gains = [c - s for (_, size), (S, C) in T2.items() if lo <= size < hi
             for s, c in zip(S, C)]
    print("   " + pad(name, 14) + pad(str(len(gains)), 8)
          + pad(str(sum(g < 0 for g in gains)), 8) + f"{np.mean(gains):+.1f}")
late = [f"{fam} {size:g}B {b}" for (fam, size), (S, C) in T2.items()
        if size >= 10 for b, s, c in zip(BENCH, S, C) if c < s]
print("   cells at 10B or more that are still worse: " + ", ".join(late))
gsm = [f"{fam} {size:g}B {C[0] - S[0]:+.1f}"
       for (fam, size), (S, C) in T2.items() if size >= 6]
print("   GSM8K gain (chain of thought minus standard): " + ", ".join(gsm))

print("\n5. Do harder problems gain more (4 models of 100B+ x 8 datasets)")


def ranks(v):
    order = np.argsort(v, kind="stable")
    r = np.empty(len(v))
    r[order] = np.arange(len(v), dtype=float)
    for x in set(v):  # ties get the average rank
        idx = [i for i, y in enumerate(v) if y == x]
        r[idx] = np.mean(r[idx])
    return r


std, gain = [], []
for m in T3:
    S, C = T1[m][0][:4], T1[m][1][:4]
    std += list(S) + list(T3[m][0])
    gain += [c - s for s, c in zip(S, C)]
    gain += [c - s for s, c in zip(*T3[m])]
room = [g / (100 - s) for g, s in zip(gain, std)]  # share of errors fixed
rho = np.corrcoef(ranks(std), ranks(gain))[0, 1]
rho_room = np.corrcoef(ranks(std), ranks(room))[0, 1]
print(f"   Spearman correlation of standard accuracy and gain: {rho:+.2f} "
      f"({len(std)} cells)")
print(f"   with the share of remaining errors fixed: {rho_room:+.2f}")

print("\n6. A few small things in the appendix")
pct = 8 + 16 + 22
print(f"   Appendix D.2: 8% + 16% + 22% = {pct}%, the text's 46%; "
      f"the other 27/50 = {27 / 50:.0%}")
calc = T1["LaMDA 137B"][3][0]
print(f"   Appendix D.2 says the calculator lifts 14.3% to 17.3%; Table 1 has "
      f"{calc}")
low = PRIOR[3] - T1["PaLM 540B"][1][3]
print(f"   PaLM 540B is {low:.1f} points below the prior best on AQuA, "
      "where the text says AQuA and ASDiv are 'within 2%'")

Output:

1. Table 1: recompute every gain (25 cells)
   cells that differ from the printed gain (recomputed/printed): PaLM 540B MAWPS 14.1/14.2
   cells where Tables 1 and 2 disagree for the same model: 0

2. External calculator: cells where adding it lowers the score
   UL2 20B     mean +11.9; lower on: none
   LaMDA 137B  mean +5.3; lower on: none
   GPT-3 175B  mean +0.9; lower on: ASDiv -0.2
   Codex       mean +0.6; lower on: ASDiv -0.4
   PaLM 540B   mean +0.3; lower on: ASDiv -1.3

3. PaLM 540B against the fine-tuned prior best (points)
   GSM8K +1.9  SVAMP +21.6  ASDiv -1.4  AQuA -2.1  MAWPS +4.9
   with the external calculator: GSM8K +3.6
   GSM8K, chain of thought as a multiple of standard: LaMDA 137B 2.2x, GPT-3 175B 3.0x, Codex 3.2x, PaLM 540B 3.2x

4. Emergence: cells of Table 2 where chain of thought is worse (each model x 5 datasets)
   size          cells   worse   mean gain
   < 10B         35      30      -2.1
   10B - 100B    15      3       +4.2
   >= 100B       15      1       +11.2
   cells at 10B or more that are still worse: LaMDA 68B AQuA, LaMDA 137B AQuA, PaLM 62B SVAMP, PaLM 62B AQuA
   GSM8K gain (chain of thought minus standard): UL2 20B +0.3, LaMDA 8B -1.6, LaMDA 68B +2.5, LaMDA 137B +7.8, GPT 6.7B -1.6, GPT 175B +31.3, PaLM 8B -0.8, PaLM 62B +20.3, PaLM 540B +39.0

5. Do harder problems gain more (4 models of 100B+ x 8 datasets)
   Spearman correlation of standard accuracy and gain: -0.71 (32 cells)
   with the share of remaining errors fixed: -0.44

6. A few small things in the appendix
   Appendix D.2: 8% + 16% + 22% = 46%, the text's 46%; the other 27/50 = 54%
   Appendix D.2 says the calculator lifts 14.3% to 17.3%; Table 1 has 17.8
   PaLM 540B is 2.1 points below the prior best on AQuA, where the text says AQuA and ASDiv are 'within 2%'

Reading the numbers.

  • The gains of Table 1 and the numbers of Table 2 mostly agree. Of 25 gains one differs from the recomputation: PaLM 540B on MAWPS, where 93.3 minus 79.2 is 14.1 and the paper prints 14.2, presumably from rounding of the underlying numbers. The 40 numbers that Tables 1 and 2 both give for the same model and dataset are identical.
  • The external calculator helps on average but not everywhere. The calculator is applied post hoc: Python’s eval recomputes every equation in the chain and passes the result on to later equations by string matching (not applicable to AQuA, where the table shows the same number). It raises UL2 20B by 11.9 points on average and LaMDA 137B by 5.3, but GPT-3 175B, Codex and PaLM 540B only by 0.9, 0.6 and 0.3, and for those three models ASDiv gets worse (-0.2, -0.4 and -1.3). The paper says a calculator “significantly boosts performance on most tasks”, which holds for UL2 20B and LaMDA 137B and barely for the three largest.
  • Against the earlier best, three wins and two losses. PaLM 540B with chain of thought is 1.9 points above on GSM8K, 21.6 on SVAMP and 4.9 on MAWPS, and 1.4 below on ASDiv and 2.1 below on AQuA. The paper says “within 2%” for AQuA and ASDiv, and AQuA’s 2.1 slightly exceeds that. With the external calculator GSM8K is 3.6 points above. On GSM8K chain of thought is a multiple of standard prompting: 2.2 times for LaMDA 137B, 3.0 for GPT-3 175B and 3.2 for both Codex and PaLM 540B.
  • “Only at about 100B” needs a discount. Table 2 has 65 cells (13 models times five datasets): of the 35 cells below 10B, chain of thought is worse in 30, with a mean gain of -2.1 points; of the 15 cells from 10B to 100B it is worse in 3, mean +4.2; of the 15 cells at 100B and above it is worse in only 1, mean +11.2. On GSM8K alone PaLM 62B already gains 20.3, LaMDA 68B only 2.5 and UL2 20B almost nothing (+0.3). So the threshold of emergence is not one parameter count; it varies by family: PaLM benefits already at 62B, LaMDA clearly only at 137B. The four cells above 10B that are still worse are LaMDA 68B and 137B on AQuA and PaLM 62B on SVAMP and AQuA; three of them are AQuA, the only multiple-choice dataset with four exemplars.
  • “Harder problems gain more” is broadly true, with a ceiling effect. Over the four models of 100B and above times eight datasets (32 cells) the Spearman correlation between standard-prompting accuracy and gain is -0.71. But a gain is capped at 100 minus the baseline, so low baselines simply have more room; using the share of remaining errors fixed instead, the correlation shrinks to -0.44, still negative but much less strong.
  • A few slips in the error analysis. Appendix D.2 splits the 46% into 8%, 16% and 22%, which adds up to the main text, and the remaining 27 of 50, or 54%, are major errors. But the appendix says the external calculator lifted LaMDA 137B on GSM8K “from 14.3% to 17.3%”, while Table 1 has 17.8.
GSM8K column of the paper's Table 2: chain of thought and standard prompting against model size Parameter count on a log axis against GSM8K solve rate. Standard-prompting curves for LaMDA, GPT-3 and PaLM are nearly flat; chain-of-thought curves sit below standard prompting for small models and rise clearly above it only at PaLM 62B and GPT-3 175B, reaching 56.9% for PaLM 540B, above the earlier fine-tuned best of 55%. 0% 10% 20% 30% 40% 50% 60% 1B 10B 100B Parameters (log scale) GSM8K solve rate Earlier best: fine-tuned GPT-3 with a verifier, 55% LaMDA 14.3 6.5 GPT-3 46.9 15.6 PaLM 56.9 17.9 solid: chain of thought dashed: standard each point is a cell of Table 2 UL2 20B and Codex not drawn small models: solid (CoT) below dashed (standard)
Figure 2: The GSM8K column of Table 2 (numbers in the recheck output below). Chain of thought is below standard prompting for every model up to 8B and above it from 62B and 68B; somewhere between PaLM 8B and 62B is the turning point on GSM8K.

Hands-on: three prompt styles on three Qwen2.5 models

The paper’s models (8B to 540B) and its eight handwritten GSM8K exemplars cannot be reproduced on this machine, so this is a small-scale reproduction: the same problems and the same exemplars, with only the middle part of the exemplars and answers changed, put to three Qwen2.5 models. The focus is three things: how much chain of thought helps over answering directly, whether the help comes from writing more tokens or from writing steps, and how it changes with the number of steps in the problem. The differences from the paper are large and listed below.

PaperHere
ModelsLaMDA, GPT-3, PaLM, UL2, Codex, 0.35B to 540BQwen2.5-0.5B and 7B (base) and Qwen2.5-1.5B-Instruct (instruction-tuned), float32, greedy decoding; the 1.5B model is instruction-tuned, so size and instruction tuning cannot be separated
TaskFive math word-problem datasets such as GSM8KSelf-made chained arithmetic, “Start with 29. Then subtract 69. Then add 61. What is the result?”, 2 to 7 steps, 20 problems per level, 120 in all; operations are add, subtract and multiply
ExemplarsEight handwritten exemplarsThree exemplars per set (2, 3 and 4 steps), three sets (three seeds) to see sensitivity to the exemplars
PromptsStandard, chain of thought and three ablationsDirect answer D, filler dots F, chain of thought C; “equation only” and “reasoning after the answer” are not run
Filler dotsAs many dots as characters in the needed equationAs many dots as tokens in the reference solution (the solution is itself a string of equations)
External calculatorPython eval on every equation in the chain, results passed on by string matchingThe same procedure, recomputed in the script with a regular expression

Environment: Apple M2 Max (64 GB, MPS backend), Python 3.14.3, PyTorch 2.10.0, Transformers 5.3.0, float32, eager attention, greedy decoding; all three models are Apache-2.0 licensed. Qwen2.5-1.5B-Instruct ships a generation config with sampling and a repetition penalty, which the script switches off; the 7B model runs in float32 on MPS because bfloat16 copies multi-digit numbers wrongly.

Three ways to write the same exemplar: direct answer, filler dots, chain of thought Three columns: direct answer, filler dots and chain of thought. Each exemplar has a question, an optional middle part and an answer: none for direct answer, as many dots as the reference solution has tokens for filler dots, step-by-step equations for chain of thought. The question to answer stops before the middle part (before the answer for direct and dots) and the model continues from there. Direct answer (D) exemplar: question → answer In each exemplar Question: Start with 29. Then subtract 69. Then add 61. What is the result? Answer: 21 The question to answer Question: Start with 29. Then subtract 69. Then add 61. What is the result? Answer: the model writes only the answer three exemplars with 2, 3 and 4 steps Filler dots (F) exemplar: question → dots → answer In each exemplar Question: Start with 29. Then subtract 69. Then add 61. What is the result? Solution: . . . . . . . . . . . Answer: 21 The question to answer Question: Start with 29. Then subtract 69. Then add 61. What is the result? Solution: . . . . . . . . . . . Answer: dots = tokens of the reference solution three exemplars with 2, 3 and 4 steps Chain of thought (C) exemplar: question → steps → answer In each exemplar Question: Start with 29. Then subtract 69. Then add 61. What is the result? Solution: 29 - 69 = -40. -40 + 61 = 21. Answer: 21 The question to answer Question: Start with 29. Then subtract 69. Then add 61. What is the result? Solution: the model writes the steps, then the answer three exemplars with 2, 3 and 4 steps
Figure 1: The three prompts used in this post's experiment. The three exemplars are the same questions; only what goes in the middle part changes. The paper's "equation only" and "reasoning after the answer" variants are not run here.

A few points about how it was done:

  • Problems and exemplars are separate. The 120 problems come from a fixed seed, the three exemplar sets from three other seeds (900, 910, 920), and an assertion in the script guarantees that no test problem is an exemplar; each set has one 2-, 3- and 4-step problem.
  • Grading. Direct answers and filler dots take the first integer in the output; chain of thought takes the integer after “Answer:”; an answer counts only if it equals the reference exactly. Chain of thought stops as soon as the answer line is written, and the generation cap of 200 tokens is above the longest reference solution (147 tokens).
  • The external calculator follows the paper: a regular expression finds every equation in the chain and recomputes it; if the next equation starts with the result the model “said” for the previous step, that is replaced by the recomputed value; the recomputed result of the last equation is taken as the answer. It fixes arithmetic only, not a wrongly copied operand.
  • Pre-check. The 8 prompts of the first model were recomputed on the CPU; the largest gap between the MPS and CPU next-token probabilities is 2.5e-05.
  • Randomness. Greedy decoding throughout, nothing is sampled; the ranges in the table come only from the three exemplar sets and do not include a change of problems.
Full code (about 266 lines)
"""Chain-of-thought prompting, scaled down: the same multi-step arithmetic
questions asked three ways (direct answer, filler dots, chain of thought) of
three Qwen2.5 models, to see when writing out the steps helps"""
import random
import re
import sys

import numpy as np
import torch
from transformers import (AutoModelForCausalLM, AutoTokenizer,
                          StoppingCriteria, StoppingCriteriaList)
from transformers.utils import logging as hf_logging

hf_logging.set_verbosity_error()
hf_logging.disable_progress_bar()
DEV = sys.argv[1] if len(sys.argv) > 1 else "mps"
PER = int(sys.argv[2]) if len(sys.argv) > 2 else 20  # problems per level
USE = int(sys.argv[3]) if len(sys.argv) > 3 else 3  # models to run
NSET = int(sys.argv[4]) if len(sys.argv) > 4 else 3  # exemplar sets
MODELS = (("Qwen/Qwen2.5-0.5B", "0.5B base"),
          ("Qwen/Qwen2.5-1.5B-Instruct", "1.5B instruct"),
          ("Qwen/Qwen2.5-7B", "7B base"))
LEVELS = (2, 3, 4, 5, 6, 7)  # operations per problem
SEEDS = (900, 910, 920)[:NSET]  # one seed per exemplar set
CONDS = ("D", "F", "C")  # direct, filler dots, chain of thought
MAXNEW, BS = 200, 8
OPS = (("+", "add"), ("-", "subtract"),
       ("×", "multiply by"))
Q = "Question: {q}\n"
SOL = "Solution: "
ANS = "Answer: "
ANSWER = re.compile(r"Answer:\s*(-?\d+)")
DONE = re.compile(r"Answer:\s*-?\d+\n")
EQ = re.compile(r"(-?\d+) ([-+×]) (\d+) = (-?\d+)")


def make(seed, nops, per):
    """per chains of nops operations: (question, answer, steps)"""
    rng = random.Random(seed)
    out = []
    for _ in range(per):
        val = rng.randint(11, 99)
        text, steps = f"Start with {val}.", []
        for _ in range(nops):
            sym, word = rng.choice(OPS)
            t = rng.randint(11, 29) if sym == "×" else rng.randint(11, 99)
            new = {"+": val + t, "-": val - t, "×": val * t}[sym]
            steps.append(f"{val} {sym} {t} = {new}")
            text += f" Then {word} {t}."
            val = new
        text += " What is the result?"
        out.append((text, val, ". ".join(steps) + "."))
    return out


probs = [(n, p) for i, n in enumerate(LEVELS)
         for p in make(100 + i, n, PER)]
shots = {s: [make(s + i, n, 1)[0] for i, n in enumerate((2, 3, 4))]
         for s in SEEDS}
assert not {p[0] for _, p in probs} & {q for v in shots.values()
                                       for q, _, _ in v}
tok = AutoTokenizer.from_pretrained(MODELS[0][0])  # one tokenizer for all three
tok.padding_side = "left"


def ntok(text):
    return len(tok(text).input_ids)


def dots(n):
    return " ".join("." * n)


def block(cond, q, s=None, a=None):
    """One question; the one to answer when a is None"""
    text = Q.format(q=q)
    if cond == "F":
        text += SOL + dots(ntok(s)) + "\n"
    elif cond == "C":
        text += SOL + (s + "\n" if a is not None else "")
    if cond != "C" or a is not None:
        text += ANS + (f"{a}\n\n" if a is not None else "")
    return text


def prompts(cond, seed):
    head = "".join(block(cond, q, s, a) for q, a, s in shots[seed])
    return [head + block(cond, q, s) for _, (q, _, s) in probs]


P = {(c, s): prompts(c, s) for c in CONDS for s in SEEDS}
PLEN = {c: np.mean([ntok(t) for s in SEEDS for t in P[c, s]])
        for c in CONDS}
# no reference solution may be longer than the generation cap
longest = max(ntok(s + "\n") for _, (_, _, s) in probs)
assert longest < MAXNEW, longest


class Stop(StoppingCriteria):
    """Stop a sequence once it has written its answer (or one line)"""

    def __init__(self, n_prompt, pattern):
        self.n, self.pattern = n_prompt, pattern

    def __call__(self, ids, scores, **kw):
        txt = tok.batch_decode(ids[:, self.n:])
        return torch.tensor([bool(self.pattern.search(t)) for t in txt],
                            device=ids.device)


@torch.no_grad()
def generate(model, texts, cond):
    enc = tok(texts, return_tensors="pt", padding=True).to(DEV)
    pattern = DONE if cond == "C" else re.compile(r"\n")
    out = model.generate(
        **enc, max_new_tokens=MAXNEW if cond == "C" else 14, do_sample=False,
        pad_token_id=tok.pad_token_id,
        stopping_criteria=StoppingCriteriaList(
            [Stop(enc.input_ids.shape[1], pattern)]))
    res = []
    for o in out[:, enc.input_ids.shape[1]:].tolist():
        res.append((tok.decode(o, skip_special_tokens=True),
                    sum(t != tok.pad_token_id for t in o)))
    if DEV == "mps":
        torch.mps.empty_cache()
    return res


def parse(text, cond):
    m = ANSWER.search(text) if cond == "C" else re.match(r"\s*(-?\d+)", text)
    return int(m[1]) if m else None


def with_calculator(text):
    """The paper's external calculator: recompute every equation in the
    chain and pass each result on to the next one"""
    said = true = None
    for x, sym, y, z in EQ.findall(text):
        x, y = int(x), int(y)
        if said is not None and x == said:
            x = true
        true = {"+": x + y, "-": x - y, "×": x * y}[sym]
        said = int(z)
    return true


RES = {}  # RES[model][cond][set] = [(pred, new tokens, text)]
PARAMS = {}
for path, name in MODELS[:USE]:
    model = AutoModelForCausalLM.from_pretrained(
        path, dtype=torch.float32, attn_implementation="eager")
    g = model.generation_config  # the instruct model ships sampling: off
    g.temperature = g.top_p = g.top_k = g.repetition_penalty = None
    g.do_sample = False
    model = model.to(DEV).eval()
    PARAMS[name] = sum(p.numel() for p in model.parameters())
    RES[name] = {c: {} for c in CONDS}
    for cond in CONDS:
        for seed in SEEDS:
            texts, out = P[cond, seed], []
            for b in range(0, len(texts), BS):
                got = generate(model, texts[b:b + BS], cond)
                out += [(parse(t, cond), n, t) for t, n in got]
            RES[name][cond][seed] = out
    if len(RES) == 1:  # first model: redo 8 prompts on CPU
        cpu = AutoModelForCausalLM.from_pretrained(
            path, dtype=torch.float32).eval()
        worst = 0.0
        for t in P["D", SEEDS[0]][:8]:
            enc = tok(t, return_tensors="pt")
            with torch.no_grad():
                a = cpu(**enc).logits[0, -1].softmax(-1)
                b = model(**enc.to(DEV)).logits[0, -1].softmax(-1).cpu()
            worst = max(worst, (a - b).abs().max().item())
        del cpu
    del model
    if DEV == "mps":
        torch.mps.empty_cache()

truth = [a for _, (_, a, _) in probs]
level = np.array([n for n, _ in probs])
names = [n for _, n in MODELS[:USE]]


def correct(name, cond, seed, calc=False):
    out = RES[name][cond][seed]
    if calc:
        return np.array([with_calculator(t) == a
                         for (_, _, t), a in zip(out, truth)])
    return np.array([p == a for (p, _, _), a in zip(out, truth)])


def pad(s, width):
    """Pad to a display width (a CJK character takes two cells)"""
    return s + " " * (width - sum(2 if ord(c) > 0x2e80 else 1 for c in s))


def span(vals):
    return f"{np.mean(vals):5.1f} [{min(vals):4.1f}-{max(vals):4.1f}]"


print(f"{len(probs)} problems ({len(LEVELS)} levels, {PER} each), {NSET} "
      f"exemplar sets of 3, three prompt styles; device {DEV}")
print("audit: largest next-token probability gap, "
      f"{DEV} vs CPU, {worst:.1e} (first model, 8 prompts)")
print(f"mean prompt tokens: direct {PLEN['D']:.0f}, dots {PLEN['F']:.0f}, "
      f"chain of thought {PLEN['C']:.0f}; longest reference solution "
      f"{longest} tokens")

print("\n1. Accuracy by prompt style (%, mean over exemplar sets [min-max])")
heads = ("direct", "dots", "chain of thought", "CoT + calculator")
print("   " + pad("model", 16) + "".join(pad(h, 19) for h in heads))
for n in names:
    cells = [span([100 * correct(n, c, s).mean() for s in SEEDS])
             for c in CONDS]
    cells.append(span([100 * correct(n, "C", s, True).mean()
                       for s in SEEDS]))
    print("   " + pad(n, 16) + "".join(pad(c, 19) for c in cells))

print("\n2. By number of operations: direct D and chain of "
      "thought C (%, mean of sets)")
print("   " + pad("operations", 20)
      + "".join(f"{k:>5}" for k in LEVELS))
for n in names:
    for c in ("D", "C"):
        v = [np.mean([100 * correct(n, c, s)[level == k].mean()
                      for s in SEEDS]) for k in LEVELS]
        label = f"{n} {c}"
        print("   " + pad(label, 20) + "".join(f"{x:>5.0f}" for x in v))

print("\n3. How many tokens the chain of thought writes, and what "
      "inference costs (FLOPs = 2 x params x tokens)")
print("   " + pad("model", 16) + pad("CoT new tokens", 20)
      + pad("direct FLOPs", 16) + "CoT FLOPs")
for n in names:
    gen = np.mean([t for s in SEEDS for _, t, _ in RES[n]["C"][s]])
    gen_d = np.mean([t for s in SEEDS for _, t, _ in RES[n]["D"][s]])
    fd = 2 * PARAMS[n] * (PLEN["D"] + gen_d)
    fc = 2 * PARAMS[n] * (PLEN["C"] + gen)
    print("   " + pad(n, 16) + pad(f"{gen:.0f}", 20)
          + pad(f"{fd / 1e12:.2f}e12", 16) + f"{fc / 1e12:.2f}e12")

print("\n4. Where a wrong chain of thought goes wrong (sets pooled)")
print("   " + pad("model", 16) + pad("wrong", 8)
      + pad("calculator fixes", 18) + "no answer line")
for n in names:
    wrong = fixed = missing = 0
    for s in SEEDS:
        ok, ok_calc = correct(n, "C", s), correct(n, "C", s, True)
        for i, (p, _, _) in enumerate(RES[n]["C"][s]):
            if not ok[i]:
                wrong += 1
                fixed += bool(ok_calc[i])
                missing += p is None
    print("   " + pad(n, 16) + pad(str(wrong), 8)
          + pad(f"{fixed} ({fixed / max(wrong, 1):.0%})", 18) + str(missing))

n0 = names[0]
print(f"\n5. {n0}: the chain written for the first 5-step problem it got wrong "
      "(first exemplar set)")
for (p, _, t), (k, (q, a, s)) in zip(RES[n0]["C"][SEEDS[0]], probs):
    if k == 5 and p != a:
        print("   question: " + q)
        print("   reference: " + s + f" -> {a}")
        print("   model: " + t.strip().replace("\n", " / "))
        break

Output (python exp_cot_arith.py mps, one complete run, about 50 minutes):

120 problems (6 levels, 20 each), 3 exemplar sets of 3, three prompt styles; device mps
audit: largest next-token probability gap, mps vs CPU, 2.5e-05 (first model, 8 prompts)
mean prompt tokens: direct 166, dots 364, chain of thought 300; longest reference solution 147 tokens

1. Accuracy by prompt style (%, mean over exemplar sets [min-max])
   model           direct             dots               chain of thought   CoT + calculator   
   0.5B base         0.8 [ 0.8- 0.8]    0.8 [ 0.8- 0.8]   52.8 [51.7-55.0]   86.4 [82.5-89.2]  
   1.5B instruct     7.2 [ 6.7- 7.5]    5.3 [ 4.2- 5.8]   68.6 [65.8-70.8]   93.3 [93.3-93.3]  
   7B base          12.8 [11.7-14.2]   11.9 [10.8-12.5]   93.6 [93.3-94.2]   99.2 [98.3-100.0] 

2. By number of operations: direct D and chain of thought C (%, mean of sets)
   operations              2    3    4    5    6    7
   0.5B base D             5    0    0    0    0    0
   0.5B base C            90   77   48   42   38   22
   1.5B instruct D        28   12    3    0    0    0
   1.5B instruct C       100   95   60   48   65   43
   7B base D              40   22   13    2    0    0
   7B base C             100  100   95   80  100   87

3. How many tokens the chain of thought writes, and what inference costs (FLOPs = 2 x params x tokens)
   model           CoT new tokens      direct FLOPs    CoT FLOPs
   0.5B base       72                  0.17e12         0.37e12
   1.5B instruct   74                  0.53e12         1.16e12
   7B base         73                  2.58e12         5.69e12

4. Where a wrong chain of thought goes wrong (sets pooled)
   model           wrong   calculator fixes  no answer line
   0.5B base       170     121 (71%)         0
   1.5B instruct   113     89 (79%)          3
   7B base         23      20 (87%)          0

5. 0.5B base: the chain written for the first 5-step problem it got wrong (first exemplar set)
   question: Start with 69. Then multiply by 17. Then multiply by 13. Then multiply by 14. Then multiply by 23. Then subtract 54. What is the result?
   reference: 69 × 17 = 1173. 1173 × 13 = 15249. 15249 × 14 = 213486. 213486 × 23 = 4910178. 4910178 - 54 = 4910124. -> 4910124
   model: 69 × 17 = 1173. 1173 × 13 = 15349. 15349 × 14 = 214846. 214846 × 23 = 5100018. 5100018 - 54 = 5099474. / Answer: 5099474
Results of the small-scale experiment: accuracy of three prompts, and chain of thought vs direct answer by number of operations Left: accuracy of three Qwen2.5 models with direct answer, filler dots, chain of thought and chain of thought plus an external calculator (mean of three exemplar sets, whiskers show min to max). Right: accuracy of chain of thought (solid) and direct answer (dashed) against the number of operations, 2 to 7. Accuracy by prompt style (%) By number of operations: CoT and direct (%) direct dots CoT CoT + calculator 0 20 40 60 80 100 accuracy (%) 0.5B base 1 1 53 86 1.5B instruct 7 5 69 93 7B base 13 12 94 99 0 50 100 0.5B 0 50 100 1.5B 0 50 100 2 3 4 5 6 7 number of operations 7B accuracy (%) CoT direct
Figure 3: Results of the small-scale experiment (numbers in the output above). Left: mean over three exemplar sets, whiskers min to max; right: one row per model, 20 problems per level, mean over three sets, blue dashed is direct answer and green solid is chain of thought.

Reading the numbers.

  • Chain of thought is the main gain, and it holds on the smallest model too. Direct answers score 0.8% (0.5B base), 7.2% (1.5B instruct) and 12.8% (7B base); chain of thought scores 52.8%, 68.6% and 93.6%, and the minimum to maximum over the three exemplar sets (51.7 to 55.0, 65.8 to 70.8 and 93.3 to 94.2) is far smaller than the gaps. The paper’s “chain of thought hurts small models” does not show up here, but that does not refute the paper: this task is templated chained arithmetic where exemplars and test problems are written identically and the model only has to follow the format step by step; the paper’s GSM8K is natural-language word problems that must be understood before they become equations, and that is where small models write chains that are fluent but illogical.
  • Writing more tokens does not help by itself. The filler-dot prompts are longer (364 tokens on average against 300 for chain of thought) yet accuracy is 0.8%, 5.3% and 11.9%, against 0.8%, 7.2% and 12.8% for answering directly: the 0.5B model ties, the 1.5B model is lower with non-overlapping ranges (4.2 to 5.8 against 6.7 to 7.5), and the 7B model is lower but inside the overlap of its ranges (10.8 to 12.5 against 11.7 to 14.2); one problem is 0.83 points. This agrees with the paper’s variable-computation ablation: the help comes from the content the dots replace, the step-by-step intermediate results.
  • Longer problems wreck direct answers; chain of thought declines too, but much more slowly. At 2 steps direct answers still score 5%, 28% and 40%; by 4 steps they are 0%, 3% and 13%, and from 6 steps on 0% everywhere. Chain of thought falls on the 0.5B model from 90% at 2 steps to 22% at 7 steps, on the 1.5B model from 100% to 43%, and the 7B model still reaches 87% at 7 steps. With only 20 distinct problems per level (each answered under three exemplar sets), ripples such as the 7B model’s 80% at 5 steps and 100% at 6 steps are noise and should not be interpreted.
  • Most errors are arithmetic slips, not wrong steps. Of the chains that end wrong, the external calculator rescues 121 of 170 (71%, 0.5B), 89 of 113 (79%, 1.5B) and 20 of 23 (87%, 7B), so “chain of thought + calculator” reaches 86.4%, 93.3% and 99.2%. This matches the trend of the paper’s Table 1: a calculator helps small models a lot and large ones little (+0.3 for PaLM 540B in the paper). Part 5 is an example: the 0.5B model writes 15349 for 1173 × 13 (the right value is 15249), and every later step continues from the wrong intermediate result, with the arithmetic itself going wrong as well.
  • Inference compute roughly doubles. Chain of thought writes about 73 tokens (72, 74 and 73) where a direct answer is one number; at 2 × parameters × tokens the FLOPs rise from 0.17e12 to 0.37e12 (0.5B), 0.53e12 to 1.16e12 (1.5B) and 2.58e12 to 5.69e12 (7B). The 0.5B model with chain of thought (52.8%, 0.37e12) is already far more accurate than the 7B model answering directly (12.8%, 2.58e12) with less compute; the estimate counts tokens only, not the quadratic attention term or the memory traffic of decoding.

What this experiment does not show. It is a small-scale reproduction, not a reproduction of the paper:

  • the 1.5B model is instruction-tuned and the other two are base models, so size and instruction tuning are mixed and the three cannot be read as a clean scale curve;
  • there are only 120 distinct problems and three exemplar sets, and the ranges leave out the effect of changing the problems; each level has only 20 distinct problems;
  • the task is templated chained arithmetic, unlike the paper’s natural-language word problems, commonsense and symbolic reasoning;
  • the paper’s “equation only” and “reasoning after the answer” ablations were not run, and the dot prompts differ in length from chain of thought, so it is not a strict equal-compute control;
  • the training data of these models is not documented in detail, so one cannot rule out that they have seen similar step-by-step solution text.

Limitations and what came next

The paper lists four limitations in its discussion, and they still hold:

  • Writing steps like a person is not the same as reasoning. The paper concedes that chain of thought emulates human thought processes but does not answer whether the network is actually reasoning, an open question. Later work gave concrete evidence: Turpin et al. (arXiv 2305.04388) found that the chain-of-thought explanations a model writes can systematically misrepresent the true reason for its prediction, for example when it is swayed by a biasing feature in the prompt yet never mentions the feature in its reasoning; Lanham et al. (arXiv 2307.13702) truncated, corrupted and paraphrased chains to see whether the answer changes, and found that how much a model relies on its chain varies a lot between tasks and that on most of the tasks they studied, larger and more capable models produced less faithful reasoning.
  • Annotation cost. For few-shot prompting a handful of handwritten exemplars costs little; for fine-tuning, annotating reasoning could be prohibitive (the paper suggests synthetic data or zero-shot generalization might help, and zero-shot chain of thought and RL training went exactly in that direction).
  • No guarantee of correct reasoning. A reasoning path can be right or wrong, and a wrong path can lead to a wrong answer or, by luck, a right one (the paper’s own error analysis has 2 coincidences in 50).
  • Only large models benefit, and serving is costly. Emergence appears only at large scale, which makes deployment costly; making smaller models reason is the research direction the paper leaves (later distillation and reasoning models work on it).

Follow-up work falls along three lines:

  • Use the chains better. Self-consistency (Wang et al., arXiv 2203.11171) samples many chains and votes; least-to-most prompting (Zhou et al., arXiv 2205.10625) first breaks the problem into subproblems and solves them in turn, generalizing to problems harder than the exemplars; zero-shot chain of thought (Kojima et al., arXiv 2205.11916) adds only “Let’s think step by step” and needs no exemplars.
  • Stop relying on exemplars and let the model learn to write long chains. Reinforcement learning rewards a correct final answer directly (see reasoning RL, the DeepSeekMath and GRPO walkthrough and the DeepSeek-R1 walkthrough), and the length of the chain becomes compute that can be spent (see the test-time compute walkthrough and the wiki page on test-time compute).
  • Verify the chains. A process reward model scores every step, as in Let’s Verify Step by Step.

What to take from this paper

  • It changes the exemplars, not the model. With the same model, turning “question → answer” into “question → steps → answer” can lift multi-step problems several-fold; what matters is that the steps come before the answer and are natural-language steps tied to the question.
  • Scale is one prerequisite, but the threshold depends on the model. Small models learn the format and write fluent but illogical steps; this post’s recount of the paper’s Table 2 finds chain of thought worse in 30 of 35 cells below 10B, while on GSM8K PaLM 62B already benefits.
  • What it buys costs output length. The gain is paid for with tokens generated at inference time, and the cost follows; later reasoning models and test-time compute put that spending into the training objective.
  • Read the numbers. Summaries such as “only at about 100B” or “within 2%” need a discount once recomputed from the tables, while the core results, a 3.2-fold gain on GSM8K for PaLM 540B and 75.6% on StrategyQA, stand.

Further reading

FAQ

What is chain-of-thought prompting, and how much does it help?
Chain-of-thought prompting rewrites each few-shot exemplar from question → answer into question → intermediate reasoning steps → answer, so that a large enough language model writes out its steps before the conclusion when it meets a new question. No parameter is changed. Wei et al. (arXiv 2201.11903) used eight handwritten exemplars to lift PaLM 540B on GSM8K from 17.9% with standard prompting to 56.9%, above the earlier best of 55% from a fine-tuned GPT-3 with a verifier; on SVAMP it went from 69.4% to 79.0% and on MAWPS from 79.2% to 93.3%.
Does chain of thought help small models too?
The paper says barely: chain of thought is an emergent ability of scale and only pays off from about 100B parameters. Counting Table 2 cell by cell, this site finds that in 30 of the 35 cells below 10B chain of thought is worse than standard prompting, with a mean gain of -2.1 points; between 10B and 100B the mean is +4.2 and above 100B it is +11.2. The threshold also varies by model family: on GSM8K PaLM 62B already gains +20.3 while LaMDA 68B gains only +2.5. On the other hand, on this site's self-made chained arithmetic Qwen2.5-0.5B base goes from 0.8% to 52.8% with chain of thought: the format is fixed and the steps are regular, so a small model can follow the template. That does not contradict the paper; it shows that the gain depends on the task and the model.
How does chain of thought relate to self-consistency and zero-shot chain of thought?
They all push further on getting the model to write its reasoning out. Chain-of-thought prompting needs handwritten exemplars; zero-shot chain of thought (Kojima et al., arXiv 2205.11916) uses no exemplars and just adds "Let's think step by step" after the question; self-consistency (Wang et al., arXiv 2203.11171) samples several chains for the same question and takes a majority vote over the final answers. The chain-of-thought paper itself notes in Section 3.1 that follow-up work shows majority voting over many samples improves the result.
Does chain of thought work only because it spends more compute?
No. The paper's variable-computation ablation has the model write only as many dots as the equation needs before the answer, and accuracy stays near the baseline. This site ran the same control on Qwen2.5, with the steps in the exemplars and answers replaced by dots as long as the reference solution: accuracy for 0.5B, 1.5B and 7B is 0.8%, 5.3% and 11.9%, against 0.8%, 7.2% and 12.8% for answering directly and 52.8%, 68.6% and 93.6% with chain of thought. The extra tokens do not help by themselves; the help comes from what is written in them, step-by-step intermediate results tied to the problem.
Do reasoning models still need handwritten chain-of-thought exemplars?
Usually not. Reasoning models such as DeepSeek-R1 are trained with reinforcement learning to write a long chain of reasoning before the answer, and the DeepSeek-R1 paper observes that few-shot prompting consistently degrades its performance, recommending that users describe the problem directly and state the output format (zero-shot). Handwritten exemplars still make sense for base models and smaller models without reasoning training, but check on your own evaluation set that they actually help.