Prompting Techniques 9 min read

Chain-of-Thought Prompting: How to Get AI to Reason Step by Step

By Emmanuel Abou Chabke, Founder and Editor · Reviewed by the AIQuickPrompt editorial team · About the publisher

Chain-of-thought prompting means asking an AI model to work through a problem in steps before it gives the final answer. It was first described in a 2022 research paper, and it still helps on multi-step tasks like maths, planning, comparisons and debugging. This guide explains how it works, when it is worth the extra tokens, how it differs from prompt chaining, and gives you templates you can save in AIQuickPrompt and reuse.

A glowing prompt card connected to a rising path of four stepping-stone tiles that ends in a bright lightbulb, representing step-by-step reasoning
A glowing prompt card connected to a rising path of four stepping-stone tiles that ends in a bright lightbulb, representing step-by-step reasoning

What is chain-of-thought prompting?

Chain-of-thought (CoT) prompting is a technique where you ask the model to break a problem into intermediate steps before answering. Instead of jumping straight to a result, the model writes out the reasoning, which tends to reduce mistakes on tasks that need several steps.

The idea comes from the paper "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models" by Wei and colleagues at Google (2022). They showed that a few worked examples with written-out reasoning improved results on arithmetic, commonsense and symbolic reasoning tasks for large models.

Zero-shot vs few-shot chain-of-thought

There are two common ways to use it. Zero-shot CoT simply adds an instruction such as "Think through this step by step, then give the final answer." Few-shot CoT includes one or more worked examples that show the reasoning pattern you want, then asks the new question.

Zero-shot is quick and costs fewer tokens. Few-shot gives you more control over the format and depth of the steps, and pairs naturally with the techniques in our few-shot prompting guide.

  • Zero-shot CoT: one extra instruction, good default for everyday questions.
  • Few-shot CoT: worked examples, best when you need a consistent structure.
  • Structured CoT: ask for reasoning and final answer in separate, labelled sections so the answer is easy to find.

When does chain-of-thought help, and when is it unnecessary?

CoT is most useful for problems with several dependent steps: calculations, comparing options against criteria, planning a schedule, troubleshooting code or checking a document against rules. For simple lookups, rewrites or short creative tasks it mostly adds length.

Many current models, including the reasoning modes in recent GPT, Claude and Gemini releases, already think internally before answering. Provider guidance notes that these models often do best with clear, direct instructions rather than detailed step-by-step scripts. With them, ask for a short summary of the key steps if you want to check the logic, rather than forcing long visible reasoning.

  • Use it: multi-step maths, decisions with trade-offs, debugging, rule checking.
  • Skip it: translation, tone rewrites, short summaries, simple facts.
  • Test it: run the same prompt with and without the instruction and compare.

Chain-of-thought vs prompt chaining

The names are similar but the techniques are different. Chain-of-thought happens inside one prompt: the model reasons step by step in a single answer. Prompt chaining splits a task across several separate prompts, and you pass the checked result of one into the next.

They work well together. A single step in a chain can use CoT when that step needs careful reasoning. Read our prompt chaining guide for the multi-prompt version.

Reusable chain-of-thought templates

Save these as prompts in AIQuickPrompt and fill the {{variables}} each time with Use Prompt.

Decision template: "I need to choose between {{options}} for {{goal}}. My criteria are {{criteria}}. Work through each option against each criterion step by step, using only the facts I gave you. If a fact is missing, say so instead of guessing. Then give a final recommendation in one sentence under the heading Answer."

Calculation template: "Solve this: {{problem}}. Show each step of the calculation on its own line, check the result by a second method, then give the final number under the heading Answer."

Debugging template: "Here is my code: {{code}}. The error is: {{error}}. Reason step by step about what could cause it, list the most likely cause first, then give the smallest fix."

A word problem split into three stacked steps with check marks, a magnifying glass reviewing the final answer, next to a shelf of saved prompt cards
A word problem split into three stacked steps with check marks, a magnifying glass reviewing the final answer, next to a shelf of saved prompt cards

Does chain-of-thought cost more AI credits?

Yes, usually. Written reasoning means more output tokens, and output tokens are what most providers charge for. On a cheap fast model that is often still less than running a premium model without CoT, but it depends on the task.

A practical approach: try a fast model with a CoT instruction first, and only move to a premium model if the answer is still wrong. Our guide to saving AI credits covers more ways to keep costs down.

How AIQuickPrompt helps you use chain-of-thought

Store your best CoT templates in a folder so they are one tap away in any AI tool. Variables turn each template into a fill-in form, and version history lets you compare a version with step-by-step instructions against one without.

AI Optimise can rewrite a prompt for you, and Guide the optimisation lets you ask it to "add step-by-step reasoning and a separate final answer". Recommend a model suggests whether a task needs a premium reasoning model or whether a cheaper one will do.

Common chain-of-thought mistakes

Watch out for these:

  • Trusting the steps blindly: written reasoning can still contain errors, so check the facts and the final answer.
  • Using it everywhere: simple tasks get longer and more expensive without getting better.
  • Over-scripting reasoning models: they often perform better with a clear goal than a forced step list.
  • No clear final answer: always ask for the answer in a labelled section.
  • Letting the model invent missing facts: tell it to say what is missing instead.

Chain-of-thought prompting is a simple habit that makes AI more reliable on multi-step work. Create a free AIQuickPrompt account, save the three templates above, and test them against your usual prompts to see which version gives you better answers.

Further reading

Recommended guides on vibe coding, AI build quality, and keeping your AI spend under control.

Frequently asked questions

What is chain-of-thought prompting in simple terms?

It is asking an AI model to work through a problem step by step before giving its final answer, which helps on tasks with several steps.

What is an example of a chain-of-thought prompt?

"A shop sells pens at 3 for €2. How much do 12 pens cost? Think through it step by step, then give the final answer."

Is chain-of-thought the same as prompt chaining?

No. Chain-of-thought is step-by-step reasoning inside one prompt. Prompt chaining splits a task across several prompts and passes results between them.

Do I still need chain-of-thought with reasoning models?

Often not. Reasoning models think internally already, so clear instructions usually work best. You can still ask for a brief summary of key steps to check the logic.

Does chain-of-thought use more tokens?

Usually yes, because the written reasoning adds output tokens. Use it where accuracy matters and skip it for simple tasks.

Can I save chain-of-thought templates in AIQuickPrompt?

Yes. Save them as prompts with {{variables}}, keep them in a folder, and use version history to compare different wordings.

Keep reading