A Journey of a Thousand Miles Begins with a Single Step - Chain of Thought Prompting
Chain of Thought
prompting is a technique that helps AI solve complex problems step by step and encourages it to explain its reasoning process. It is often abbreviated as CoT
.
CoT not only asks the AI to provide an answer but also to explain the steps taken to arrive at that answer. This is done by using words like step by step
or in sequence
at the end of the prompt to guide the AI's reasoning process.
CoT prompting was formalized in Google's 2022 research paper Chain of Thought Prompting Elicits Reasoning in Large Language Models. According to the paper, CoT prompts improved the accuracy of GPT-3 model responses from 38.0%
to 54.5%
.
This method of analyzing problem situations step by step is particularly effective in improving the results of scenarios requiring mathematical reasoning.
How to Use It?
CoT prompting, like few-shot prompting, includes multiple scenarios in one prompt but encourages the AI to reason and solve each scenario step by step.
You received $500 for a business trip.
You spent $200 on hotel accommodation,
and $100 on transportation.
From the remaining amount, you plan to spend $20 per meal.
How many meals can you afford?
Please calculate step by step.
Starting point verification: Received $500 for the business trip.
Initial budget calculation: Total budget = $500
First expense verification: Spent $200 on hotel accommodation.
Remaining budget calculation: $500 - $200 = $300
Second expense verification: Spent $100 on transportation.
Remaining budget calculation: $300 - $100 = $200
Remaining amount verification: After hotel and transportation expenses, the remaining amount is $200.
Current remaining budget: $200
Unit cost verification: Plan to spend $20 per meal.
Cost per meal: $20
Maximum number of meals calculation: Calculate the number of meals possible with the remaining amount.
Calculation method: Remaining amount ÷ Cost per meal = $200 ÷ $20
Final calculation and result:
Calculation result: $200 ÷ $20 = 10
Maximum number of meals: 10
Answer:
You can afford up to 10 meals.
While CoT is particularly strong in solving mathematical problem situations like the above, it can also be applied to general scenarios requiring step-by-step analysis as shown below.
You are preparing a marketing plan presentation for selling air conditioners in the summer.
For each stage of the preparation, suggest what content is necessary.
1. Research
2. Content that must be included in the presentation
3. Points to consider during the presentation
4. Presentation script
1. Research
- Market analysis: Current air conditioner market size, growth rate, key trends
- Competitor analysis: Main competitors' product features, price ranges, marketing strategies
- Consumer analysis: Consumer preferences, purchase factors, key target groups (age, region, income level)
- Product analysis: Key features of own air conditioners, advantages, technological superiority
- Historical data analysis: Past summer air conditioner sales data, effective marketing channels
2. Content that must be included in the presentation
- Market and consumer analysis: Market status, target consumer group analysis
- Competitor comparison: Comparison with main competitors' products
- Marketing objectives: Specific sales targets, market share goals
- Marketing strategy:
- Product strategy: Product's USP (Unique Selling Proposition)
- ...
By using key phrases like step by step and in sequence, CoT prompting guides AI in step-by-step reasoning, which can be utilized in both solving mathematical problems and analyzing scenarios that require systematic breakdown.
Practice
Send a prompt example and compare the AI's response.
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.