Reasoning Strategies › Least-to-Most Prompting

Michael BrenndoerferMarch 3, 20268 min read
Language AI HandbookAll chapters
Part 39 of 67Reasoning
Chapter 295Reasoning Strategies › Least-to-Most Prompting
Reading section 4 of 10 · Least-to-Most Prompting · 8 minSection 4 of 10 · 8 min

Book contents

Section 4 of 10 · 8 min read

Reasoning Strategies › Least-to-Most PromptingOne section · Sections in this chapter4 / 10 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Self-consistency and tree of thought improve reasoning by changing how many paths are explored or how the search proceeds. Least-to-most prompting takes a different angle: it changes what gets reasoned about.

Many complex problems fail not because the model reasons incorrectly at each step, but because the problem is too complex to reason about in one step. The model sees a long, multi-conditional problem, tries to solve it directly, and makes errors because it is skipping implicit intermediate steps, conflating multiple facts, or exhausting its effective reasoning window. The failure is architectural, not just computational.

Least-to-most prompting, introduced by Zhou et al. (2022), addresses this by explicitly teaching the model to decompose problems before solving them. The name captures the ordering principle: sub-problems are identified and solved from least complex to most complex, with the answers to simpler problems feeding directly into the solutions of harder ones.

The Two-Stage Procedure

Least-to-most prompting follows a two-stage procedure. The key design insight is that decomposition and solution are separate cognitive acts that the model performs better when prompted to do them distinctly.

Stage 1: Decomposition. Given the problem, prompt the model to identify what sub-problems must be solved first. The prompt includes few-shot examples of decompositions, teaching the model to break complex problems into a sequence where each sub-problem is simpler than the original and earlier sub-problems do not depend on later ones. The decomposition step requires no arithmetic, no factual lookup, and no complex reasoning. It requires only structural understanding: what are the logical dependencies in this problem?

Stage 2: Sequential solving. Solve each sub-problem in order, carrying forward the result of each solution as context for the next. By the time the model reaches the final sub-problem, it has already solved all the prerequisites, making the final synthesis straightforward. Each individual solving step handles a problem that fits comfortably within the model's effective reasoning capability, even if the original problem did not.

The reason this works better than chain of thought on long problems is subtle. Chain of thought generates reasoning steps sequentially but does not distinguish between "figuring out what to compute" and "computing it." The model must simultaneously track the problem structure, identify what is needed next, and perform the needed calculation, all within a single forward pass that cannot backtrack. Least-to-most separates these concerns: first understand the structure (stage 1), then execute the steps (stage 2). Each stage has a narrower cognitive demand, and narrow demands are easier to satisfy.

Why Ordering Matters

The ordering principle is critical to the method's effectiveness. Consider a problem like: "John has twice as many apples as Mary. Mary has 5 fewer apples than Tom. Tom has 12 apples. How many apples does John have?"

Tackling this directly asks the model to track multiple relationships simultaneously, reason backward through a chain of dependencies, and synthesize the result. Decomposing it into "How many apples does Mary have?", then "How many apples does John have?" solves the easier sub-problems first and chains the answers naturally. Each sub-problem requires exactly one inference step from facts already established, rather than reasoning simultaneously across all conditions.

The ordering from least to most complex does something else valuable: it prevents the common failure mode where a model attempts to solve a hard sub-problem first, gets confused, and carries that confusion into simpler sub-problems. By solving simpler pieces first, the model builds a foundation of confirmed facts that constrain and guide the harder steps. It is the same principle that drives good mathematical proof strategy: establish the lemmas before proving the theorem.

This ordering also helps with a phenomenon called length generalization. Standard chain of thought prompting tends to fail on problems longer than those seen in the training distribution. When a model trained on 3-step math problems encounters a 10-step problem, performance degrades significantly, often producing answers that are arithmetically consistent but structurally incomplete. The model runs out of effective reasoning capacity before reaching the answer.

Least-to-most prompting provides a structural solution: if you can decompose a 10-step problem into a sequence of 2 to 3 step sub-problems, you apply the model's capability at a familiar complexity level repeatedly, rather than demanding it handle unfamiliar complexity in one shot. The model does not need to "reason longer"; it needs to reason repeatedly at its natural depth.

Zhou et al. demonstrated this concretely on the SCAN benchmark, which requires mapping natural language instructions to action sequences of varying lengths. Standard chain of thought achieved only 16% accuracy on long instructions (length ≥20\geq 20) while least-to-most prompting achieved 99.7%, near-perfect performance. The model was not failing because it could not understand the individual words or grammar; it was failing because 20-step instruction sequences exceeded its effective reasoning span. Decomposition solved this entirely.

