A Journey of a Thousand Miles Begins with a Single Step: Chain of Thought Prompting
Chain of Thought
(CoT) prompting is a technique that helps an AI solve complex problems step-by-step, prompting it to explain its reasoning process. It is often abbreviated as CoT
.
CoT doesn't just ask the AI to provide an answer. Instead, it encourages the AI to explain the steps it took to arrive at that answer. This is achieved by using terms such as step-by-step
or in order
at the end of the prompt to guide the AI toward sequential reasoning.
The concept of CoT prompting was formalized in Google's 2022 research paper Chain of Thought Prompting Elicits Reasoning in Large Language Models. According to the paper, the introduction of CoT prompting improved the answer accuracy of the GPT-3 model from 38.0%
to 54.5%
.
This method of guiding the AI to analyze problems step-by-step has shown to be particularly effective in improving outcomes for problems requiring mathematical reasoning.
How Do You Use It?
CoT prompting, much like few-shot prompting, includes multiple scenarios in a single prompt but encourages step-by-step reasoning and solving for each scenario.
You received a $500 travel allowance from your company.
You spent $200 on hotel accommodation and
$100 on transportation.
From the remaining amount, you plan to use $20 for each meal.
How many meals can you have at most?
Please calculate step-by-step.
Initial check: You received a $500 travel allowance.
Starting point: Total budget = $500
First expense check: You spent $200 on hotel accommodation.
Remaining budget calculation: $500 - $200 = $300
Second expense check: You spent $100 on transportation.
Remaining budget calculation: $300 - $100 = $200
Remaining amount check: After spending on hotel and transportation, the remaining amount is $200.
Current remaining budget: $200
Unit expense check: You plan to use $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 derivation:
Calculation result: $200 ÷ $20 = 10 meals
Maximum number of meals: 10 meals
Answer:
You can have a maximum of 10 meals.
While CoT shows great strength in solving mathematical problem scenarios as seen above, it can also be applied to general situations requiring step-by-step analysis.
You are preparing a marketing plan presentation for selling air conditioners during the summer.
Please suggest what contents are needed for each step of the preparation.
1. Research
2. Essential content for the presentation materials
3. Points to consider during the presentation
4. Presentation script
1. Research
- Market analysis: Current size of the air conditioner market, growth rates, major trends
- Competitor analysis: Key competitors' product features, price range, marketing strategies
- Consumer analysis: Consumer preferences, purchasing factors, primary target audience (age, location, income level)
- Product analysis: Key features of our air conditioners, advantages, technical superiority
- Past data analysis: Sales data from previous summers, effective marketing channels
2. Essential content for the presentation materials
- Market and consumer analysis: Market status, analysis of the target audience
- Competitor comparison: Comparison with key competitors' products
- Marketing objectives: Specific sales goals, market share targets
- Marketing strategies:
- Product strategy: Product's USP (Unique Selling Proposition)
- ...
In this way, CoT prompting leverages key phrases like step-by-step and in order to encourage the AI to reason sequentially and can be used effectively in both mathematical problem-solving and general situations that require step-by-step analysis.
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.