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.
- Decomposition stage: the prompt shows examples of problems broken into ordered subquestions, then asks the model to decompose the new problem the same way.
- 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.
- 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.
| Stage | Input to the model | Output from the model |
|---|---|---|
| Decomposition | Decomposition examples plus the new problem | Ordered list of subquestions |
| Solving, first step | Solving examples, problem, first subquestion | Answer to the first subquestion |
| Solving, later steps | All prior question-answer pairs plus next subquestion | Answer building on earlier results |
| Final step | Full transcript plus the original question | Final answer to the whole problem |
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.
Comparison with related prompting techniques
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.
| Technique | How it structures reasoning | Main difference |
|---|---|---|
| Least-to-most prompting | Explicit subquestion list, solved in order | Separate planning stage, answers reused |
| Chain-of-thought | One continuous reasoning trace | No explicit decomposition stage |
| Self-ask prompting | Model asks and answers follow-up questions inline | Decomposition interleaved with answering |
| Plan-and-solve prompting | Zero-shot plan followed by execution | No few-shot decomposition examples |
| Decomposed prompting | Subtasks routed to specialized handlers | Modular, can call tools or other prompts |
| Tree of thoughts | Branching search over partial solutions | Explores alternatives instead of one path |
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.
| Situation | Recommended approach | Reason |
|---|---|---|
| Multi-step word problems with dependencies | Least-to-most prompting | Each quantity builds on the previous one |
| Compositional commands or symbolic rules | Least-to-most prompting | Decomposition scales to longer inputs |
| Short factual or single-step questions | Direct or zero-shot prompt | Decomposition adds cost without benefit |
| Problems with many plausible solution paths | Tree of thoughts or self-consistency | Search or voting handles ambiguity better |
| Tasks needing external data or tools | Decomposed prompting or an agent loop | Subtasks can call retrieval or code |
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.
| Symptom | Likely cause | Remedy |
|---|---|---|
| Wrong final answer despite correct steps | Missing or misordered subquestion | Add examples showing complete plans |
| Error repeated in every later step | Early answer was wrong and reused | Verify intermediate answers before continuing |
| Excessive cost and latency | Too many fine-grained subquestions | Cap plan length, merge trivial steps |
| Plans that do not transfer | Examples from an unrelated domain | Use domain-specific decomposition examples |
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.