Implementation Pattern

The decomposition prompt is the key design decision in least-to-most prompting. A good decomposition prompt should:

  • Show 3 to 5 examples of problems with their decompositions, covering a range of problem structures
  • Demonstrate that sub-problems build on each other, with each one simpler than the original
  • Teach the model to identify blocking dependencies: which facts does the final answer depend on, and which of those facts are themselves derived from other facts?
  • Keep each sub-problem simpler than the original rather than restating part of it

The solution prompt then receives both the original problem and the list of sub-problems, and is prompted to solve them in sequence. Each solved sub-problem is appended to the context before the next one is presented, building up a complete solution step by step. This context-carry mechanism is what makes the stages "sequential" rather than independent: the context grows with each solved sub-problem, so later steps have access to all earlier results.

A common implementation failure is to design decompositions that look good but are no simpler than the original. If the original problem requires 3 inferential steps, splitting it into 3 sub-problems that each require 1 step is a valid decomposition. But splitting it into 2 sub-problems that each require 2 steps provides much less benefit and may confuse the model about what is "already solved."

In[10]:
Code
# Illustrate least-to-most decomposition with a concrete example
# We'll solve a multi-step arithmetic problem using staged decomposition


def solve_with_cot(problem):
    """Simulate chain of thought: attempt direct solution."""
    # Chain of thought tries to solve in one reasoning pass
    # The more steps required, the more likely to fail on complex problems
    return f"CoT: Attempting direct solution to '{problem[:40]}...'"


def solve_with_ltm(problem, decomposition):
    """Simulate least-to-most: solve sub-problems sequentially."""
    context = {"problem": problem}
    results = []
    for i, sub_problem in enumerate(decomposition):
        # Each sub-problem is solved with prior results available as context
        result = f"Sub-problem {i + 1}: {sub_problem}"
        results.append(result)
        context[f"step_{i + 1}"] = result  # carry forward

    return results


# Example: multi-hop arithmetic chain
problem = (
    "A factory produces 240 widgets per hour. "
    "Each widget requires 3 bolts. "
    "Bolts come in boxes of 50. "
    "How many boxes of bolts does the factory use per 8-hour shift?"
)

# Least-to-most decomposition: simplest dependencies first
decomposition = [
    "How many widgets does the factory produce per 8-hour shift?",
    "How many bolts does the factory need per 8-hour shift?",
    "How many boxes of bolts does the factory need per 8-hour shift?",
]

ltm_solution = solve_with_ltm(problem, decomposition)
Out[11]:
Console
Problem: A factory produces 240 widgets per hour. Each widget requires 3 bolts. Bolts come in boxes of 50. How many boxes of bolts does the factory use per 8-hour shift?

Least-to-Most Decomposition:
  Sub-problem 1: How many widgets does the factory produce per 8-hour shift?
  Sub-problem 2: How many bolts does the factory need per 8-hour shift?
  Sub-problem 3: How many boxes of bolts does the factory need per 8-hour shift?

Sequential solution:
  Step 1: 240 widgets/hr x 8 hrs = 1920 widgets per shift
  Step 2: 1920 widgets x 3 bolts/widget = 5760 bolts per shift
  Step 3: 5760 bolts / 50 bolts/box = 115 boxes per shift

The sub-problems build on each other: step 2 uses the result of step 1, and step 3 uses the result of step 2. By the time the model reaches the final answer, the hard work is done. No step requires holding more than one previous result in working memory simultaneously, and each step requires exactly one multiplication or division. A model that struggles to do three sequential arithmetic operations in one pass does each of them reliably in isolation.

Least-to-Most vs. Chain of Thought

It is worth pausing to understand precisely what makes least-to-most different from chain of thought, since they both involve sequential reasoning. Chain of thought generates a single continuous reasoning trace that interleaves problem analysis, decomposition, and computation. The model must reason about what to do and do it in the same cognitive act.

Least-to-most separates these explicitly. The decomposition stage produces a plan: an ordered list of sub-problems. The solution stage executes that plan, one item at a time, with the results of each step in context. This two-phase structure means the model never has to simultaneously figure out what to compute and compute it. Each stage has a single, well-defined objective.

In empirical terms, this distinction matters most when problems have long dependency chains. For short 2-step problems, the methods perform similarly. For long 8 to 10 step problems, least-to-most maintains accuracy while chain of thought degrades significantly. The decomposition stage essentially writes the reasoning plan in advance, freeing the solution stage to focus entirely on execution.