Plan-and-Solve Agents: Plan First, Then Work Through the Steps

Plan-and-Solve Agents: Plan First, Then Work Through the Steps

Plan-and-solve agents take a simple idea and turn it into a reliable habit: before solving a problem, make a plan. Instead of asking a language model to think step by step and hoping it does not skip anything, plan-and-solve prompting asks the model first to understand the problem and devise a plan, and then to carry out the plan one sub-task at a time. That two-phase structure is the whole technique, and it fixes some of the most common failures of plain step-by-step reasoning.

The approach was introduced in a 2023 paper by Lei Wang and colleagues, “Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Models”, published at ACL 2023. The paper showed that zero-shot chain-of-thought, the familiar “let’s think step by step” prompt, suffers from missing-step errors, calculation errors and semantic misunderstanding errors. Plan-and-solve was designed to address the first two, and its experiments showed it consistently outperforming zero-shot chain-of-thought across ten datasets.

Key takeaways

  • Plan-and-solve prompting has two phases: devise a plan that divides the task into smaller sub-tasks, then carry out the sub-tasks according to the plan.
  • It is a zero-shot technique: no examples are needed, only a structured instruction that replaces “let’s think step by step”.
  • The paper identified three failure modes in zero-shot chain-of-thought: missing steps, calculation errors and semantic misunderstanding.
  • An extended variant, PS+, adds more detailed instructions to reduce calculation errors as well.
  • In the paper’s experiments on GPT-3, plan-and-solve consistently beat zero-shot chain-of-thought and matched few-shot chain-of-thought on maths reasoning.

What Plan-and-Solve Is

Chain-of-thought prompting asks a model to generate reasoning steps before answering, and it works well when the model is shown examples. Zero-shot chain-of-thought removes the examples and relies on a single trigger phrase, “let’s think step by step”. That is convenient, but the paper’s error analysis found that it fails in predictable ways. On a sample of 46 GSM8K maths problems answered incorrectly by zero-shot chain-of-thought, 12% of the errors were missing steps, 7% were calculation errors, and 27% were semantic misunderstandings.

Missing-step errors are the target of plan-and-solve. When a model reasons without a plan, it can jump from the problem to an answer while quietly skipping a step in the middle. The reasoning looks complete, but a sub-task was never performed. Plan-and-solve prevents that by forcing the model to list the sub-tasks before it starts solving. The plan becomes a checklist, and the solving phase works through it in order.

The basic prompt replaces the generic trigger with a structured instruction: “let’s first understand the problem and devise a plan to solve the problem. Then, let’s carry out the plan to solve the problem step by step.” That is the whole technique at its simplest. There are no examples to write, no fine-tuning, and no extra tools. The model does the planning and the solving itself, in one generation, guided only by the instruction. Our article on agent planning strategies puts this prompting technique alongside the wider planning approaches agents use.

How the Two Phases Work

The planning phase is where the model reads the problem, identifies what is being asked, and breaks the task into smaller sub-tasks. A good plan names each sub-task explicitly and in order, so the solving phase has something concrete to follow. For a maths word problem, the plan might be: identify the quantities given, work out the rate per unit, multiply by the number of units, and then subtract the discount. Each of those is a sub-task with a clear output.

The solving phase then carries out the sub-tasks according to the plan. The model works through them one by one, and because the plan is already written, each step has a defined purpose. If a step’s result looks wrong, the plan makes it easier to see which sub-task failed, because the reasoning is organised around the plan’s structure rather than a free-flowing chain of thoughts.

That structure is the difference between plan-and-solve and plain step-by-step reasoning. In zero-shot chain-of-thought, the model generates reasoning steps as it goes, and there is no advance commitment to what the steps will be. In plan-and-solve, the plan is a commitment made before solving begins, and the solving phase is accountable to it. The commitment is what prevents the skipped step.

Plan-and-Solve Plus (PS+)

The basic version targets missing-step errors. The paper extends it with PS+, which adds more detailed instructions designed to address calculation errors and improve the quality of the generated reasoning steps. PS+ keeps the same two-phase structure but asks the model to be more careful and explicit in the solving phase, for example by stating intermediate results clearly before using them in the next step.

The distinction matters in practice. If your agent’s failures are mostly skipped steps, the basic version is enough. If the agent also makes arithmetic slips or produces vague reasoning that is hard to check, the more detailed instructions of PS+ are worth using. The cost is a longer prompt and a longer output, which is a small price for problems where accuracy matters.

From Prompting Technique to Agent Pattern

Plan-and-solve began as a prompting technique, but the same two-phase structure scales into an agent pattern. In an agent, the planning phase can be a dedicated step that produces a plan as structured data, and the solving phase can be a loop that executes each sub-task, possibly with tools. That is the plan-and-execute architecture that many agent frameworks implement, and plan-and-solve is its prompting ancestor.

The agent version adds something the prompting version does not have: feedback between phases. A plan-and-execute agent can replan when a sub-task fails or when new information changes the situation. The pure prompting version cannot, because the plan and the solution are generated in a single pass. That makes the agent version more robust for long or uncertain tasks, and the prompting version more suitable for self-contained reasoning problems where the plan can be trusted once written.

