Planning and Multi-Step Reasoning


Planning and Multi-Step Reasoning

Anna
Today we’re looking at three approaches to multi-step reasoning and planning. They all aim to help language models do more than produce a plausible answer in one shot: they need to reason through a task, take actions or use tools, learn from what happens, and decide what to do next.

Michael
We’ll start with Language Agent Tree Search, or LATS, which brings ideas from Monte Carlo tree search into language-model agents. Then we’ll look at SPRINT, which tries to make reasoning faster by running independent work in parallel, and SWiRL, which trains models to take useful reasoning and tool-use steps.

Anna
Let’s begin with LATS. Think about planning a vacation. The model first needs to reason: What’s the budget? What kind of trip is wanted? Then it needs to act, perhaps by searching the web, reading travel blogs, or asking people who have visited. Finally, it needs to use what it learned to revise the plan, consider alternatives, and decide what to investigate next.

Michael
So it’s not just a chain of thoughts leading to an answer. It’s a cycle: reason about what to do, take an action, observe the result, and search among possible next steps. A central challenge is that a model may settle on one plan too early instead of exploring a range of promising paths.

Anna
LATS addresses that by combining language-model reasoning and action with a search tree. The tree represents possible trajectories through a task, and the method uses ideas from reinforcement learning and multi-step planning to decide which paths to explore and which to develop further.

Michael
For a trip to Hawaii, for example, one possible action might be to ask friends who have already been there; another might be to read relevant online discussions. LATS can assign scores to candidate actions, expand a promising one, and then use the result to guide what it explores next. Some actions can be carried out in parallel, too.

Anna
That score is an important distinction from some earlier methods. In Math-Shepherd, a verifier scores reasoning trajectories and guides the search. In LATS, scoring is tied to the outcomes of actions the model takes, and the method also uses observations from the environment and the model’s own reflection on how a trajectory went.

Michael
It also builds on ReAct, which combines reasoning with acting in an environment. LATS adds more explicit planning and search, along with reflection and a way to incorporate interaction feedback into future decisions. The broad intuition is to turn reasoning steps into branches that can be explored rather than following only one fixed route.

Anna
The method has six stages: selection, expansion, evaluation, simulation, backpropagation, and reflection. Let’s make those concrete with a maze. Suppose the model is in a dimly lit room with a left door and a right door, and it needs to reach an exit.

Michael
First is selection: choose a node in the existing tree to expand. LATS uses UCT, or upper confidence bounds applied to trees, to make that choice. After selecting a node, expansion asks the model to generate possible actions from that point.

Anna
In the maze, the model might propose opening the left door, opening the right door, or inspecting the room for clues. Those actions are tried in the environment, and each resulting observation is added to the context. Opening the left door might reveal a dark corridor with paintings; another action could lead to a different observation.

Michael
Next comes evaluation: how promising is each new state? LATS combines two kinds of information. One is an LLM-as-a-Judge score, where a model is asked to estimate from zero to one how promising the action and observation are.

Anna
The other is a self-consistency score. If the model samples many candidate actions and one type appears frequently, that frequency contributes to its score. The example in the lecture was an action sampled 75 percent of the time; that would receive a higher self-consistency score. The two scores are added to give the action a value.

Michael
Then simulation continues from a selected state. In the example, if state A has the highest score, a greedy choice would expand A, sample further actions, and keep going until it reaches success, failure, or the available expansion budget. In the maze, one continuation eventually reveals a clearly marked exit.

Anna
Backpropagation takes the outcome of that trajectory and uses it to update the values of the states along the path. The value update is a running average: combine the old value, weighted by its previous visits, with the trajectory’s return, then divide by the new total number of visits.

Michael
That return might reflect whether the trajectory succeeded or failed. The result is passed backward through the path, so earlier choices can be valued in light of what happened later. This is how a successful or unsuccessful rollout can influence which actions the tree prefers in future searches.

Anna
UCT is what guides selection among nodes, and it balances exploitation with exploration. Its score includes the state value, which favors choices that have already looked good, plus an exploration term. That term is larger for a child that has been visited relatively few times compared with its parent.

Michael
That balance matters because always choosing the current highest-value node could cause the search to miss a less-explored branch that turns out to be better. UCT doesn’t guarantee the optimal choice in every situation; it’s a way, borrowed from the Monte Carlo tree search literature, to balance trying promising paths with investigating less-visited ones.

Anna
After backpropagation, LATS adds a reflection step. The model reviews the trajectory and explains what seemed to lead to success or failure. The paper reports that this reflection helps improve the overall approach, because the model can bring that assessment into later search and planning.

Michael
LATS was evaluated on HotPotQA, which is designed so that answering a question requires retrieving information from at least two Wikipedia pages. That makes it a natural multi-step reasoning task. As the method samples more trajectories, performance improves, and adding reflection provides an additional boost.

