Skip to main content
  1. Posts/

LEAST-TO-MOST PROMPTING

·391 words·2 mins· loading · loading · ·
 Author
Curious

Essentially it’s a 2 step method (although you can use a single prompt in some settings):

  1. Step 1: Break down complex problems into simpler subproblems
  2. Step 2: Solve the problems sequentially

Here’s an example of least-to-most prompting via a single prompt:

Q: It takes John 3 minutes to build a tower with blocks. It takes him 2 minutes to knock it down. The playtime ends in 20 minutes. How many times can he build and knock down the tower before playtime ends? A: To solve the problem “How many times can John build and knock down the tower before playtime ends?”, we need to:

  1. Determine the total time it takes for one complete cycle (build + knock down).
  2. Calculate how many complete cycles he can do within the available time of 20 minutes. Q: It takes Amy 4 minutes to climb to the top of a slide. It takes her 1 minute to slide down. The water slide closes in 15 minutes. How many times can she slide before it closes? A:

I like this method more than chain-of-thought because ti explicitly breaks the problem down into more manageable steps. This makes it easier to use this method for any task.

Additionally, in the head-to-head experiments it was able to consistently outperform chain-of-thought across a variety of tasks.

I put together three prompts that you can use to run least-to-most prompting for any problem.

Prompt 1: A prompt that will generate few-shot examples showing the model how to break down problems

Your job is to generate few-shot examples for the following task: {{ task }}

Your few-shot examples should contain two parts: A problem, and the decomposed subproblems. It should follow the structure below:

"""

Problem: Problem description

Decomposed subproblems:

  • Subproblem 1
  • Subproblem 2
  • Subproblem 3

"""

Your output should contain only the examples, no preamble

Prompt 2: Break down the task at hand into subproblems (with the previous output used as few-shot examples)

{{ task }}

List only the decomposed subproblems that must be solved before solving the task listed above. Your output should contain only the decomposed subproblems, no preamble

Here are a few examples of problems and their respective decomposed subproblems: {{ few-shot-examples}}

Prompt 3: Pass the subproblems and solve the task!

Solve the following task by addressing the subproblems listed below.

Task: {{ task }}

Subproblems: {{sub-problems}}