Least-to-most prompting

On this page 7

Least-to-most prompting is a Prompting technique in which a language model first decomposes a complex problem into simpler subproblems and then solves them sequentially, feeding each answer into the next step. The method, introduced in 2022 research on reasoning in artificial intelligence, targets a specific weakness of chain-of-thought prompting: generalizing to problems harder than the examples shown in the prompt.

The name describes the order of work. The model starts with the least difficult subquestion and builds toward the most difficult one, so every later step can rely on facts already established. This easy-to-hard generalization makes the technique useful for multi-step math, symbolic manipulation and compositional instructions.

How least-to-most prompting works

Least-to-most prompting runs in two distinct stages, each guided by its own few-shot examples. The first stage produces a plan of subquestions; the second answers them one by one while the growing transcript stays in the context window.

  1. Decomposition stage: the prompt shows examples of problems broken into ordered subquestions, then asks the model to decompose the new problem the same way.
  2. Sequential solving stage: the model receives the original problem and the first subquestion, answers it, and the question-answer pair is appended to the prompt.
  3. Iteration: each following subquestion is posed with all earlier answers visible, until the final subquestion, which is the original question itself.

The key mechanism is explicit answer reuse. Because the solved subproblems sit in the prompt as text, the model does not need to hold intermediate results implicitly, which reduces errors on long dependency chains.

The table below summarizes what each stage consumes and produces in a typical implementation.

StageInput to the modelOutput from the model
DecompositionDecomposition examples plus the new problemOrdered list of subquestions
Solving, first stepSolving examples, problem, first subquestionAnswer to the first subquestion
Solving, later stepsAll prior question-answer pairs plus next subquestionAnswer building on earlier results
Final stepFull transcript plus the original questionFinal answer to the whole problem
Inputs and outputs of the two stages

Why decomposition improves generalization

Standard few-shot and chain-of-thought prompts teach the model by demonstration, but the model tends to imitate the length and shape of the examples. When a test problem requires more steps than any example, accuracy often drops sharply.

Least-to-most prompting separates planning from execution. The decomposition examples teach a reusable pattern of breaking problems down, and that pattern can be applied recursively to longer inputs. In the original experiments on the SCAN compositional benchmark, the technique reached accuracy above 99 percent with only a handful of examples, where chain-of-thought prompting remained far lower.

Gains on everyday tasks are more modest. On grade-school math word problems, improvements over chain-of-thought were reported mainly for problems requiring many reasoning steps, while short problems showed little difference. Results also depend strongly on the model: newer reasoning models plan internally and benefit less from explicit decomposition.

Several prompting methods also break reasoning into parts, but they differ in who plans, when planning happens and how answers flow. The table contrasts least-to-most prompting with its closest neighbors.

TechniqueHow it structures reasoningMain difference
Least-to-most promptingExplicit subquestion list, solved in orderSeparate planning stage, answers reused
Chain-of-thoughtOne continuous reasoning traceNo explicit decomposition stage
Self-ask promptingModel asks and answers follow-up questions inlineDecomposition interleaved with answering
Plan-and-solve promptingZero-shot plan followed by executionNo few-shot decomposition examples
Decomposed promptingSubtasks routed to specialized handlersModular, can call tools or other prompts
Tree of thoughtsBranching search over partial solutionsExplores alternatives instead of one path
Least-to-most prompting and neighboring techniques

In short, least-to-most prompting is a linear, ordered decomposition. It does not search alternatives like tree of thoughts or vote across samples like self-consistency, although it can be combined with both.

When to use least-to-most prompting

The technique pays off when a problem has a natural compositional structure and later steps depend on earlier results. It adds latency and token cost, so it is not a default for every request.

SituationRecommended approachReason
Multi-step word problems with dependenciesLeast-to-most promptingEach quantity builds on the previous one
Compositional commands or symbolic rulesLeast-to-most promptingDecomposition scales to longer inputs
Short factual or single-step questionsDirect or zero-shot promptDecomposition adds cost without benefit
Problems with many plausible solution pathsTree of thoughts or self-consistencySearch or voting handles ambiguity better
Tasks needing external data or toolsDecomposed prompting or an agent loopSubtasks can call retrieval or code
Decision guide for choosing the technique

Implementation follows a few practical rules. Keep decomposition examples close to the target domain, limit plans to a manageable number of subquestions, and run each solving step as a separate API call when intermediate answers need validation or logging.

Limitations and failure modes

The method is only as good as its plan. A flawed decomposition propagates through every later step, because the solving stage trusts the subquestions it receives.

SymptomLikely causeRemedy
Wrong final answer despite correct stepsMissing or misordered subquestionAdd examples showing complete plans
Error repeated in every later stepEarly answer was wrong and reusedVerify intermediate answers before continuing
Excessive cost and latencyToo many fine-grained subquestionsCap plan length, merge trivial steps
Plans that do not transferExamples from an unrelated domainUse domain-specific decomposition examples
Typical failures and how to address them

Some problems resist clean decomposition altogether, such as tasks requiring holistic judgment or creative writing. In those cases the technique adds structure without accuracy, and simpler prompting is the better choice.

In everyday language

Least-to-most prompting asks an AI system to work like a good teacher. First, it lists the smaller questions behind a hard one. Then it answers them one at a time. It starts with the easiest.

Each small answer is written down. The next step uses it. This is like building a staircase one step at a time. The main benefit is reliability on long problems, because the system never has to juggle everything in its head at once.

Seen in the real world

A logistics company uses a language model to answer planners’ questions such as how many trucks are needed next week when three warehouses ship different volumes with different load limits. A single prompt often skips a warehouse or mixes up capacities, so the team switches to least-to-most prompting with two decomposition examples from its own shipping data.

The model now plans four subquestions: the volume per warehouse, the truck capacity for each route, the trucks needed per warehouse, and the total. Each answer is checked by a small script before the next call. In an internal test of 200 historical questions, the share of correct totals rose from about 70 percent to above 90 percent, at roughly three times the token cost, which the planners accepted because a wrong truck count is far more expensive.