Understanding that distinction helps you choose the right tool. For a single reasoning problem, such as a maths question or a logic puzzle, plan-and-solve prompting is enough and costs nothing to set up. For a task that spans tools, data sources and an unpredictable environment, you want an agent that can plan, execute and replan, which is a larger design decision. Our guide to agent design patterns that hold up in production covers how to make that choice.

Numbered sticky notes from one to six arranged in a column on a glass wall
Plan first, then solve: the numbered steps keep the work in order.

Where Plan-and-Solve Works Best

The paper evaluated plan-and-solve on ten datasets across three reasoning problems, using GPT-3. The results showed that the zero-shot approach consistently outperformed zero-shot chain-of-thought across all datasets by a large margin, was comparable to or exceeded zero-shot program-of-thought prompting, and had comparable performance with eight-shot chain-of-thought prompting on the maths reasoning problem. Matching an eight-example few-shot method with a zero-shot prompt is a striking result, and it is the reason the technique is widely cited.

Multi-step maths and logic problems are the natural home for plan-and-solve. These are tasks where the steps are known in advance once the problem is understood, and where skipping a step is the main risk. A plan that lists the steps makes the risk visible and manageable. The technique also helps with tasks that combine several kinds of reasoning, because the plan can assign each kind to its own sub-task rather than mixing them in one undifferentiated chain.

It also works well as a default prompt for agents that solve problems without tools. An agent that answers analytical questions, drafts structured documents, or works through a decision can benefit from planning first, even when no tool is involved. The plan improves the answer and gives the user something to inspect: a plan that is wrong is easier to spot and correct than a chain of reasoning that wanders.

Where It Falls Short

Plan-and-solve does not fix semantic misunderstanding, the largest error category in the paper’s analysis at 27%. If the model misunderstands the problem, it will write a plan for the wrong problem and solve it carefully and incorrectly. Planning cannot rescue a model that has misread the task. That failure mode needs different remedies, such as clarifying the question, retrieving relevant context, or asking the user for more detail.

The technique also assumes the plan can be written before solving begins. For tasks where the steps depend on intermediate results, a plan written up front will be wrong in the same way a ReWOO plan can be wrong. Exploratory tasks, tasks with hidden information, and tasks where the environment changes as you work all need an interleaved approach instead, where planning and execution take turns.

Finally, a plan is only as good as the model’s ability to follow it. A model can write a sensible plan and then ignore it in the solving phase, drifting back into free-form reasoning. That happens more often with smaller or weaker models, and it is worth checking: read the output and confirm that the solving phase actually follows the plan’s steps in order. If it does not, a stronger model or a more explicit instruction to follow the plan is the fix.

Approach How it works Strengths Weaknesses
Zero-shot chain-of-thought “Let’s think step by step”, then reason freely Simple, no examples needed Skips steps, calculation errors, no plan
Plan-and-solve (PS) Plan first, then solve step by step Prevents missing steps, zero-shot Cannot fix misunderstanding, plan can go stale
Plan-and-solve plus (PS+) PS with more detailed solving instructions Also reduces calculation errors Longer prompts and outputs
Plan-and-execute agents Plan as data, execute with tools, replan on failure Handles tools and changing environments More complex to build and debug

Checklist: Using Plan-and-Solve Well

  • Replace “let’s think step by step” with the two-phase instruction: understand, plan, then solve step by step.
  • Check that the plan lists sub-tasks explicitly and in order before any solving begins.
  • Use PS+ when calculation errors or vague reasoning are a problem, not just missing steps.
  • Verify that the solving phase follows the plan’s steps in order, and correct the model when it drifts.
  • Do not use plan-and-solve for exploratory tasks where the steps depend on unknown intermediate results.
  • For tasks with tools or changing environments, move to a plan-and-execute agent that can replan.
  • When the model misunderstands the problem, fix the understanding first; no plan can rescue a wrong reading.
  • Keep the plan visible to the user when the answer matters, so a wrong plan can be spotted and corrected.

Frequently Asked Questions

Is plan-and-solve the same as chain-of-thought?

No. Chain-of-thought generates reasoning steps as it goes, with no advance plan. Plan-and-solve adds a planning phase first, so the model commits to a list of sub-tasks before solving. That commitment is what prevents skipped steps.

Do I need examples to use plan-and-solve?

No. It is a zero-shot technique. The structured instruction replaces “let’s think step by step”, and no example demonstrations are needed. That is one of its main advantages over few-shot chain-of-thought.

What is the difference between PS and PS+?

PS is the basic two-phase prompt, aimed mainly at missing-step errors. PS+ adds more detailed instructions to the solving phase, aimed at calculation errors and the overall quality of the reasoning steps.

Can plan-and-solve be used in agents?

Yes. The two-phase structure scales into the plan-and-execute agent pattern, where the plan is produced as structured data and each sub-task is executed, possibly with tools, with replanning when something fails.

What kind of tasks benefit most?

Multi-step maths, logic and analytical problems where the steps are known once the problem is understood, and where skipping a step is the main risk. The paper evaluated it on ten datasets across three reasoning problems with strong results.

What does plan-and-solve not fix?

Semantic misunderstanding, which was the largest error category in the paper’s analysis. If the model misreads the problem, it will plan and solve the wrong problem. It also cannot adapt a plan to new information mid-task, which needs an agent that can replan.

Latest articles

Scroll to Top