Need AI Training/Help?CloudYeti.io/meet
MarkdownMe
Prompt optimizer guide

Chain-of-Thought Prompting: Ask for Step-by-Step Reasoning

Prompt the model to reason step by step to improve accuracy on multi-step math, logic, and planning tasks.

Direct answer

Chain-of-thought prompting asks the model to work through its reasoning step by step before giving an answer, which improves accuracy on multi-step math, logic, and planning. Add an instruction like 'think step by step and show your reasoning, then give the final answer'. It helps complex tasks and is unnecessary for simple lookups.

Open the Prompt Optimizer

When to use this

  • The task involves multiple steps: math, logic, or planning.
  • The model jumps to a wrong answer without showing its work.
  • You want to see the reasoning to catch mistakes.

Steps

  1. State the problem clearly.
  2. Add: think step by step and show your reasoning.
  3. Ask for the final answer on its own line at the end.
  4. For consistency, request the same reasoning format each time.
  5. Skip chain-of-thought for simple, single-step tasks.

Example

Rough prompt idea
If a train travels 60 miles in 1.5 hours, what is its average speed? Answer only.
Optimized prompt
Solve this step by step, then give the final answer on the last line.

Problem: A train travels 60 miles in 1.5 hours. What is its average speed?

Reasoning: speed = distance / time = 60 / 1.5.
Final answer: 40 mph.

Common mistakes

  • For trivial tasks, step-by-step reasoning just adds length with no benefit.
  • If you only want the answer, still ask for reasoning first, then the final line — do not suppress it entirely on hard tasks.
  • Long reasoning uses more tokens; keep it when accuracy matters, drop it when it does not.

FAQ

What is chain-of-thought prompting?
It is asking the model to show its step-by-step reasoning before answering. On multi-step problems this improves accuracy compared with demanding an immediate answer.
When does it help?
On math, logic, and planning tasks with several steps. For simple factual lookups it adds length without improving the result.
How do I still get a clean final answer?
Ask the model to reason first and then put the final answer on its own line, so you get both the working and an easy-to-extract result.

Related Prompt Optimizer guides