One Step at a Time: Chain of Thought Prompting
Chain of Thought prompting is a technique that helps AI solve complex problems step by step and guides it to explain its reasoning process. It is commonly abbreviated as CoT.
CoT does not just ask AI to arrive at an answer. It asks AI to explain the process of getting there, step by step. To achieve this, words like step by step or in order are typically added at the end of a prompt to encourage sequential reasoning.
CoT prompting was formalized in the 2022 Google research paper Chain of Thought Prompting Elicits Reasoning in Large Language Models. According to the paper, CoT prompting improved GPT-3's answer accuracy from 38.0% to 54.5%.
This step-by-step analytical approach is especially effective at improving results in problem scenarios that require mathematical reasoning.
How Do You Use It?
Like few-shot prompting, CoT prompting includes multiple scenarios in a single prompt, but guides AI to reason through and resolve each scenario step by step.
You have been given $500 in travel expense reimbursement from your company.
You spent $200 on hotel accommodation,
and $100 on transportation.
You plan to spend $20 per meal from the remaining amount.
What is the maximum number of meals you can have?
Please calculate step by step.
Starting point: You received $500 in travel expense reimbursement.
Starting point: Total budget = $500
First expense: $200 was spent on hotel accommodation.
Remaining budget: 500 - 200 = $300
Second expense: $100 was spent on transportation.
Remaining budget: 300 - 100 = $200
Remaining amount: After hotel and transportation expenses, $200 remains.
Current remaining budget: $200
Unit cost: You plan to spend $20 per meal.
Cost per meal: $20
Calculating the maximum number of meals: Calculate the number of meals possible with the remaining amount.
Calculation: Remaining amount ÷ Cost per meal = 200 ÷ 20
Final calculation and result:
Result: 200 ÷ 20 = 10
Maximum number of meals: 10
Answer:
You can have a maximum of 10 meals.
CoT shows great strength for resolving mathematical problem scenarios like the one above, but it can also be applied to general situations that require step-by-step analysis, as shown below:
I am preparing a presentation of a marketing plan for summer air conditioner sales.
For each stage of preparing the presentation, please describe what content will be needed.
1. Research and data gathering
2. Essential content to include in the presentation slides
3. Key points to keep in mind during the presentation
4. Presentation script
1. Research and Data Gathering
- Market analysis: Current air conditioner market size, growth rate, key trends
- Competitive analysis: Key competitors' product features, price ranges, marketing strategies
- Consumer analysis: Consumer preferences, purchase drivers, primary target segments (age, region, income level)
- Product analysis: Key features, advantages, and technical strengths of our air conditioner
- Historical data analysis: Previous summer air conditioner sales data, effective marketing channels
2. Essential Content to Include in Presentation Slides
- Market and consumer analysis: Current market conditions, target consumer segment analysis
- Competitor comparison: Comparison with major competitor products
- Marketing objectives: Specific sales targets, market share goals
- Marketing strategy:
- Product strategy: Product USP (Unique Selling Proposition)
- ...
As shown, CoT prompting uses key phrases like step by step and in order to encourage sequential reasoning in AI, and can be applied both to mathematical problem-solving and to general situations that require step-by-step analysis.
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.