Module 2Lesson 3
20 minChain-of-Thought (CoT) Prompting
Chain-of-Thought (CoT) prompting encourages an LLM to break down complex problems into intermediate reasoning steps. This mimics human step-by-step thinking and significantly improves reasoning abilities.
How It Works
Instead of just providing the final answer in examples, CoT includes the reasoning process:
Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now?A: Roger started with 5 balls. 2 cans of 3 tennis balls each is 6 tennis balls. 5 + 6 = 11. The answer is 11.
Q: A restaurant has 23 apples. They use 20 to make lunch and buy 6 more. How many apples does the restaurant have now?
A: ```
Advantages
- Improved Reasoning: Significantly enhances complex reasoning
- Transparency: Makes the reasoning process visible
- Reduced Errors: Less likely to make simple mistakes
Limitations
- Increased Complexity: Requires articulating reasoning clearly
- Not Always Necessary: May be overkill for simple tasks
Exercise
Create a CoT prompt to solve a multi-step word problem. Show the reasoning steps explicitly.
0% Complete