Least-to-Most — Bottom-Up Problem Decomposition
From simple to complex
The Problem: Complex problems are overwhelming. How can we break them into manageable pieces and solve them one step at a time?
The Solution: Eat the Elephant One Bite at a Time
Least-to-Most prompting breaks a complex problem into simpler subproblems, solves them from easiest to hardest, and feeds each solution into the next step. The name says it literally: you go from the “least” (simplest) subproblem to the “most” (hardest) one. Each answer becomes context for the question that follows, like climbing a staircase one step at a time. It was introduced by researchers at Google in 2022 as a way to push past a known weakness of Chain-of-Thought: standard CoT often fails when a task is harder than the examples it was shown.
How it works
The method runs in two distinct phases. First comes decomposition: the model is prompted to list the subproblems that must be answered before it can reach the final goal, and to order them by dependency. Then comes sequential solving: each subproblem is solved in turn, and the prompt for every later step explicitly includes the answers already produced. This is what separates it from plain CoT, where the model reasons in one pass, and from few-shot prompting, where you only supply static examples. Because earlier solutions are reused as building blocks, Least-to-Most generalizes to inputs longer and harder than anything in the prompt — the property researchers call compositional generalization.
When to use it — and the tradeoffs
Reach for Least-to-Most when a task is genuinely compositional: later steps depend on earlier results, and the model keeps stumbling because it tries to leap to the answer in one shot. Multi-step math, symbolic manipulation, and long parsing tasks are classic fits. The tradeoffs are real, though. Splitting one prompt into several means more tokens and higher latency, and an error in an early subproblem propagates — if step 2 is wrong, every step built on it inherits the mistake. It also overlaps heavily with Prompt Chaining; the difference is that chaining is a general engineering pattern, while Least-to-Most specifically orders steps from simple to complex so each one bootstraps the next.
Worked example. Ask: “If Amy can climb 4 rungs of a ladder and loses 1 rung of progress each time she pauses, and she pauses twice, how many rungs has she climbed when the ladder has 10 rungs total — and will she reach the top?” Instead of guessing, the model first decomposes: (1) net rungs gained per climb-pause cycle, (2) total rungs after two pauses, (3) compare that to 10. It solves (1) = 4 − 1 = 3 per cycle, uses that to solve (2) = two cycles give 6 rungs climbed, then feeds 6 into (3) to conclude she has not reached the top. Each sub-answer is carried forward verbatim, so the final comparison rests on solid ground rather than a lucky guess.
Think of it like eating an elephant one bite at a time:
- 1. Decompose: "What are the subproblems I need to solve?"
- 2. Order: "Which is simplest? What builds on what?"
- 3. Solve easiest: Get a foundation answer
- 4. Build up: Use each answer to help solve the next problem
Where Is This Used?
- Long Math Problems: Breaking word problems into calculation steps
- Reading Comprehension: Understanding complex texts piece by piece
- Programming: Building solutions from helper functions up
- Research: Answering complex questions with dependent sub-questions
Fun Fact: Least-to-Most was specifically designed for problems that require "symbolic reasoning" — where each step depends on previous ones. It significantly outperforms standard CoT on compositional tasks!
Try It Yourself!
Use the interactive example below to see how breaking a problem into smaller pieces leads to better solutions.
📈 Least-to-Most — break complex task into subproblems, solve from simple to complex. Each next solution uses previous ones!
How many ways to climb 5 stairs if you can step 1 or 2 steps at a time?
⚠️ Correct, but without understanding why
Task: How many ways to climb 5 stairs if you can step 1 or 2 steps at a time? Break this task into subproblems from simple to complex. Then solve each subproblem in order, using solutions from previous steps for the next ones.
LLM will determine subproblems and solve them sequentially.
Task: How many ways to climb 5 stairs if you can step 1 or 2 steps at a time? Solve this task by breaking it into the following subproblems (from simple to complex): 1. 1 stair 2. 2 stairs 3. 3 stairs 4. 4 stairs 5. 5 stairs Solve each in order. In each next step, use solutions from previous ones.
Useful when you know the task structure better and want to control decomposition.
Least-to-Most works like dynamic programming: simple case solutions become building blocks for complex ones. Especially effective for: recursive problems, multi-step calculations, pedagogy (explaining concepts).
Frequently asked questions
How is Least-to-Most different from Chain-of-Thought?
Chain-of-Thought reasons in a single pass and often fails when a task is harder than the examples it was shown. Least-to-Most adds an explicit decomposition phase: the model first lists subproblems and orders them by dependency, then solves them one by one, feeding earlier answers into later steps. This gives compositional generalization — it works on inputs longer and harder than anything in the prompt.
When should I use Least-to-Most prompting?
Use it when a task is genuinely compositional: later steps depend on earlier results and the model keeps stumbling by trying to leap to the answer in one shot. Classic fits are multi-step math, symbolic manipulation, long parsing tasks, and questions with dependent sub-questions. For single-step problems the extra decomposition only adds tokens and latency.
What is the difference between Least-to-Most and Prompt Chaining?
They overlap heavily — both split work into several connected calls. But Prompt Chaining is a general engineering pattern (any sequence where one step's output feeds the next). Least-to-Most is a specific case where the steps are deliberately ordered from simplest to hardest so each solution acts as a building block for the one after it.
What are the downsides of Least-to-Most prompting?
Two main ones. First, cost: splitting one prompt into several means more tokens and higher latency. Second, error propagation: if an early subproblem is solved incorrectly, every step built on it inherits the mistake. That is why the method pays off specifically on compositional tasks where the benefit of stepwise solving outweighs the overhead.
Try it yourself
Interactive demo of this technique
How many ways to climb a 5-step staircase if you can step 1 or 2 steps at a time?
This is Fibonacci numbers: F(5) = F(4) + F(3) = 5 + 3 = 8 ways.
Solving from simple to complex:
📊 Subproblem 1: 1 step Ways: only [1] Answer: 1 way
📊 Subproblem 2: 2 steps Ways: [1,1] or [2] Answer: 2 ways
📊 Subproblem 3: 3 steps If first step is 1 → 2 steps left → 2 ways If first step is 2 → 1 step left → 1 way Answer: 2 + 1 = 3 ways
📊 Subproblem 4: 4 steps First step 1 → 3 steps → 3 ways First step 2 → 2 steps → 2 ways Answer: 3 + 2 = 5 ways
📊 Subproblem 5: 5 steps First step 1 → 4 steps → 5 ways First step 2 → 3 steps → 3 ways Answer: 5 + 3 = 8 ways
✅ Final answer: 8 ways
💡 Pattern: this is Fibonacci sequence! 1, 2, 3, 5, 8...
Least-to-Most shows how simple case solutions build foundation for complex ones. The model also discovered the general pattern (Fibonacci).
Create a free account to solve challenges
3 AI-verified challenges for this lesson
This lesson is part of a structured LLM course.
My Learning Path