The zero-shot and few-shot chain-of-thought prompt templates that improve accuracy on multi-step reasoning tasks by making the model show its work.
{{USER_QUESTION}}
Think through this step by step before giving your final answer.Forces the model to show step-by-step reasoning before giving a final answer. Improves accuracy on math, logic, and complex analysis tasks by making the reasoning process explicit.
Solve the following problems step by step.
Problem: {{EXAMPLE_PROBLEM_1}}
Step 1: {{EXAMPLE_STEP_1}}
Step 2: {{EXAMPLE_STEP_2}}
Answer: {{EXAMPLE_ANSWER_1}}
Problem: {{EXAMPLE_PROBLEM_2}}
Step 1: {{EXAMPLE_STEP_1_P2}}
Step 2: {{EXAMPLE_STEP_2_P2}}
Answer: {{EXAMPLE_ANSWER_2}}
Problem: {{USER_PROBLEM}}
"Step by step" — This exact phrase is the canonical zero-shot chain-of-thought trigger (Kojima et al., 2022). Other phrasings produce weaker results.
Examples show the format, not just the answer — Few-shot CoT examples must include intermediate steps. Models learn the reasoning format by demonstration.
Answer labeled explicitly — The Answer: label gives a reliable extraction point for programmatic parsing.
| Variant | When to use |
|---|---|
| Zero-shot | No examples available; works on GPT-4/Claude class models |
| Few-shot (2–3 examples) | Highest accuracy; use when you have labeled examples |
| Zero-shot-CoT + self-check | Add: "Now verify your answer by checking each step." |