English

Show Your Work: Scratchpads for Intermediate Computation with Language Models

Machine Learning 2022-01-02 v1 Neural and Evolutionary Computing

Abstract

Large pre-trained language models perform remarkably well on tasks that can be done "in one pass", such as generating realistic text or synthesizing computer programs. However, they struggle with tasks that require unbounded multi-step computation, such as adding integers or executing programs. Surprisingly, we find that these same models are able to perform complex multi-step computations -- even in the few-shot regime -- when asked to perform the operation "step by step", showing the results of intermediate computations. In particular, we train transformers to perform multi-step computations by asking them to emit intermediate computation steps into a "scratchpad". On a series of increasingly complex tasks ranging from long addition to the execution of arbitrary programs, we show that scratchpads dramatically improve the ability of language models to perform multi-step computations.

Keywords

Cite

@article{arxiv.2112.00114,
  title  = {Show Your Work: Scratchpads for Intermediate Computation with Language Models},
  author = {Maxwell Nye and Anders Johan Andreassen and Guy Gur-Ari and Henryk Michalewski and Jacob Austin and David Bieber and David Dohan and Aitor Lewkowycz and Maarten Bosma and David Luan and Charles Sutton and Augustus Odena},
  journal= {arXiv preprint arXiv:2112.00114},
  year   = {2022}
}
R2 v1 2026-06-24T07:58:40.685Z