Ask ChatGPT to Use Chain of Thought: Reasoning by Example
Chain of thought (CoT) is a prompting technique described in “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models” by Jason Wei et al. The idea behind CoT is that large language models are not good at logical reasoning or solving word problems. However, if you can construct a prompt that includes a similar word problem and its solution, followed by the problem that you want to solve, ChatGPT will follow the style of logic in your prompt and use it to solve your problem.
For example:
Prompt: Question: Jane is biking to school from her house. The ride to school normally takes 20 minutes. If she has biked 3 miles in 15 minutes, how far is the school from her house?
Answer: Use the formula
distance = rate × timewhererateis Jane’s speed andtimeis the time it takes her to travel a certain distance. We know that Jane has biked 3 miles in 15 minutes, so her speed is:rate = distance / time = 3 miles / 15 minutes = 0.2 miles per minuteWe also know that the ride to school normally takes 20 minutes. Using the rate we just calculated, we can find the distance to school as follows:
distance = rate × time = 0.2 miles per minute × 20 minutes = 4 milesTherefore, the school is 4 miles away from Jane’s house.
Question: My commute to work requires an hour-long commuter train trip. If I have traveled 40 miles in 45 minutes, how far is the commute?
I haven’t ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access