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

Chain of Thought

IntermediateTechnique1.8K learners

Chain of thought is a prompting technique that encourages a large language model to generate intermediate reasoning steps before producing a final answer, improving performance on complex reasoning tasks.

Definition

Chain of thought is a prompting technique that encourages a large language model to generate intermediate reasoning steps before producing a final answer, improving performance on complex reasoning tasks.

Overview

Rather than asking a model to jump straight to an answer, chain-of-thought prompting asks it to "think step by step," breaking a problem into smaller intermediate steps the way a person might work through a math problem on paper. This has been shown to meaningfully improve accuracy on arithmetic, logic, and multi-step reasoning tasks compared to asking for a direct answer, because it gives the model more tokens and structure to work through before committing to a conclusion. Chain of thought can be elicited explicitly through prompt engineering — for example, instructing the model to "explain your reasoning" — or it can be built into a model's default behavior, as seen in reasoning-focused models that generate extended internal reasoning traces before responding. It is a form of in-context reasoning that complements, rather than replaces, techniques like few-shot learning, where example reasoning chains are shown to the model in the prompt. The technique is widely used in production systems for tasks like code generation, mathematical problem solving, and complex decision-making pipelines, including AI agents that need to plan multi-step actions. The course AI Agents & Agentic Workflows and the blog post Prompt Engineering: Get Better Results from Any LLM both cover practical techniques for using it effectively.

Key Concepts

  • Elicits intermediate reasoning steps before a final answer
  • Improves accuracy on arithmetic, logic, and multi-step reasoning tasks
  • Can be prompted explicitly or built into a model's default reasoning behavior
  • Often combined with few-shot examples showing worked reasoning chains
  • Trades additional generated tokens for improved answer quality
  • Widely used in agentic and multi-step planning workflows

Use Cases

Mathematical and logical problem solving
Complex code generation and debugging
Multi-step planning in AI agents
Structured decision-making and analysis pipelines
Improving reliability of LLM-generated answers in high-stakes tasks
Explaining and auditing a model's reasoning process

Frequently Asked Questions

From the Blog