Anna
It was also tested on WebShop, where an agent has to fulfill detailed shopping requests. A request might specify a small, portable, folding desk that is already assembled, with a particular color, finish, and price. The reported results showed strong performance without fine-tuning, approaching human experts in the example discussed.

Michael
The strength of LATS is that it brings reasoning, action, and planning together in a modular test-time approach, and it can transfer across different kinds of tasks. The trade-off is cost: repeatedly expanding a tree, executing actions, evaluating states, and reflecting all require additional computation. The paper did not fully analyze those cost benefits.

Anna
There’s also a safety limitation. The method is more difficult to apply when actions are irreversible or consequential. If an agent is about to pay for a service or make a transaction, exploring actions in a live environment could have real consequences.

Michael
A couple of design questions follow. Could other exploration strategies from bandit learning replace UCT? The paper’s contribution is partly to provide a platform on which other optimization approaches can be explored. And if an action repeats within a trajectory, its visit count can inform UCT; the described structure is a tree, rather than a fully connected graph that automatically merges every repeated sequence.

Anna
Now let’s move to SPRINT. The motivation starts with a familiar observation: reasoning models often spend more tokens on harder problems, and longer reasoning can be associated with higher accuracy. But a long response is not necessarily one indivisible chain of thought.

Michael
Some reasoning steps may be independent. A model might try alternative approaches, split a problem into subtasks, or verify earlier work. If two pieces do not depend on each other, making the model generate them one after the other wastes time that could be saved by doing them in parallel.

Anna
SPRINT is a framework for teaching a reasoning model to identify and use those opportunities. It separates a process into a planner, which produces plans, and executors, which carry out the associated work. A plan-and-execution round can be followed by another round, so planning and execution alternate as the solution develops.

Michael
The training data is created by taking reasoning traces from a model such as DeepSeek-R1 and asking another model, such as GPT-4o, to annotate them. It identifies the steps, marks which parts are planning and which are execution, and determines how the steps depend on one another.

Anna
Those dependencies form a directed acyclic graph, or DAG. For example, steps four and two might both depend on step one but not on each other. Once the graph is known, independent steps can be grouped for parallel execution, while dependent steps stay in the appropriate order.

Michael
The annotated traces are then used for supervised fine-tuning. The model learns to output plans and execution steps in a structured format, with tags indicating what is a plan and what is to be executed. At inference time, a system can recognize independent plans and run their executions concurrently.

Anna
The model still generates tokens sequentially. SPRINT doesn’t turn one language model into several simultaneous token generators. Instead, it teaches the model to produce multiple independent plans before waiting for their results, allowing the corresponding tool calls or other execution work to happen at the same time.

Michael
For instance, one plan might involve a calculation and another independent plan might involve a separate calculation. The model can express both, the system can run them in parallel, and then the results are returned to the context for the next round of reasoning.

Anna
That can reduce sequential reasoning time, which matters because long inference is both slow and costly. The training recipe in the lecture generated about six thousand reasoning trajectories for the MATH dataset, kept those with more parallelization, and fine-tuned DeepSeek-R1-Distill-Qwen-7B on the reformatted traces.

Michael
The surprising result was that structuring reasoning for parallelism also improved accuracy, not just speed. The reported SPRINT model had about a three-and-a-half percentage-point accuracy improvement over the 7B baseline, while using fewer sequential tokens; in the comparison discussed, it was more efficient in sequential tokens than a 32B model.

Anna
The gains also generalized beyond the MATH training data. The model showed improvements on tasks including Countdown and GPQA Diamond, despite not being trained on those datasets. The lecture’s interpretation was that learning to structure thinking in parallel may help reasoning more broadly, while also creating opportunities to reduce sequential generation.

Michael
The pattern of parallelism is not necessarily the same throughout a problem. The observations described showed more exploration and parallel work in early stages, followed by convergence toward fewer plans later. Harder problems may require more rounds of planning and execution.

Anna
There are practical limits. Independent tasks may finish at different times, so one slow task can become a straggler. The method can merge very simple execution steps into a larger plan, but load balancing and stage-by-stage optimization remain relevant concerns.

Michael
And the amount of parallelism depends on the task. If a problem has little reasoning to do, there may be little opportunity to save time, and the added planning overhead might not help. The lecture notes that SPRINT’s savings are more apparent on harder problems that require more thinking and contain more parallelizable work.

Anna
If parallel branches produce results that appear to conflict, the final answer still has to be synthesized from the available context. Contradictions can challenge sequential reasoning too; parallelism does not by itself guarantee that the pieces fit together. SPRINT’s model is expected to consider the collected results before producing its final response.

Michael
So SPRINT is principally a training approach for exposing and exploiting independence in reasoning traces. The lecture also points to possible extensions, including reinforcement learning, better use of tools, and implementation work aimed at realizing wall-clock speedups.

