Gradually Deepening Least-to-Most Prompting
Least-to-most
prompting is a method that starts with a simple question and gradually expands the prompt to complex questions.
Like prompt chaining, it connects multiple prompts to solve complex problems, but it differs in that it starts with simple questions and gradually increases in complexity.
Least-to-Most prompting was introduced in the 2022 paper Least-to-Most Prompting Enables Complex Reasoning in Large Language Models and is often abbreviated as LtM.
What are the advantages of Least-to-Most prompting?
-
Improved accuracy in logical problem-solving: According to research, LtM prompting significantly enhances the accuracy of responses in complex reasoning tasks compared to typical prompting and chain-of-thought (CoT) prompting. For example, in tasks like solving equations and symbolic manipulation involving calculus, LtM achieved an accuracy of 74-94%, markedly higher than CoT's 31.8-84.2%.
-
Exceptional mathematical reasoning: LtM prompting excels in logical tasks requiring multiple steps, such as mathematical reasoning. In the GSM8K benchmark for evaluating the mathematical reasoning abilities of large language models (LLMs), LtM prompting achieved an accuracy of 62.39%, higher than CoT's 60.87%.
Example of Least-to-Most Prompting
Below is an example of using Least-to-Most prompting to solve a mathematical problem by progressively increasing question complexity.
Calculating the Area of a Triangle
Prompt 1
Question: What is the formula for calculating the area of a triangle?
Answer:
The area of a triangle is base * height / 2
.
Prompt 2
Question: Calculate the area of a triangle with a base of 8cm and a height of 5cm. How do you compute the area?
Answer:
The area of a triangle with a base of 8cm and a height of 5cm is (8 * 5) / 2 = 20
.
Prompt 3
Question: Explain the steps to calculate the area of a triangle with a base of 8cm and a height of 5cm.
Answer:
- Multiply the triangle's base by its height:
8 * 5 = 40
- Divide that result by 2:
40 / 2 = 20
- Therefore, the area of the triangle is 20cm².
LtM prompts are particularly useful for solving not only math problems but also logical calculations, such as financial accounting.
Calculating Earnings Per Share (EPS)
Prompt 1
Question: Do you know how to calculate Earnings Per Share (EPS)?
Answer:
Yes, EPS is the net income divided by the number of outstanding shares. In other words, EPS = Net Income / Number of Outstanding Shares
.
Prompt 2
Question: If a company has a net income of $1,000,000 and 500,000 shares outstanding, how do you calculate the EPS?
Answer:
EPS is calculated as Net Income / Number of Outstanding Shares
. So, $1,000,000 / 500,000 shares = $2
.
Prompt 3
Question: You are trying to calculate the P/E Ratio. If a company's stock price is $40 and its EPS is $2, how do you calculate the P/E Ratio?
Answer:
The P/E Ratio is calculated as Stock Price / EPS
. Thus, $40 / $2 = 20
.
Practice
Send the prompt examples and compare the AI's responses.
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.