Chain-of-Thought (CoT)
Step-by-step thinking for complex tasks
Chain-of-Thought Prompting
Chain-of-Thought (CoT) Prompting guides the AI through a step-by-step thinking process. This technique dramatically improves performance on complex tasks like mathematics, logic, and multi-step problems.
How does CoT work?
Instead of jumping directly to the answer, show the AI how to arrive at the solution step by step.
Without CoT
Question: Max has €64. Books cost €12 each. How many can he buy?
Answer: 5 books
With CoT
Question: Max has €64. Books cost €12 each. How many can he buy?
Thought process:
1. Max has €64 available
2. Each book costs €12
3. Number of books = €64 ÷ €12 = 5.33
4. Since you can't buy partial books: 5 books
5. Cost: 5 × €12 = €60
6. Remainder: €64 - €60 = €4
Answer: Max can buy 5 books and has €4 left over.
Zero-Shot CoT
The simplest form: Add "Let's think about this step by step."
Question: A company has 156 employees. 40% work part-time.
How many full-time employees are there?
Let's think about this step by step.
AI Response:
Step 1: Total number of employees = 156
Step 2: Part-time employees = 40% of 156 = 0.4 × 156 = 62.4 ≈ 62
Step 3: Full-time employees = Total - Part-time = 156 - 62 = 94
Answer: There are 94 full-time employees.
Few-Shot CoT
Show examples of how the thinking process should look.
Example 1:
Question: Sarah has 20 apples. She gives her sister 25% and eats 3.
How many remain?
Solution:
- Start: 20 apples
- 25% of 20 = 5 apples for sister
- After sharing: 20 - 5 = 15 apples
- After eating: 15 - 3 = 12 apples
Answer: 12 apples remain.
Example 2:
Question: A store offers 15% discount on an item for €80.
What is the final price?
Solution:
- Original price: €80
- Discount: 15% of €80 = 0.15 × €80 = €12
- Final price: €80 - €12 = €68
Answer: The final price is €68.
Your task:
Question: Lisa saves €200 monthly. After 8 months she buys a
laptop for €1,200. How much money remains?
Application Areas
Business Analysis
Analyze the profitability of this product line:
- Monthly fixed costs: €5,000
- Variable costs per unit: €15
- Selling price: €45
- Average sales: 250 units/month
Let's calculate profitability step by step:
1. Monthly revenue = 250 × €45 = €11,250
2. Total variable costs = 250 × €15 = €3,750
3. Total costs = Fixed costs + Variable costs = €5,000 + €3,750 = €8,750
4. Profit = Revenue - Total costs = €11,250 - €8,750 = €2,500
5. Profit margin = (€2,500 / €11,250) × 100 = 22.2%
The product line is profitable with €2,500 profit and 22.2% margin.
Project Planning
Task: Plan resources for a 6-month project:
- 3 developers (€100/hour each)
- 1 designer (€80/hour)
- Estimated hours: 960
Thinking steps:
1. Developer hours: 3 × €100 × 960h = €288,000
2. Designer hours: 1 × €80 × 960h = €76,800
3. Total personnel costs: €288,000 + €76,800 = €364,800
4. Overhead (20%): €364,800 × 0.2 = €72,960
5. Buffer (10%): €364,800 × 0.1 = €36,480
6. Total budget: €364,800 + €72,960 + €36,480 = €474,240
Decision Making
Should our company invest in new software for €50,000?
Analysis steps:
1. Current costs due to inefficiency: €8,000/month
2. Expected savings through software: 60%
3. Monthly savings: €8,000 × 0.6 = €4,800
4. Amortization period: €50,000 ÷ €4,800 = 10.4 months
5. ROI after 2 years: (€4,800 × 24 - €50,000) / €50,000 = 130%
Recommendation: Yes, the investment pays for itself in less than a year.
Best Practices
Be Explicit
Tell the AI exactly to think step by step
Provide Structure
Number steps or use bullet points
Intermediate Results
Show calculations and partial results
CoT Variants
Standard CoT
"Explain your thinking process step by step"
Structured CoT
"Solve this in the following steps:
1. Identify the given information
2. Determine what is being asked
3. Choose the right method
4. Perform the calculation
5. Verify the result"
Self-Reflection CoT
"Solve the problem and then check:
- Is my logic correct?
- Have I considered all information?
- Does the result make sense?"
Common Pitfalls
Avoid:
- Too many irrelevant details in the thinking process
- Jumps in logic without explanation
- Forgetting intermediate steps
- Inconsistent notation or units
When to Use CoT
✅ Perfect for:
- Mathematical problems
- Logical reasoning
- Multi-step analyses
- Complex decisions
- Debugging and troubleshooting
❌ Less suitable for:
- Simple factual questions
- Creative tasks
- Direct translations
- Subjective opinions
Practical Exercises
-
Budget Analysis: "A project has €100,000 budget. Personnel costs 60%, marketing 25%, software 10%. How much remains for contingencies?"
-
Time Planning: "A team of 5 people needs to complete 200 tasks in 20 days. Each person works 8 hours daily. Is this feasible?"
-
ROI Calculation: "A machine costs €80,000 and saves €2,000 monthly. When will it be paid off?"
Pro Tip: Combine CoT with Few-Shot for optimal results on complex tasks!
Next Step: Learn about Knowledge Generation for even better reasoning capabilities.