מתי להשתמש
"CoT", "Chain of thought", "Step by step", "Reasoning", "Math problems", "Complex logic".
הוראות עבודה
1. What is CoT
Ask AI to show its work — reason step by step before answering.
Why
- 30-50% accuracy boost on reasoning tasks.
- Math problems especially improve.
- Multi-step decisions better.
- Debugging — see where logic broke.
2. Basic CoT
Without CoT
Q: A store has 23 apples. They sell 8 in morning, 5 in afternoon. They get 12 more. How many?
A: 22.
With CoT
Q: A store has 23 apples. They sell 8 in morning, 5 in afternoon. They get 12 more. How many?
Think step by step:
1. Start: 23 apples
2. Sell morning: 23 - 8 = 15
3. Sell afternoon: 15 - 5 = 10
4. Receive: 10 + 12 = 22
Answer: 22 apples.
Same answer, but:
- More reliable.
- Can verify reasoning.
- Catches errors.
3. CoT Triggers (Prompt Phrases)
- "Think step by step"
- "Let's work through this systematically"
- "First, analyze... then..."
- "Show your reasoning"
- "Break this into smaller steps"
4. When to Use CoT
✅ Best For
- Math.
- Multi-step reasoning.
- Complex decisions.
- Logic puzzles.
- Code debugging.
- Strategic planning.
❌ Skip For
- Simple lookups.
- Creative writing (different approach).
- Translation.
- Summarization.
5. Advanced: Few-shot CoT
Combine examples + step-by-step:
Example 1:
Q: ...
Reasoning: ...
Answer: ...
Example 2:
Q: ...
Reasoning: ...
Answer: ...
Now solve:
Q: [your question]
Reasoning:
Answer:
6. ReAct Pattern (Reasoning + Acting)
Used in agents:
Thought: I need to find the user's location.
Action: search_database(user_id=123)
Observation: User is in Tel Aviv.
Thought: Now I need weather there.
Action: get_weather(city="Tel Aviv")
Observation: 22°C, sunny.
Thought: I can answer.
Final Answer: It's 22°C and sunny in Tel Aviv.
7. Tree of Thoughts (ToT) — Advanced
- Explore multiple reasoning paths.
- Evaluate each.
- Choose best.
- More expensive but better for hard problems.
8. Self-Consistency
- Run prompt multiple times.
- Majority answer = correct.
- Useful for ambiguous problems.
9. CoT in Claude vs GPT-4
- Claude — does CoT naturally even without prompting.
- GPT-4 — benefits from explicit "step by step".
- o1/o3 — built-in CoT (reasoning models).
10. Common Mistakes
❌ CoT for simple tasks — wastes tokens. ❌ No structure — "think step by step" too vague. ❌ Not validating reasoning steps.
11. Cost
- CoT = more output tokens = more cost.
- Worth it for accuracy when matters.
- For high-volume simple tasks → skip CoT.
12. אסיים בהמלצה.
פרומפט לדוגמה
Build CoT prompt for financial analysis.
Why does my Claude prompt skip steps?
ReAct pattern for agent. Example.
© 2026 AI Expert Pro | גרסה 1.0.0