P

Chain-of-Thought (CoT): Definition and Examples

Chain-of-Thought (CoT) pushes the model to decompose its reasoning into explicit steps before the final answer, significantly improving quality on logic tasks.

Full definition

CoT, introduced by Google Research in 2022, is a major breakthrough. The idea: ask the model to think step by step.

Why does it work? LLMs generate token by token. Thinking out loud allows each step to serve as context for the next, reducing logic errors.

CoT is effective for math, logical reasoning, multi-criteria analysis, and planning. On math benchmarks, +20-40% performance.

Two variants: explicit CoT ('Reason step by step' — zero-shot CoT) and CoT by examples (few-shot with full reasoning).

Etymology

Formalized in 'Chain-of-Thought Prompting Elicits Reasoning in LLMs' (Wei et al., Google Brain, 2022). The analogy: a chain of thought where each link strengthens the next.

Concrete examples

Math problem

A store offers 20% off an item priced at €85, then a loyalty discount of €5. Final price?

Reason step by step.

Complex decision analysis

Compare 3 job offers step by step (salary, location, prospects, culture).

A: €55K Paris startup | B: €48K Lyon large group | C: €60K remote US scale-up

Analyze each criterion then recommend.

Code debugging

This Python code has a bug. Analyze the flow line by line, identify the error, propose a fix.

Practical usage

Add 'Reason step by step' to your complex prompts. For calculations, ask to show each operation.

Related concepts

Tree-of-ThoughtSelf-consistencyFew-shotReasoning

FAQ

Does CoT work with all models?
Mainly large models (GPT-4, Claude, Gemini Pro). Small models (<7B) benefit marginally.
Does CoT consume more tokens?
Yes, 2-5x more output. Quality/cost trade-off. Useless for simple tasks, essential for complex ones.
CoT vs Tree-of-Thought?
CoT = linear reasoning. ToT = explores multiple branches in parallel. ToT more powerful but more expensive.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.