Large Language Models are Zero-Shot Reasoners

Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, Yusuke Iwasawa

Introduction

Large Language Models (LLMs) like GPT-3 are renowned for their "few-shot" learning capabilities, successfully tackling tasks when provided with a few demonstrations. However, they have historically struggled with "System 2" tasks—problems requiring slow, deliberate, multi-step logic, such as arithmetic word problems or symbolic reasoning.

A previous breakthrough called Chain of Thought (CoT) prompting improved performance by showing the model examples of how to think through a problem step-by-step. Yet, this approach required humans to hand-craft reasoning examples for every new task. The authors of this paper asked a fundamental question: Do we really need to provide these examples, or can the model figure out how to reason on its own if we just prompt it correctly?

By simply appending the phrase "Let’s think step by step" to a prompt, researchers discovered that LLMs can perform complex multi-step reasoning without any task-specific examples. This "Zero-shot Chain of Thought" (Zero-shot-CoT) approach drastically improves performance on logic and math benchmarks, proving that LLMs possess deep, untapped reasoning capabilities.

Comparison of prompting methods, highlighting the Zero-shot-CoT approach.

Methodology: The Zero-shot-CoT Pipeline

The authors propose a deceptively simple method called Zero-shot-CoT. Unlike standard prompting (which asks for an answer immediately) or few-shot CoT (which provides examples), this method uses a two-stage prompting pipeline:

  1. Reasoning Extraction: The model is given the question followed by a "trigger sentence" like "Let’s think step by step." This linguistic nudge encourages the model to generate a reasoning path (the "chain of thought") rather than jumping straight to a conclusion.
  2. Answer Extraction: The model’s own reasoning from the first step is fed back into it, followed by a second trigger like "Therefore, the answer (arabic numerals) is" to extract a clean, final output.
The two-stage Zero-shot-CoT pipeline: Reasoning Extraction followed by Answer Extraction.

Crucially, this approach is task-agnostic. The exact same "Let's think step by step" prompt is used for math, logic, and common sense tasks alike, without any specialized tuning.

Experimental Setup and Key Insights

The researchers evaluated their method across 12 datasets spanning four categories: Arithmetic (e.g., MultiArith, GSM8K), Symbolic Reasoning (e.g., Coin Flip), Logical Reasoning, and Common Sense. They tested these on various models, most notably InstructGPT (text-davinci-002) and the 540B parameter PaLM.

Key Findings

  • LLMs are Decent Zero-Shot Reasoners: The knowledge of how to break down a problem is already latent inside the model; it just needs a specific trigger to activate it.
  • Scaling Matters: Zero-shot reasoning follows a distinct scaling law. On smaller models, "Let's think step by step" actually hurts performance or does nothing. The ability to reason zero-shot only "emerges" once models reach a certain size (typically 100B+ parameters).
  • Prompt Sensitivity: While "Let's think step by step" was the most effective trigger, the authors tested other phrases. "Let's solve this problem by splitting it into steps" worked well, whereas misleading prompts like "Don't think. Just feel" caused performance to crater.

Results

The performance gains achieved by Zero-shot-CoT were massive, especially on challenging math and logic tasks:

  • MultiArith: Accuracy jumped from 17.7% (standard zero-shot) to 78.7% (Zero-shot-CoT).
  • GSM8K: Accuracy rose from 10.4% to 40.7%.
  • Symbolic Reasoning: On the "Coin Flip" task, accuracy went from a baseline of 12.8% to 91.4%.

While Zero-shot-CoT still generally performs slightly worse than Few-shot-CoT (which benefits from hand-crafted examples), it provides a much stronger baseline than previously expected, proving that "zero-shot" is a far more powerful paradigm than previously believed.

Limitations and Future Work

Despite its success, the method has limitations. If time permits the creation of high-quality examples, Few-shot-CoT remains superior. Additionally, the model sometimes generates a perfect reasoning path but makes a "silly" mistake in the final calculation, or simply refuses to reason and rephrases the question instead.

Finally, the "why" remains a mystery. While the paper proves that the method works, it doesn't fully explain the underlying mechanics of why these specific tokens trigger latent reasoning. The authors suggest that exploring other "hidden" triggers in LLMs could uncover even more sophisticated cognitive capabilities that we currently assume require fine-tuning or complex engineering.

Summary updated

BibTeX
@inproceedings{kojima2022large,
  author = {Takeshi Kojima and Shixiang Shane Gu and Machel Reid and Yutaka Matsuo and Yusuke Iwasawa},
  title = {{Large Language Models are Zero-Shot Reasoners}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
}
Figure