Chain-of-Thought Prompting
Master chain-of-thought prompting to improve AI reasoning. Guide models through step-by-step thinking for better accuracy on complex problems.
Chain-of-Thought Prompting
Chain-of-thought (CoT) prompting guides AI models to show their reasoning process step-by-step. This technique significantly improves accuracy on math, logic, and complex reasoning tasks by making the model work through problems systematically.
Basic CoT
Simply add "Let's think step by step" to your prompt:
Q: A store has 45 apples. They sell 12 in the morning and 8 in the afternoon.
They receive a shipment of 30 apples. How many apples do they have now?
Let's think step by step.
Zero-Shot CoT
No examples needed - just instruct the model to reason:
Explain your reasoning step by step before giving your final answer.
Few-Shot CoT
Provide examples showing the reasoning pattern:
Q: Roger has 5 tennis balls. He buys 2 more cans of 3 balls each.
How many tennis balls does he have now?
A: Roger started with 5 balls.
2 cans of 3 balls each = 2 × 3 = 6 balls
5 + 6 = 11 tennis balls
The answer is 11.
Q: {your question}
A:
Advanced Techniques
Self-Consistency Generate multiple reasoning paths and take the majority answer:
Solve this problem 3 different ways. Compare your answers and explain which reasoning is most reliable.
Tree of Thoughts Explore multiple reasoning branches:
Consider 3 different approaches to solve this problem.
For each approach:
1. Outline the steps
2. Identify potential issues
3. Work through the solution
Then compare approaches and select the best one.
Verification Step Add a self-check:
After solving, verify your answer by:
1. Checking if it makes logical sense
2. Working backwards from the answer
3. Estimating to see if it's in the right ballpark
When CoT Helps Most
| Task Type | CoT Benefit |
|---|---|
| Math problems | High - explicit calculation steps |
| Logic puzzles | High - reveals reasoning errors |
| Multi-step analysis | High - maintains context |
| Simple facts | Low - adds unnecessary tokens |
| Creative writing | Medium - helps with plot consistency |
Prompt Templates
Basic CoT:
{question}
Think through this step by step before answering.
Verified CoT:
{question}
Step 1: Identify what's being asked
Step 2: Break down the problem
Step 3: Solve each part
Step 4: Verify your answer
Show your work for each step.
Comparative CoT:
{question}
Approach 1: [reasoning]
Approach 2: [reasoning]
Approach 3: [reasoning]
Which approach gives the most reliable answer and why?
Related Articles
Prompt Optimization
Techniques for optimizing prompts to improve AI response quality, reduce token usage, and achieve consistent results across models.
Midjourney Horror & Thriller SREF Codes: Cinematic Guide
Discover Midjourney SREF codes for creating tense horror and thriller cinematics. Generate unsettling atmospheres with dramatic lighting, eerie shadows, and suspenseful visual styles.
Structured Outputs (JSON Mode)
Get consistent, parseable JSON responses from AI models. Learn schema definition, validation, and techniques for reliable structured data extraction.