100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
AI Fundamentals

Chain-of-Thought Prompting

IntermediateTechnique9K learners

Chain-of-thought prompting is a technique that elicits step-by-step intermediate reasoning from a language model — either by instructing it to 'think step by step' or by providing worked examples that reason before answering — which has…

Definition

Chain-of-thought prompting is a technique that elicits step-by-step intermediate reasoning from a language model — either by instructing it to 'think step by step' or by providing worked examples that reason before answering — which has been shown to substantially improve performance on tasks requiring arithmetic, logic, or multi-step reasoning.

Overview

When a language model is asked to jump directly to a final answer for a complex problem, it effectively must produce the correct answer in a single, unbroken burst of computation constrained by its fixed per-token processing, which is especially error-prone for multi-step arithmetic, logical deduction, or planning problems. Chain-of-thought (CoT) prompting, introduced in a widely cited 2022 Google Research paper by Jason Wei and colleagues, showed that prompting a sufficiently large language model to generate intermediate reasoning steps before its final answer — either via explicit instruction or by including a few worked examples in the prompt that demonstrate step-by-step reasoning — significantly improves accuracy on tasks like grade-school math word problems, commonsense reasoning, and symbolic manipulation, compared to prompting for a direct answer. A simplified and highly influential variant, 'zero-shot chain-of-thought,' introduced shortly after by Takeshi Kojima and colleagues, showed that simply appending a phrase like 'Let's think step by step' to a prompt — with no worked examples at all — was often sufficient to trigger substantial reasoning improvements, making the technique trivially easy to apply. The mechanism is generally understood as giving the model more intermediate computation and 'working memory' in the form of generated tokens: because each generated token can attend to all previous tokens, writing out intermediate steps effectively lets the model use additional forward passes to build toward an answer, rather than compressing an entire multi-step derivation into the computation of a single token. Chain-of-thought prompting was an important precursor to today's dedicated 'reasoning models' (such as OpenAI's o1/o3 series and DeepSeek-R1), which extend the same core idea — reasoning before answering — by training the model via reinforcement learning specifically to produce long, effective internal reasoning traces, rather than relying purely on prompting a general-purpose model. CoT prompting is also foundational to related techniques like self-consistency (sampling multiple chain-of-thought reasoning paths and taking a majority vote on the final answer) and Tree of Thoughts (exploring and backtracking across multiple reasoning branches rather than following a single linear chain).

Key Concepts

  • Elicits explicit step-by-step intermediate reasoning before a final answer
  • Introduced in a 2022 Google Research paper by Jason Wei et al.
  • Zero-shot variant works via a simple instruction like 'Let's think step by step'
  • Substantially improves accuracy on arithmetic, logic, and multi-step reasoning tasks
  • Benefit generally scales with model size — smaller models show less improvement from CoT
  • Provides the model more effective 'working memory' via generated intermediate tokens
  • Precursor to dedicated reasoning models like OpenAI o1/o3 and DeepSeek-R1
  • Foundation for related techniques like self-consistency and Tree of Thoughts

Use Cases

Solving multi-step math word problems more accurately
Improving performance on logical and commonsense reasoning benchmarks
Debugging or explaining a model's reasoning process for transparency
Structuring prompts for tasks requiring multi-step planning or decomposition
Serving as the base technique underlying self-consistency and Tree of Thoughts methods
Improving reliability of LLM outputs in agentic and tool-use reasoning loops

Frequently Asked Questions

From the Blog