Plan-and-solve prompting: a complete guide
Zero-shot chain-of-thought has a quiet failure mode: you tell a model "Let's think step by step," and it skips a step. Plan-and-Solve (PS) prompting fixes that by splitting the work in two — first make the model write a plan, then make it execute the plan. That one change pushes a zero-shot model up to 91.8% on MultiArith and 59.3% on GSM8K, close to an 8-shot hand-built chain-of-thought, with no examples at all (Wang et al., ACL 2023).
See it work
Here's the slip that motivates the whole technique. Same model, same problem, two prompts.
Problem: A bookstore has 120 books. On Monday it sells 25% of them.
On Tuesday it sells 30 more. On Wednesday a shipment doubles the
stock it has left. How many books does it have now?
Zero-shot-CoT ("Let's think step by step"):
25% of 120 is 30, so 90 books are left.
Wednesday doubles that: 90 × 2 = 180.
The answer is 180.
It dropped Tuesday entirely — a textbook missing-step error. Now the same problem with PS+:
A: Let's first understand the problem, extract the relevant variables
and their numerals, and devise a plan. Then carry out the plan.
Variables: start = 120, Monday sold = 25%, Tuesday sold = 30, Wednesday = ×2 on remainder.
Plan:
1. Monday's sales, then remainder.
2. Subtract Tuesday's 30.
3. Double Wednesday's remainder.
Execution:
1. 25% × 120 = 30 sold → 90 left.
2. 90 − 30 = 60 left.
3. 60 × 2 = 120.
The answer is 120.
The plan forced the model to enumerate all three days before it started calculating, so step two couldn't vanish.
The mental model
Think of a contractor who sketches a blueprint before pouring concrete. The sketch isn't the building — but it's a checklist that makes sure no room gets forgotten. PS prompting makes the model draw the blueprint first.
Standard CoT discovers the steps as it writes. Plan-and-Solve commits to the steps before it writes, so it can't quietly skip one.
The research framing is just as plain: "Let's think step by step" tells the model to reason but not how. PS replaces that vague trigger with an explicit instruction to understand, plan, then execute — mirroring how expert problem-solvers spend more time framing a problem before touching it.
How it works
It runs as a single forward pass — the plan and the execution come out of one inference, not two API calls:
- Understand — restate what's asked, note the givens and constraints.
- Extract variables — pull out the numbers and what they mean (this is the PS+ addition).
- Plan — break the task into ordered subtasks and note their dependencies.
- Execute — work the plan, calculating each intermediate result explicitly.
- Answer — combine results and state the final answer in a parseable form ("The answer is …").
Why it works
The gains aren't magic; they trace to a few specific effects, roughly in order of how much they move the needle.
| Factor | Weight | What it does |
|---|---|---|
| Problem complexity | 35% | Bigger multi-step problems have more steps to drop, so planning helps most there |
| Model capability | 30% | Benefits scale with model size and reasoning ability |
| Instruction specificity | 20% | PS+'s extra "extract variables, watch the arithmetic" lines drive most of its edge over basic PS |
| Problem domain | 15% | Math gains more than commonsense, where the bottleneck is comprehension, not steps |
Two mechanisms do the heavy lifting. Explicit planning identifies every step upfront, so the model is less likely to skip one mid-stream. And explicit variable extraction creates a little bookkeeping ledger, which keeps a bad intermediate calculation from quietly propagating into the final answer.
Where it shines
PS is built for multi-step reasoning where the path is decomposable: arithmetic word problems, algebra, percentage and ratio chains, and any task where later steps depend on earlier results. It also carries over to logical and symbolic tasks (last-letter concatenation, coin-flip state tracking) and to commonsense multi-hop questions.
The headline result from Wang et al. is that PS+ matches few-shot manual CoT without any examples. On arithmetic:
| Dataset | Zero-shot-CoT | PS | PS+ | Manual-CoT (8-shot) |
|---|---|---|---|---|
| MultiArith | 83.8% | 88.0% | 91.8% | 93.3% |
| GSM8K | 56.4% | 58.7% | 59.3% | 60.1% |
| SVAMP | 70.8% | 73.2% | 76.7% | 78.2% |
| AddSub | 83.5% | 87.1% | 88.4% | 89.2% |
| SingleEq | 92.1% | 93.4% | 94.7% | 94.9% |
| AQuA | 43.7% | 45.3% | 46.8% | 48.2% |
On commonsense and symbolic reasoning the pattern holds, and on Last Letters PS+ actually beats the 8-shot baseline:
| Dataset | Zero-shot-CoT | PS+ | Manual-CoT |
|---|---|---|---|
| CommonsenseQA | 65.2% | 71.9% | 74.2% |
| StrategyQA | 63.8% | 65.4% | 68.7% |
| Last Letters | 65.2% | 75.2% | 70.6% |
| Coin Flip | 96.8% | 99.6% | 100.0% |
Across all 10 datasets PS+ beats Zero-shot-CoT by about 2.5% on average (GSM8K alone improves 2.9%), and its average accuracy of 76.7% lands just shy of manual CoT's 77.6% — while needing zero examples.
The error analysis explains which mistakes it fixes. Wang et al. hand-labeled 46 wrong GSM8K answers from Zero-shot-CoT into three buckets, then re-ran with PS+:
| Error type | Zero-shot-CoT | PS+ | Reduction |
|---|---|---|---|
| Calculation errors | 7% | 5% | 28.6% |
| Missing-step errors | 12% | 7% | 41.7% |
| Semantic misunderstanding | 27% | 27% | 0% |
| Total wrong answers | 44 | 39 | 11.4% |
PS+ nearly halves missing-step errors and dents calculation errors, but it does nothing for semantic misunderstanding — the model misreading what the problem asks. That gap is the technique's defining limitation, and it's why semantic errors stay the largest category.
When to use it (and when not)
Reach for PS when the problem is multi-step with clear sequential structure, calculation accuracy matters, you have no examples to spend on few-shot, and you've seen Zero-shot-CoT drop steps.
Skip it when the task is a single-step lookup or classification, when it's creative or open-ended (rigid planning gets in the way), or when the real bottleneck is comprehension rather than missing steps — PS won't help there.
Cheap upgrade. PS+ adds only about 30 prompt tokens over basic PS (~50 → ~80) and bumps latency 15–30%. Because it ships no examples, total token cost stays below few-shot CoT despite the longer trigger. There's no one-time setup cost — no examples to curate, no optimization to run.
Model fit. PS leans on instruction following and multi-step reasoning, so it scales with capability. Treat 7B as a rough floor where results get inconsistent; 70B-class or GPT-3.5-and-up is a safer recommendation, and GPT-4 / Claude-class models give the cleanest plans. Smaller open-source models are hit-or-miss — some regress relative to plain Zero-shot-CoT, so test before you commit.
When PS isn't enough, escalate:
| Condition | Try instead |
|---|---|
| PS+ accuracy stays under 60% | Few-shot CoT with curated examples |
| Semantic errors dominate | Role prompting or context enrichment |
| Latency is critical | Simpler Zero-shot-CoT |
| Complex multi-turn or tool use | ReAct or agent frameworks |
| Very complex compositional problems | Least-to-Most or Tree of Thoughts |
And pick the variant to match the job:
| Variant | Best for |
|---|---|
| Basic PS | Quick deployment, token-constrained settings |
| PS+ | Mathematical, calculation-heavy tasks |
| PS + self-consistency | High-stakes decisions needing reliability |
| PS + verification | Applications needing auditability |
The prompt
There are three triggers, escalating from terse to thorough. The problem goes after Q:, the trigger after A:.
Basic PS:
Let's first understand the problem and devise a plan to solve the problem.
Then, let's carry out the plan and solve the problem step by step.
PS+ (adds variable extraction and calculation attention):
Let's first understand the problem, extract relevant variables and their
corresponding numerals, and devise a plan. Then, let's carry out the plan,
calculate intermediate results (pay attention to calculation and commonsense),
solve the problem step by step, and show the answer.
Minimal (token-constrained):
Let's devise a plan and solve the problem step by step.
The difference between basic and PS+ is the whole game: "extract relevant variables and their corresponding numerals" plus "pay attention to calculation and commonsense" are the two clauses that buy the accuracy bump. For a domain, swap in domain-specific language — physics gets "extract variables, their values, and their units… pay attention to unit consistency"; finance gets "extract financial variables (prices, rates, periods)… pay attention to percentage calculations."
Building it
The core is two functions: build the prompt, then parse the answer out of the response.
import re
TRIGGERS = {
"basic": "Let's first understand the problem and devise a plan to solve the "
"problem. Then, let's carry out the plan and solve the problem step by step.",
"ps+": "Let's first understand the problem, extract relevant variables and their "
"corresponding numerals, and devise a plan. Then, let's carry out the plan, "
"calculate intermediate results (pay attention to calculation and "
"commonsense), solve the problem step by step, and show the answer.",
"minimal": "Let's devise a plan and solve the problem step by step.",
}
def construct_ps_prompt(problem: str, variant: str = "ps+") -> str:
return f"Q: {problem}\n\nA: {TRIGGERS[variant]}"
def extract_answer(response: str):
for pattern in (r"[Tt]he answer is[:\s]*([^\.\n]+)", r"####\s*([^\n]+)"):
m = re.search(pattern, response)
if m:
return m.group(1).strip()
return None
Wiring that to a model is a thin wrapper. Keep the temperature low — planning wants consistency, not creativity.
import anthropic
client = anthropic.Anthropic()
def ps_solve(problem: str, variant: str = "ps+") -> str:
message = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
messages=[{"role": "user", "content": construct_ps_prompt(problem, variant)}],
)
return message.content[0].text
For high-stakes answers, wrap PS in self-consistency: sample several times and take the majority vote. This is how you prove a noisy answer is actually stable.
from collections import Counter
def ps_with_consistency(problem: str, n_samples: int = 5):
answers = [a for a in (extract_answer(ps_solve(problem)) for _ in range(n_samples)) if a]
return Counter(answers).most_common(1)[0][0] if answers else None
Configuration
| Parameter | Recommended | Why |
|---|---|---|
| Temperature | 0 – 0.3 | Low values keep reasoning consistent (use 0.3+ only for self-consistency diversity) |
| Max tokens | 512 – 1024 | Room for the full plan plus execution |
| Top-p | 0.95 | Slightly constrained sampling |
| Stop sequences | none | Let the model finish naturally |
Rough token budget: minimal triggers run ~40 prompt tokens, basic PS ~60, PS+ ~90, with 100–300 tokens of reasoning on top (150–400 for PS+).
Do and don't
- Do use PS+ for calculation-heavy tasks, keep temperature low, allow enough tokens for a complete response, and parse-then-validate the extracted answer.
- Don't use it on single-step problems, don't expect it to fix semantic misreads, don't run high temperature (it undermines the planning), and don't truncate mid-reasoning.
When it misbehaves
| Symptom | Likely cause | Fix |
|---|---|---|
| Different answers each run | Temperature too high | Set temperature to 0, or use self-consistency |
| Plan or execution cut off | max_tokens too low | Raise the limit |
| Arithmetic mistakes | Basic PS without calculation attention | Switch to PS+; for hard math, hand off to a calculator/code tool |
| Answer not extractable | Missing answer marker | Add an explicit "show the answer" instruction or broaden the regex |
| Wrong despite a clean plan | Semantic misunderstanding | Add a rephrasing step or domain context — planning alone won't help |
Limitations
Three of these are fundamental, not tuning problems:
- Semantic misunderstanding is untouched. If the model misreads the question, no amount of planning saves it — error analysis shows semantic errors flat at 27% with both Zero-shot-CoT and PS+.
- Planning can't supply missing knowledge. If the model doesn't know the formula, a plan to use it doesn't help.
- It amplifies, it doesn't create. PS surfaces reasoning a model already has; a model that can't reason won't suddenly reason because you asked for a plan.
Follow-up work like DUP (Zheng et al., 2024) targets exactly that semantic-understanding gap, pushing the model to deeply understand the problem before planning — a complementary attack on the one error category PS leaves untouched.
Beyond those, watch the edges: ambiguous problems get planned for one interpretation without flagging the others; circular dependencies between steps can stall planning; and very large numbers degrade arithmetic accuracy regardless of structure.
Advanced and adjacent
A few extensions earn their keep without changing the core idea. Adding an explicit verification phase ("after finding an answer, recheck the calculations and that the answer satisfies all constraints") catches arithmetic slips. Structured output — asking for distinct Understanding / Variables / Plan / Execution / Answer sections, or JSON — makes responses trivially parseable for pipelines. And self-consistency (above) trades tokens for reliability on high-stakes calls.
PS has also seeded a small family of techniques. Self-Planning adapts plan-before-execute to code generation; MSG (Multi-Stage Guided) extends it to multi-phase code planning; QDMR-based variants pair PS with question-decomposition representations. LangChain ships a Plan-and-Execute agent built directly on PS principles, and the official reference implementation lives at the AGI-Edgerunners/Plan-and-Solve-Prompting repository.
How it relates to the neighbors
| Technique | Relationship | Key difference |
|---|---|---|
| Zero-shot-CoT (Kojima et al., 2022) | Direct predecessor | PS adds explicit planning |
| Few-shot CoT (Wei et al., 2022) | Stronger but example-hungry | PS needs no examples |
| Auto-CoT (Zhang et al., 2022) | Automates example selection | PS skips examples entirely |
| Least-to-Most (Zhou et al., 2022) | Similar decomposition | L2M decomposes the question; PS decomposes the solution |
| DECOMP | Related decomposition | Uses a separate decomposition model |
| Tree of Thoughts | Extended search | Explores multiple plan branches |
A compact head-to-head:
| Aspect | PS | Zero-shot-CoT | Few-shot CoT | Least-to-Most |
|---|---|---|---|---|
| Examples needed | No | No | Yes (3–8) | Yes (few) |
| Planning phase | Explicit | Implicit | Implicit | Explicit |
| Missing-step errors | Low | High | Low | Low |
| Setup effort | None | None | High | Medium |
| Best for | Multi-step math | General reasoning | Domain-specific | Compositional problems |
PS combines naturally with other methods too — self-consistency for reliability, RAG for knowledge-intensive tasks (plan-guided retrieval), tool use (the plan incorporates tool calls), and verification passes.
Future directions
The open questions are about granularity and transfer: what level of plan detail maximizes accuracy without overhead, whether triggers tuned for one domain transfer to another, and how to measure plan quality separately from execution quality. Active threads include automated trigger optimization (learning the best PS phrasing per domain), hierarchical planning where high-level steps contain sub-plans, multi-agent PS that splits planning and execution across models, and how plan-then-execute interacts with native reasoning models like the o1/o3 line.
The headline, in one line. A single trigger-phrase swap — plan before you solve — took zero-shot GPT-3.5-class reasoning to 91.8% on MultiArith and an average 76.7% across ten benchmarks, within a point of 8-shot hand-built chain-of-thought (Wang et al., ACL 2023). No examples, no fine-tuning, just better instructions.
Summary
- Plan-and-Solve splits reasoning into plan-then-execute, replacing "Let's think step by step" with an explicit instruction to understand, plan, then carry out the plan.
- PS+ adds variable extraction and calculation attention — those two clauses are what close most of the gap to few-shot CoT.
- It mainly kills missing-step and calculation errors (missing steps down 41.7%, calculation down 28.6% on GSM8K) but does nothing for semantic misunderstanding.
- It matches 8-shot manual CoT with zero examples — 91.8% MultiArith, 59.3% GSM8K, 76.7% average across ten datasets (Wang et al., ACL 2023).
- Use it for multi-step, calculation-heavy, example-free problems; skip it for single-step, creative, or comprehension-bound tasks.
- Keep temperature low, allow room for the full plan, parse the answer explicitly, and escalate to self-consistency, few-shot, or Tree of Thoughts when PS plateaus.
Read Next
Start reading to get personalized recommendations
Explore Unread
Great job! You've read all available articles