Anna
Our third paper is SWiRL, which focuses on training models for multi-step reasoning and tool use. Real tasks such as answering multi-hop questions, solving math problems, planning trips, analyzing data, or working on software projects often require several connected steps and the right tool at the right time.

Michael
Errors can compound across those steps. Training is also tricky if every training action has to call a live tool: tools can be slow or fail, making an already demanding training process more difficult. And many feedback methods focus mainly on whether the final answer is right, rather than whether the intermediate decisions were useful.

Anna
SWiRL aims to teach a model when to reason, when to call a tool, how to formulate a useful tool query, how to maintain accuracy across steps, how to recover from an error, and when to stop and answer. Another design goal is to avoid executing tools during the reinforcement-learning fine-tuning itself.

Michael
The first stage is to create synthetic multi-step data. Given a prompt and access to tools, the model takes one step at a time. At each step, it may reason, make a tool call, or provide a final answer if it is ready.

Anna
After an action, the model is shown the environment’s response along with the original prompt and the previous context. It then chooses what to do next. Repeating this process creates trajectories that can have different numbers of steps, depending on the question.

Michael
An LLM-as-a-Judge then assigns a process reward to each step, using the prior context and the current action. The judge can evaluate whether a proposed search query is appropriate without knowing the search result. For example, asking for the age of a person is a reasonable search query even before seeing the person’s age.

Anna
The tool interactions and their responses are collected during offline data creation, not during the reinforcement-learning fine-tuning. In training, the model sees the prompt and the existing trajectory, proposes its next action, and receives a score for that action. The tool call itself does not have to be executed at that moment.

Michael
That distinction is central: the process reward evaluates the quality of the step the model proposes, while the pre-collected context supplies the earlier tool responses. The lecture describes the learning objective as optimizing the expected reward for each action given the states and actions that came before it.

Anna
The synthetic trajectories can be filtered in different ways. Process filtering keeps trajectories whose individual steps are judged good; outcome filtering keeps trajectories with a correct final answer; and a combined filter requires both. The researchers also compared other choices, such as random selection.

Michael
One notable result was that process-filtered data could train the model better than data kept only because the final answer was correct. The explanation offered is that a correct outcome may come from a trajectory the model already knows how to produce. Good intermediate steps, even in a trajectory with an incorrect final outcome, can still teach useful behavior for solving problems the model could not yet solve.

Anna
At inference time, the model interacts with tools iteratively. A prompt might define a calculator and specify a tag for calculator queries, as well as an answer tag for the final response. The model proposes a calculation, the tool returns its result, and the model uses that result to decide whether to take another step or answer.

Michael
For the experiments described, Gemma-2-27B was used to generate synthetic multi-step data from HotPotQA and GSM8K questions. The resulting collection included about fifty thousand examples, and the researchers compared data selection strategies based on process quality, outcome correctness, both, or random selection.

Anna
The cross-task results are especially interesting. Training on GSM8K with a calculator-style tool improved HotPotQA performance from 65 to 71 percent, even though HotPotQA uses search. Training on HotPotQA with search improved performance on GSM8K from 65 to 73 percent, where the task uses a different tool.

Michael
That suggests SWiRL can teach more than the operation of one specific tool. The model may also be learning a general pattern: break a problem into steps, decide what information or computation is needed, use a tool, and continue from the result.

Anna
The scale of synthetic data mattered, too. When the model was trained on HotPotQA with a search tool, increasing the training data from about 100 examples to 10,000 also improved results on separate math tasks, including MATH and GSM8K. That supports the idea that multi-step behavior can transfer across domains and tools.

Michael
The lecture also reports that process correctness improved after fine-tuning, both on the training domain and on out-of-distribution GSM8K. In other words, the model became better at choosing correct steps, not merely at producing a final answer on the examples it had seen.

Anna
SWiRL was compared with supervised fine-tuning as well. The multi-step reinforcement-learning approach performed better by a substantial amount in the reported comparison. Supervised fine-tuning benefited most from examples that were correct in both process and outcome, which makes sense because it imitates the provided trajectories.

Michael
Reinforcement learning has a different advantage: at each point, the model gets a new chance to choose an action given the prior context, and that action receives a reward. That can let the model improve its decisions rather than simply copying a whole recorded trajectory, including any mistakes in its final outcome.

Anna
Across the three papers, there are three complementary ideas. LATS searches over action trajectories and learns from outcomes and reflection. SPRINT identifies independent reasoning work and teaches a model to expose it for parallel execution. SWiRL trains step-by-step tool use with process feedback while keeping live tool execution out of the reinforcement-learning stage.

Michael
And each highlights a different challenge in making multi-step systems practical: LATS must manage search cost and consequential actions; SPRINT depends on real parallelism and must handle uneven execution times; SWiRL must create useful synthetic trajectories and judge their steps well. Together, they show why planning, tool use, feedback, and efficient execution are all active parts of multi-step reasoning research.

Ask anything
We've read this whole study set, so questions about it get the best answers.