YouTube transcript (Ml_fp9XkB8Y) — Transcript
Full transcript
- 0:05So today's lecture is going to be about
- 0:08planning and multi-step reasoning. Um so
- 0:11today's lecture we are going to cover
- 0:14three papers on multi-step reasoning and
- 0:17planning let's start with this paper um
- 0:21from
- 0:23uh ICML of last year. So the title uh of
- 0:28the paper is language agent tree
- 0:31research unifies reasoning acting and
- 0:34planning in uh language models. So the
- 0:40kind of the target the types of
- 0:42applications that we want to target in
- 0:44multi-step task are tasks that we uh
- 0:48need not only need to reason about
- 0:50things but also need to act through
- 0:52those reasoning steps and um kind of
- 0:55search our trajectories or optimize
- 0:58trajectories on how we get to a final
- 1:00correct answer. So in the reasoning
- 1:03step, the model needs to think about
- 1:06what needs to be done. For example, what
- 1:09the budget is, where where the plan is.
- 1:11This these are the reasoning steps for a
- 1:13trip or vacation planning prompt. The
- 1:17act is okay. Now that you have
- 1:21certain types of reasoning or thinking,
- 1:24how do you kind of gather more
- 1:26information or act on these reasoning
- 1:28steps? For example, the action could be
- 1:30a browsing uh browsing the web,
- 1:33generating a query to search uh readits
- 1:37Reddit or a travel blog and so so on.
- 1:41And then another step is search um
- 1:45given these feedback or the information
- 1:47that's uh gathered online um how can we
- 1:52refine our uh our plan so far? Maybe we
- 1:56can consider alternative destinations
- 1:59uh search new things to do while we are
- 2:01there and so on. So there were a a
- 2:04series of reasoning action and search
- 2:07steps that needs to be done to solve
- 2:09this problem of for example planning a
- 2:12trip. So the problem um or the challenge
- 2:15that this paper specifically wanted to
- 2:18address was the following. Um
- 2:23the goal here was let's go from the LLM
- 2:26generate a plan and like executing on on
- 2:30that plan to really try to encourage
- 2:32diversification and exploration of
- 2:36different types of uh plans or path that
- 2:39the model can take. uh because models
- 2:42and this is true still to this day that
- 2:44they can be
- 2:46weak in creating a diversity of
- 2:49solutions or acting upon them and um
- 2:52planning multiple steps of optimization
- 2:55to reach a solution. Um so this paper
- 2:59focused on bringing known techniques
- 3:01from reinforcement learning and multi-
- 3:05kind of multi-step planning that existed
- 3:07in the past um including multi-step uh
- 3:10Monte Carlo research into the LLM
- 3:13reasoning path. Um and given that the
- 3:18models can uh take feedback in it also
- 3:22introduce ways for the model to take
- 3:24different feedback as the model explores
- 3:27with the the environment and bring that
- 3:29back in in order to f refine and
- 3:32optimize future uh plans and search
- 3:35processes.
- 3:39So
- 3:41just a quick kind of example of how uh
- 3:45how this worked. Uh for example the the
- 3:48prompt is to plan a trip to Hawaii.
- 3:51There are different ways and different
- 3:52actions that the model can take. Um so
- 3:57it can for example the if we sample the
- 4:01model for this prompt the model might
- 4:05decide that uh we might consider asking
- 4:08friends that already went to Hawaii or
- 4:11read subreddits uh related to that. And
- 4:14then this this uh framework introduce a
- 4:17mechanism for getting a score for each
- 4:20of these actions. Um and then kind of
- 4:24update the search space or the
- 4:26trajectory of follow-up kind of
- 4:28expansion of this tree that is being
- 4:30formed based on that score. So in this
- 4:33case and we talked about how these
- 4:35scores are generated in this case action
- 4:38one has a higher score. So we expand
- 4:40that action. So the model expands that
- 4:43action. Um so in this case ask two
- 4:46friends uh about uh friend A and friend
- 4:49B about opinions and then based on the
- 4:52quality of responses there's score for
- 4:54that and we can follow on from from uh
- 4:58the model can expand from there. So
- 5:01there is a there's a flavor of
- 5:03multi-action sampling. In this case, the
- 5:06actions can be in fact ex be executed in
- 5:09parallel like these two actions or these
- 5:11two actions. They both can be executed
- 5:14in parallel. And there's this notion of
- 5:17like let's do continue exploration based
- 5:20on the best state but also consider
- 5:24a a mix of exploration and exploitation.
- 5:27And that's where the MCTS comes in.
- 5:32Um so there are two kind of papers that
- 5:37uh this paper was basically saying how
- 5:39it diverges from those. Math sheepard is
- 5:42a paper that we saw previously and in
- 5:45that paper there was a verifier that was
- 5:48guiding the search process uh in the
- 5:51test time. Basically um the the
- 5:54reasoning kind of trajectories are
- 5:56scored by this verifier and then um the
- 6:00the the expansion is uh guided by that.
- 6:04But in lats which is this paper that we
- 6:06are going to uh learn more about in this
- 6:10lecture uh the scoring is not based on
- 6:13reasoning choices but it's based on the
- 6:15outcomes of the actions that the model
- 6:18takes. uh and also there is this part
- 6:21about reflection of the model to kind of
- 6:24evaluate how this trajectory went uh and
- 6:28um also about the observations from the
- 6:30environment. Um it also improves based
- 6:34on previous uh methods uh uh frameworks
- 6:38and reasoning such as the React work. um
- 6:43where um basically in React uh
- 6:50there there is this extra step of we're
- 6:52going to see how this works but there is
- 6:54this extra step of kind of memorization
- 6:56and again reflection and then
- 6:58interaction with the environment that we
- 7:00have in the lats uh p paper and
- 7:04specifically we have more and more
- 7:07planning in into the process
- 7:11So um here is uh the intuition
- 7:15[clears throat] uh behind lats. Uh there
- 7:18is the chain of thought uh where the
- 7:22reasoning process is basically
- 7:23decomposed into a number of steps. There
- 7:26is this notion of tree expansion. Um
- 7:30basically through this type types of
- 7:33actionings that action uh generation
- 7:36that we have we have a tree that we form
- 7:38a tree and we do search and planning
- 7:40through that and then we have this kind
- 7:43of like borrowed that from the react
- 7:45framework where uh the feedback from
- 7:48these actions are incorporated into into
- 7:51this search process for the future
- 7:54search search and so on.
- 7:57So this method concretely has six types
- 8:02of kind of uh
- 8:06uh stages.
- 8:08Selection, expansion, evaluation,
- 8:11simulation, back propagation and
- 8:13reflection. So let's see exactly how
- 8:15this method works. Um and let's walk
- 8:17through an example an example prompt. So
- 8:20in this case, the prompt is um navigate
- 8:24through a maze to reach an exit. Um and
- 8:27then the initial observation is that
- 8:30you're in a dimly lit room. There are
- 8:32two doors, one on the left and one on
- 8:34the right. And the goal is to reach an
- 8:36exit in this case. So let's see how
- 8:39these different steps of lats uh come
- 8:42into play. So first is the selection
- 8:46process. In this stage, we need to
- 8:48select a node to expand. Let's say we
- 8:50have done that. We see exactly how
- 8:52that's done. Uh but given a node, we
- 8:56want to see what kind of actions we can
- 8:59given that we have selected a node and
- 9:01this is based on UTC. We're going to see
- 9:03it in a bit. We want to see what kind of
- 9:05actions that we can take from that node.
- 9:08So in this case our initialized node is
- 9:13uh this thing you're in a dimly lit room
- 9:15and so on. Now let's say the model
- 9:18samples different actions here. In this
- 9:21case three actions are sampled. One is
- 9:24open the left door, open the right door
- 9:26and the third one is inspect the room
- 9:28for clues. Then the next step is each of
- 9:31these actions are executed in the
- 9:33environment and the observation is kind
- 9:36of basically appended to uh to the
- 9:39context. So in this case say if the
- 9:43action is open the left room the
- 9:45observation is dark corridor with
- 9:47paintings. Action B is open the right
- 9:50there's another observation and so on
- 9:51for action C.
- 9:54Now uh comes the evaluation. So let's
- 9:57say we have an action. We have executed
- 10:00an action. We want to evaluate our new
- 10:03state that we are going into. For this
- 10:06part um they suggest averaging for
- 10:10creating a score based on the current uh
- 10:14kind of action and observation. They
- 10:16suggest adding up two scores together.
- 10:19One is using an LM score basically
- 10:23prompting using LLM as a judge and
- 10:25prompting the model for the for
- 10:28evaluating how promising this state is
- 10:31and literally asking it to give a score
- 10:33based on 0 to one for this state and the
- 10:37other one is the self-consistency score
- 10:40and that is let's assume instead of
- 10:42three actions here we had sampled
- 10:45uh 50 times
- 10:48um we had sampled called 50 actions and
- 10:50we categorize them into different types
- 10:52of actions. And if an action is sampled
- 10:54more, we kind of give a score like we
- 10:58give a score corresponding to the the
- 11:01rate or the frequency of an action being
- 11:03sampled. So in this case, the
- 11:05self-consistency
- 11:07score for state A was higher because 75%
- 11:11of the time maybe the action A was um uh
- 11:15sampled. So the way to create just one
- 11:18value for this state for this action is
- 11:20to add up these two. So now we have a
- 11:23value for for action A corresponding to
- 11:26to to state SA.
- 11:30Um and then we have the simulation part.
- 11:34For example in a greedy method we from
- 11:37the previous stage we have SA having the
- 11:39highest score. SB and S SC have much
- 11:43lower scores. So we we go and expand SA
- 11:47all the way again we can continue this
- 11:50process we sample more uh from SA and we
- 11:53continue expansions until we reach an
- 11:56end state or or whether it's successful
- 11:59or it fails or until we reach a a maxim
- 12:03the budget that we have for expansion of
- 12:06this state. So um in this case from
- 12:09state SA um so this was SA and then we
- 12:14have um the candidate actions that start
- 12:16from that state and then in this case
- 12:19it's greedy it takes one approach one
- 12:22action approach the staircase um and
- 12:26then we reach an observation
- 12:29uh which we are lucky in this case we
- 12:32have the exit door clearly marked we we
- 12:34got a point here.
- 12:37Um and then let's say the simulation is
- 12:43done. We either have an successful
- 12:45trajectory or it's a failure. Um uh then
- 12:48we can we the important part here is how
- 12:52do we use this observation to kind of
- 12:54backrop and update the scores that we
- 12:57had for different actions that were
- 12:59taken. So this is the backrop stage and
- 13:02then that is used to influence the score
- 13:05of each each state um and uh and we're
- 13:10going to talk about it in a bit. Okay,
- 13:11let's talk about how these value
- 13:13function and back propagation is used.
- 13:16So for the value function we already saw
- 13:18that that is a weighted average of
- 13:21asking an LLM as a judge given this
- 13:23observation this action how do you have
- 13:26what are the chances of success give us
- 13:28a score between 0 to one and then
- 13:30there's the self-consistency which
- 13:31basically we just count how many times a
- 13:35given action is sample
- 13:38then there is the notion of UCT or upper
- 13:42confidence bounds applied to trees
- 13:44that's something that this is the the
- 13:46the basically the number or score that
- 13:50is used for selection because we have at
- 13:53each point we have a range of like
- 13:55values that we want to see which node we
- 13:58go and expand. So the way UCT works and
- 14:01this is like completely borrowed from
- 14:04the MCTS kind of literature. Uh
- 14:08the way it's designed is to try to
- 14:10balance between exploration and
- 14:12exploitation. If we just go based on the
- 14:15highest value at that point, we might
- 14:17miss out other nodes that right now
- 14:20maybe at the current moment have a lower
- 14:22uh value but down the road at the end
- 14:25might have higher value. So let's
- 14:27balance the the two of them. So the way
- 14:29UCT works is that it has this
- 14:31exploitation
- 14:33uh one which is V of S plus a
- 14:36hyperparameter times this other term
- 14:39which encourages exploration. And the
- 14:42way this work here is that the np is the
- 14:45parent the number of times a parent of a
- 14:47node is visited and ns is the number of
- 14:50the nodes that this current node is not
- 14:52the parent but the current node is
- 14:54visited. And basically think about it
- 14:56this way relative to the parent node. If
- 14:59a node is visited less we want to
- 15:02encourage visiting that node more. And
- 15:05if that node relative to the parent is
- 15:07in is visited um a high a large number
- 15:10of times then this number this uh
- 15:13division this becomes a smaller number
- 15:15and UCT becomes
- 15:18uh lower relative to unexplored kind of
- 15:22children of a parent node. So um UCT
- 15:27again is the number that we use for
- 15:29expans for selection of a node and going
- 15:31from there. Now back propagation and
- 15:34that's where we go at the end of an a
- 15:37trajectory either we succeed or fail the
- 15:40return of that trajectory is used to
- 15:43update the values and this is like back
- 15:45propagated through the the steps. So at
- 15:48each point the value of an of a state is
- 15:51the value of the old state times the
- 15:54number of v visits to that to that node
- 15:58uh minus one plus the return divided by
- 16:01the total number of visits to that node.
- 16:02So that's that's how the math behind
- 16:05this um framework. Yes.
- 16:08UCP
- 16:11one
- 16:13long
- 16:15take a long
- 16:19>> it's it's just something there's some
- 16:21math and theoretical intuitions behind
- 16:23it. There's no proof that this is the
- 16:26optimal round but you want to just
- 16:28balance the two in that like this is
- 16:31considered a more optimized way of doing
- 16:33things. Oh.
- 16:37>> Yes. Yes. Um
- 16:43so once back propagation is done uh they
- 16:47also they also append this reflection of
- 16:51the model itself about the uh the
- 16:54trajectory that was expanded. If it
- 16:56fails or if it succeeds, the model adds
- 16:58some thinking behind what happened, what
- 17:02led to the failure or the success of
- 17:05this trajectory. And this apparently has
- 17:07been very helpful in overall increasing
- 17:09the quality of this approach.
- 17:13Um so they tested this approach on
- 17:16hotspot QA which is some data set that
- 17:19we still uh uh we use it for multi-step
- 17:22reasoning optimization. Basically the
- 17:25way this data set works is that for each
- 17:28question for answering them you need
- 17:30retrieval from at least two like
- 17:32different Wikipedia pages um because
- 17:35it's just designed like that. So you
- 17:37need this multi-step by design kind of
- 17:40process in order to find an answer and
- 17:43um obvious and they're doing really well
- 17:46like just look in in terms of like as
- 17:48they increase the number of samples or
- 17:51the number of trajectories that they
- 17:53sample they can significantly improve
- 17:56performance.
- 17:58um and the the the reflection and
- 18:01bringing those kind of reasoning traces
- 18:04also gives a lot of boosts at the end to
- 18:06the model. So basically they have
- 18:08provided a mechanism to um translate
- 18:11more compute at test time effectively to
- 18:15better kind of uh solutions for this
- 18:17multi-step reasoning tasks. Um they also
- 18:20tested that on webshaw which is this
- 18:22interesting um data set uh for practical
- 18:27app applications.
- 18:29Um
- 18:31there are um this is like just to show
- 18:35you an example how this data set works.
- 18:37For example, there is I'm looking for a
- 18:39small portable hoarding desk that's
- 18:41already fully assembled. It should have
- 18:43a this color and this finish and so on
- 18:46and the prices. So it's by design it's a
- 18:49very multi-step pro it's a multi-step
- 18:52process and um they're showing that
- 18:54their approach without any kind of
- 18:56fine-tuning and just at test time they
- 18:59can get really high results even close
- 19:02to human um experts in this case. Uh
- 19:09so to summarize what LZ proposed was a
- 19:13new technique for kind of bringing in
- 19:15reasoning uh taking actions and planning
- 19:18all together and kind of brought in our
- 19:21known ideas like MCTS into the into the
- 19:24language model world. um and they got
- 19:28very strong results on multiple domains
- 19:31and um given the test time approach and
- 19:35the modular approach it's very portable
- 19:37and easy to uh relatively easy to
- 19:41create. The downside of course is the
- 19:43cost. um
- 19:46um each of these kind of like back
- 19:48propagation and like expansion of a tree
- 19:51all of those are adding a lot of cost
- 19:53and um they like um the cost benefits
- 19:58was not really analyzed in the paper.
- 20:00Another assumption that this is not this
- 20:02paper didn't address was really that um
- 20:07there are scenarios where taking an
- 20:08action may be reversible. So there are
- 20:11that's going to be challenging like how
- 20:12do we adapt uh to those scenarios right
- 20:15if like for example the model is running
- 20:18a transaction like if if it actually
- 20:20takes those actions it could be very
- 20:22consequential like paying for a service
- 20:24and so on. So so that is another uh
- 20:27scenario where u this approach might not
- 20:31be um adaptable to. So here there are a
- 20:36few questions about this paper that I
- 20:39really would like you to think about it
- 20:41maybe for a couple minutes and then we
- 20:43discuss uh anything related to where you
- 20:46see the strengths or weaknesses of this
- 20:48paper or if you were to adapt it or
- 20:52extend it how do you how would you do
- 20:53that?
- 20:55So let's start doing that and I'll get
- 20:57back to you in a couple of minutes.
- 21:03All right, let's get back. Anyone wants
- 21:05to comment on on this fork?
- 21:10>> So the UCT method, it's basically like
- 21:13confidence found like from like bandit
- 21:15learning setting, right? There's other
- 21:17algorithms for like picking like in
- 21:19bandit learning like picking and
- 21:21exploring various arms. Did they try
- 21:24like different ones in this paper?
- 21:26>> Okay, the question you think is one way
- 21:28to create this exploration.
- 21:30There are a lot of literature. know that
- 21:33whether they compared.
- 21:35>> Yeah.
- 21:35>> Um no and there is that whole literature
- 21:40multi-arm bandit and other ways that we
- 21:42can uh bring in exploration exploitation
- 21:45into the optimization process and all of
- 21:47that could be like also explored here.
- 21:50They just like I think their main
- 21:52contribution is that created a platform
- 21:55that now can others can bring in other
- 21:57approaches to optimization.
- 22:01Yeah. Anything else?
- 22:05Questions or comments?
- 22:11Okay, let's move on to the next paper.
- 22:17>> Yes, go ahead. Um so if we were to keep
- 22:20track of um the action trajectory based
- 22:23with the Monte Carlo tree search what if
- 22:26there were times when there's like
- 22:27repeated actions like action A B A B if
- 22:30or or like um when the same action is
- 22:34seen in multiple nodes uh is there any
- 22:37way to optimize this tree or does this
- 22:39tree recognize all of these repeated
- 22:42actions as uh independent trajectories?
- 22:49Um so the question is if if a series of
- 22:51actions are repeated how do you so so
- 22:55the whole the philosophy behind this is
- 22:57that if an action is repeated in inside
- 23:00a trajectory
- 23:02um given a parent node you would count
- 23:05you would increase the count of that
- 23:07action and that comes in in the UCT
- 23:10formulation right so to ideally you
- 23:14would capture that in that as you are
- 23:16forming this tree and ideally this is a
- 23:19tree that you're forming not like some
- 23:21kind of like fully connected graph. So
- 23:24this is kind of the assumption behind
- 23:25behind this. Yes.
- 23:29So let's uh now talk about spring. This
- 23:32is a new 2025 paper. So this hasn't been
- 23:35even presented here at the conference.
- 23:38Uh uh so the the this paper is about
- 23:42again it gives you a flavor of um this
- 23:46kind of like planning and parallel
- 23:48execution of those plans and how we can
- 23:51kind of use the model itself to enable
- 23:54it to think better in parallel and uh we
- 23:57can opt and optimize that. So the paper
- 24:01this paper sprint was motivated by this
- 24:04observation that the reasoning models
- 24:07such as 01 Gemini think Gemini 2.5 Pro
- 24:11and um pretty much all the frontier
- 24:14models right now they um they have this
- 24:18tendency that for harder problems they
- 24:20think more and this long longer thinking
- 24:24corresponds to higher accuracy. So we
- 24:26kind of like these models to think for
- 24:28longer and longer kind of like chain of
- 24:31thoughts. Uh for example, these two
- 24:33graphs here show that the deepseek R1
- 24:36during the training process as the
- 24:39training process continues uh obviously
- 24:42it becomes better at solving this ammy
- 24:44these math problems but also if we take
- 24:48a look at the average length per
- 24:50response that is also going up. So it
- 24:52seems like there is a correlation
- 24:54between model thinking for longer and a
- 24:56larger sum of to number of tokens and
- 24:58the accuracy that we get from that.
- 25:02Now um again so the observation here was
- 25:05that many uh like these long reasoning
- 25:09steps are helpful but at the same time
- 25:12many of these reasoning steps seem to be
- 25:14independent of each other. Um
- 25:19for example the model tries alternative
- 25:21approaches. It deco composes a task into
- 25:24subtasks that some of them can be run in
- 25:26parallel. Um and then some of these
- 25:29steps are verifying the previous steps.
- 25:31So but there is a lot of if you look
- 25:33into the graph that describes a uh kind
- 25:37of the reasoning trace um there are
- 25:40parts of these computations that are
- 25:42independent of of each other. So we
- 25:44don't need to really wait for all of
- 25:47these steps to be to be kind of created
- 25:50sequentially by the model. So we want to
- 25:53see how we can leverage this parallelism
- 25:56observation. And uh so the idea is we
- 25:59want the model identify this
- 26:02parallelization opportunities and kind
- 26:04of act on it. So sprint sprint is a
- 26:08framework that um does come in during
- 26:12the post- training and or fine-tuning
- 26:14process and what it does is that it
- 26:17takes a reasoning model and enables the
- 26:20reasoning model to execute the uh like
- 26:24the response generation via a um planner
- 26:28and a planner that creates a set of
- 26:32plans for how to approach solving a
- 26:35problem and a set of executors
- 26:38and those executors can be run in
- 26:40parallel in order to ex like carry out
- 26:44the plan and this can happen again and
- 26:46again. We can have the next one we can
- 26:49have a plan a bunch of um kind of uh
- 26:54execution plans that are carried out in
- 26:56parallel and then we can have another
- 26:58set of plans and then another set of
- 27:00parallel uh executions. uh so this inter
- 27:05uh the interleing of this planning and
- 27:08execution is what it can enable
- 27:10acceleration of the reasoning process.
- 27:13So let's say how we can enable that how
- 27:16we can enable the model to create these
- 27:18parallel kind of traces.
- 27:21Um and this is a this is something that
- 27:23I want you to kind of think about it
- 27:25beyond just this paper and you're seeing
- 27:27it in the following work that we are
- 27:29talking about. uh a lot of times when we
- 27:31want to show to kind of uh create data
- 27:36and figure out a certain behavior in the
- 27:39model we can use the LLMs itself in in
- 27:42the syn like the fine-tuning data
- 27:44creation process and here is an example
- 27:47of that of that given a reasoning model
- 27:50uh models response trajectory to a
- 27:53question to a qu to a question we can
- 27:57decompose it in the number of steps we
- 27:59and LLM. So in this case for example we
- 28:02had D6 R1 generate these reasoning
- 28:05traces and responses to these questions
- 28:08and then we had a model like GPT40 going
- 28:11through this reasoning trace and create
- 28:14this annotate the steps of the reasoning
- 28:17the reasoning response and not only that
- 28:20for each of these steps we ask the GPT40
- 28:25to annotate whether this is which part
- 28:28is the planning part and which part is
- 28:30the execution part and in some steps
- 28:34there were multiple execution pieces for
- 28:37a given plan.
- 28:39Um so for example we had this query we
- 28:43had the reasoning traits and then there
- 28:45are a bunch of things that needs to be
- 28:47done and then when the reasoning uh
- 28:49stops there's a final answer answer then
- 28:53we use GPT40 to go through this process
- 28:56and kind of like create these steps one
- 28:592 and k basically now we have these
- 29:02annotations and within each step the
- 29:05model also uh kind of annotates the plan
- 29:08and the execution. Which part is the
- 29:10planning part? Which part is the
- 29:12execution of that plan?
- 29:15Given that then we can create a DAG of
- 29:18these uh steps. So we have step one,
- 29:22step two and all the way. And we can
- 29:25again use the model and the model does a
- 29:27really good job here of saying whether
- 29:30how these steps are related to each
- 29:32other. For example, step four and two
- 29:34are not dependent on each other, but
- 29:36they both depend on step one is a
- 29:38follow-up to a step one. So now we have
- 29:40like a DAG of um an optimiz and
- 29:44basically creating a DAG that um
- 29:48describes how this reasoning trace
- 29:50works. Um and then we can do packing of
- 29:54these steps. For example, step one can
- 29:57be done first and step two and three can
- 29:59be done completely in parallel with each
- 30:01other and so on. Um and
- 30:05once we have these data set um that we
- 30:10have annotated then LRM here is just a
- 30:13large reasoning model. Basically all uh
- 30:16LLMs are now inherently reasoning
- 30:18models. So what we are uh creating here
- 30:21is this data set of the steps plan and
- 30:24executions in parallel and we basically
- 30:27fine-tune the model the for example deep
- 30:30R1 to now think in that way. So
- 30:34previously would just create those um
- 30:39inherently have these properties but now
- 30:42we want the model to think more and more
- 30:44in parallel by showing these parallel
- 30:46like planning and execution traces and
- 30:49we just fine-tune the model in this case
- 30:50just the supervised finetuning of
- 30:53basically showing the model the same the
- 30:56same stuff the same thinking processes
- 30:58but now annotated with these tags
- 31:01um
- 31:03And this helps the model that at
- 31:05inference time now the model can out uh
- 31:08can output these tags. For example, here
- 31:11is plan one and then here are the
- 31:14execution um patterns for this and here
- 31:18is plan two and so on. So for example
- 31:20for pan I there is a set of thinking and
- 31:23the parallel execution that the model
- 31:25just outputs itself and then we can uh
- 31:29kind of go over executing these plans in
- 31:32parallel and then syncing the output and
- 31:35returning the context and then the model
- 31:38goes through plan I + 1 and then there's
- 31:41a part of there's a number of parallel
- 31:44um kind of sub plans within that that
- 31:46the model can uh uh output and we can go
- 31:50from there.
- 31:52Uh why this matters? Um
- 31:56so the cost of LLM inference especially
- 32:00when we get to multi-step reasoning
- 32:02becomes a huge burden. Um and you might
- 32:05have already noticed that yourself when
- 32:07you spend a lot of time waiting for the
- 32:09model to output a response. It gets
- 32:13um it might get uh it might make you
- 32:16kind of like not happy. you want the
- 32:18answers fast but also it's a lot of cost
- 32:20and a lot of delay that goes into
- 32:22generating these responses. So right now
- 32:25here is how the sequential reasoning
- 32:27models work. So there's a query, there's
- 32:30a plan and then execution of that plan.
- 32:33There's plan two, execution of plan two
- 32:35and so on. So this is the time that it
- 32:37takes to generate or like go over this
- 32:41thinking process and generate a final
- 32:43answer. But if we could kind of leverage
- 32:47this independence from um plan one and
- 32:51plan two, we could have the model
- 32:55um execute we could have the execution
- 32:58of those plans be done um at the same
- 33:03time. Here is what after we fine-tune
- 33:05with the spring at inference time
- 33:07happens. So instead of model generating
- 33:09plan one and executing that then
- 33:12generating plan two, model generates
- 33:14these two plans first plan one and two
- 33:17and then and then and then it starts
- 33:20executing the execution of those plans
- 33:23happen at the same time and then the
- 33:25execution could be using a tool. For
- 33:27example, the model is come up with a
- 33:29calculation and then we can use this
- 33:31calculator or Python to execute plan one
- 33:34and plan two and so on and then go to
- 33:37the next step next stage and the
- 33:40fine-tuning data. Again, this is another
- 33:43visualization of how given these
- 33:46annotations that we have for plans and
- 33:48execution, we create the fine-tuning
- 33:50data. So we are basically asking the
- 33:52model to think in parallel if the plans
- 33:56are independent of each other. We are
- 33:58basically teaching the model to come up
- 34:00with plan one and two at the same time
- 34:02because they're independent of each
- 34:03other and we execute them. Yes.
- 34:06>> So if there's a need for ref planning,
- 34:10how does the model remember which plans
- 34:12corresponding to which executions and
- 34:15like all of those things, right? Like at
- 34:18like later in the stage, right? Like if
- 34:20like after the execution of four
- 34:23>> the one who realizes that oh what I did
- 34:25was wrong. How does it remember to like
- 34:28do a refining of like go to the plan of
- 34:30three instead of like two you know
- 34:35>> uh how
- 34:37so this this work I I think you are kind
- 34:40of like bringing the previous work in
- 34:42here like here the model can so what we
- 34:44are teaching the model here is that to
- 34:47think about plans at each point of time
- 34:51even if it's a like a revision of an
- 34:53existing plan if it can generate plans.
- 34:57If it if it can generate plans that can
- 35:00be uh executed in parallel, it should do
- 35:03so. It should not wait for the execution
- 35:06of plan one to generate plan two because
- 35:09plan two has is independent of plan one
- 35:12anyway. Right? So this is how we are
- 35:14creating this data set for training the
- 35:18model to teaching it to think maximally
- 35:20in parallel and generate those plans. If
- 35:23the model wants to go back and reverse
- 35:25on a plan, it still can do that. It
- 35:27still sees all of these kind of context.
- 35:30It's just like the model is trained to
- 35:32think more in parallel and also because
- 35:35it's trained to be like that. And we
- 35:36have these special kind of tags or ways
- 35:39of the model generating these plans and
- 35:42execution plans we can act on it and
- 35:44enable leverage those parallelism.
- 35:48Yes.
- 35:50actually change the structure of this
- 35:52outline because before you just need to
- 35:54predict the next token but now you see
- 35:56you have three parallel uh lines
- 35:59>> it's always next token it's just that
- 36:02there is like instead of like everything
- 36:04the plan and execution one at a time if
- 36:07there's a tag like here this is plan I
- 36:11and here are the the execution and here
- 36:14is plan two plan I and I + one for
- 36:17example here's plan one and PL plus two.
- 36:19This is the high level count. And then
- 36:21now that we know that there are these
- 36:23two plans, we can just grandchild and
- 36:25run them in parallel. So that's that's
- 36:27the idea here. Um
- 36:30so here is the training recipe starting
- 36:33from so we generate 6K thinking
- 36:36trajectories for math data set. um
- 36:41we keep the ones with higher
- 36:42parallelization
- 36:45and we do supervised fine-tuning on um
- 36:49deepse R1 distill 7B on this reformatted
- 36:54trajectories and the interesting
- 36:56property that we observed was that uh so
- 37:00when we started the project the goal was
- 37:03to maximize parallelism for reducing the
- 37:07the sequential
- 37:09token generation. So we save on that.
- 37:11But it turns out this process actually
- 37:13helps out with accuracy as well. Like
- 37:15the model seems to like this kind of
- 37:17more structured way of thinking and this
- 37:21uh way of encouraging parallelism helps
- 37:24the model have higher accuracy as well.
- 37:27And here what we are showing that is the
- 37:29average number of sequence sequential
- 37:31tokens over the baseline model like R1
- 37:34distill 7B and this the sprint model
- 37:37again is distilling R1 this basically
- 37:40there we are fine-tuning the 7B model
- 37:43and there's a big jump like a 3 and a
- 37:46half% jump over that um while also
- 37:50becoming more much more efficient than a
- 37:5332B model in terms of um number of
- 37:56sequential tokens
- 37:58>> might increase by more authentics for
- 38:04more approaches given the fixed computer
- 38:08because it
- 38:08>> it could be yeah there is and we have
- 38:11some data on that which I believe I'm
- 38:13going to show yeah the model does
- 38:15explore more and think in parallel
- 38:19more and the another interesting
- 38:21observation was that um
- 38:26we have out of domain generalization as
- 38:30well. So the thinking to train to like
- 38:35sorry training to think in parallel was
- 38:37done for the math data set but we also
- 38:40saw the model is doing better not only
- 38:44have lower have more opportunities for
- 38:46this parallelism but also higher
- 38:48accuracy for um for example uh countdown
- 38:52or GPQA diamond data set. So there is no
- 38:56training like we have not trained on
- 38:58those data set but the model generalizes
- 39:00and this like could go back to what
- 39:02you're suggesting that the model can
- 39:03think in parallel and that inherently
- 39:07seems to help the model but at a as a
- 39:09side effect um we also have
- 39:12opportunities for leveraging this
- 39:14parallelism parallelism and reducing the
- 39:16number of sequential tokens. Could there
- 39:20be a scenario where [clears throat]
- 39:22individually uh the answers are correct
- 39:24in the final uh you know in the parallel
- 39:27branches but when you combine it say in
- 39:29a sequential manner the answer may be
- 39:32wrong and in that case what will take
- 39:34precedence
- 39:35>> and in that case what
- 39:37>> what will take precedence because
- 39:39sometimes given in a mathematical
- 39:40equation individually when you look at
- 39:43them in isolation the answer might look
- 39:45seemingly correct but when you put them
- 39:47and put all the steps together the
- 39:49answer will be eventually.
- 39:51>> Yeah. So, so when we when the model
- 39:56generates the no matter if it generates
- 39:58sequentially or in parallel there at the
- 40:01end of the day everything is condensed
- 40:04into the context. So the model sees that
- 40:06and this is the thinking process. The
- 40:09answer after this the model should
- 40:11generate a synthesize a final answer. So
- 40:14if there are con contradictions in the
- 40:16sequential or in parallel the model is
- 40:19expected to resolve that before
- 40:21generating a final answer. So in that
- 40:24case it's it's a little difficult to say
- 40:26because both both approaches can be uh
- 40:29can can suffer from kind of
- 40:31contradictions in the thinking. But here
- 40:33we are what we are seeing is more that a
- 40:36like these plans are kind of like
- 40:39they're rather than being different
- 40:40approaches to solve the same problem
- 40:42they're like different steps to to solve
- 40:46uh one problem. Um so uh parallel the
- 40:50another interesting observation was that
- 40:54um
- 40:55and perhaps intuitive some that harder
- 40:58problems require more uh iterative
- 41:01planning and execution. Uh the other
- 41:04observation this was like maybe less
- 41:06intuitive was that in the early stages
- 41:10like so we have a bunch of these
- 41:11parallel planning execution parallel
- 41:14planning execution in the early stages
- 41:16the parallelism
- 41:18more parallelism or more exploration is
- 41:21observed by the model and then in the
- 41:23later stages uh we kind of converge to
- 41:27maybe uh to to um less plans Um
- 41:35yeah basically the exploration is is
- 41:37more in the early stages and towards the
- 41:39end we want to like really go dive deep
- 41:42into a single plan and execution. Yes.
- 41:45>> Um how can you ensure that the
- 41:47independent reasoning tasks um are
- 41:49evenly load balanced uh and do not
- 41:51encounter bottlenecks like do
- 41:54independent tasks for example like have
- 41:57similar expected execution times? Like
- 42:00here you're saying that how do we make
- 42:02sure
- 42:03>> right so so when we divide independent
- 42:06um tasks how do we ensure that these are
- 42:09going to be executed about similar
- 42:11times.
- 42:13>> So uh so the question is how do we
- 42:15ensure that these independent plans that
- 42:17are now run at the same time they're
- 42:19they're uh they they have they take
- 42:22similar times. But the thing is we can
- 42:24is we can ensure that right we we have
- 42:27uh there are some kind of measures taken
- 42:29to enable that but we still could have a
- 42:31straggler like maybe step two versus
- 42:34four here step four may take a lot
- 42:35longer than step two but at the same
- 42:38time we are kind of confined to just
- 42:41step four not step four plus step two
- 42:44runtime. Um and we have some some
- 42:47measures. For example, if the the plan
- 42:50um if the execution is just too simple,
- 42:53we kind of merge that into the plan and
- 42:55try to create these bigger and bigger
- 42:57chunks that we can we can do in
- 42:59parallel. But that could be an
- 43:01optimization as well. The the optim
- 43:05optimizing this across the stages
- 43:10analysis for reasoning function.
- 43:12>> I'm not sure. I'm not sure if there
- 43:15analysis exactly on that. Um question.
- 43:19>> Yes. Could you go back to the slide? So
- 43:22uh I saw on the math and GDPA the uh
- 43:26spring it has comparable accuracy and
- 43:28number of tokens as the baseline R. So
- 43:31I'm curious like for those uh benchmarks
- 43:35what is the main uh width of the tree
- 43:39and what's the maximum width?
- 43:44>> Um
- 43:45>> in terms of like cuz the width of the
- 43:47tree like determines how much
- 43:49parallelism you can exploit.
- 43:52So you're get what you're getting at is
- 43:54that with the it's task dependent
- 43:57basically [clears throat] the
- 43:58parallelism that we can exploit and for
- 44:00some of these if the if we can the
- 44:03basically if the ratio of the sequential
- 44:05tokens is uh like for one task like for
- 44:09example I believe for math it's like
- 44:12lower than for GPQ do domain um then yes
- 44:16that's an indication of parallelism like
- 44:19some task could be inherently more
- 44:20parallel than the
- 44:22And I don't know the exact number of the
- 44:24width of the tree here but that to to be
- 44:27able to leverage this approach uh
- 44:29parallelism should exist and it's but
- 44:32but what we observed is that that is the
- 44:34case for many of the reasoning problems
- 44:36like math and other kind of reasoning
- 44:38tasking GPQA and so on. Um and some of
- 44:42these are um
- 44:45again like for example if you look at
- 44:47this uh for the math data set uh
- 44:50compared to um
- 44:54some of these methods with like even
- 44:56lower but like comparable accuracy we
- 44:59increasing the uh the bandwidth or um
- 45:02then reducing the number of sequent
- 45:04token by something like 40% which is
- 45:08like a long large number Um
- 45:12but um it is true that this is going to
- 45:15be task dependent.
- 45:18Um and maybe getting back to your
- 45:20questions um we have larger savings for
- 45:25problems that need more thinking. So uh
- 45:29for example here we are showing the
- 45:30sequential token reduction by spring
- 45:33over the baseline just sorry over the uh
- 45:37RFD model. This is the rejection
- 45:39fine-tuning methods. So this is another
- 45:41baseline that uh this is a baseline we
- 45:44are comparing with. If the num the the
- 45:48number of tokens in generated like in
- 45:50the thinking process is small then there
- 45:54is probably less opportunity for
- 45:56parallelism right so by doing this like
- 45:59oh let's plan and execute we are
- 46:01actually we can be worse than the
- 46:04baseline but this appears in the harder
- 46:07problems and problems that require more
- 46:10thinking and more number of parallel
- 46:12tokens and that's where this method
- 46:14shines and shows parallelism. Um, I'm
- 46:17not sure how how many of you have read
- 46:19the recent uh sonnet 4.5
- 46:22system card, but it was very interesting
- 46:25to me that it says the prompt for for
- 46:27the system card um encourages the model
- 46:30to use tools as much as possible and at
- 46:33least 100 times. That's a very large
- 46:36number that we the model is encouraged
- 46:39to use the tool. And this is like just
- 46:42shows that for we are going into this
- 46:46regime that we are solving more and more
- 46:47interesting problems and we are actually
- 46:49go going more and way beyond 8 to 10k
- 46:51even for the number of tokens that the
- 46:54model deals with for solving a problem.
- 46:59Um yes
- 47:06data set diagram on all your
- 47:09>> uh fine chain process
- 47:13uh I think one
- 47:14>> yeah doing inference does it um produce
- 47:17the entire um like step one to step k
- 47:22the entire thing but different layers or
- 47:24does it do a sequential
- 47:25>> no during inference um it kind just like
- 47:28this. So the model learns to generate
- 47:31plans that can be executed in parallel
- 47:35at the same time. So it first generates
- 47:37plan one and two, plan one and two and
- 47:40then once plan one um like is outputed
- 47:44execution of plan one starts. One plan
- 47:47once plan two is outputed execution of
- 47:49plan two starts then the result is uh
- 47:52put back in the context and then the
- 47:55model is generating two two more plans.
- 47:58So the model still takes this sequential
- 48:00approach to generating plans and
- 48:02execution but with the difference is
- 48:05that if it kind of learns or is trained
- 48:08to at each point of time if there are
- 48:10plans that are can be gener can be
- 48:13executed in parallel it generates those
- 48:15at the same time. So here would be
- 48:18generates uh after step one it generates
- 48:20step two and four at the same time and
- 48:22then you see the results for that and
- 48:24then and then so on and it continues.
- 48:31So each step, think about it, each step
- 48:33is a plan and a set of executions in the
- 48:36training.
- 48:42>> But the step here is defined as plan one
- 48:45and except one. And then it it kind of
- 48:47we changed the notion of
- 48:51um
- 48:52>> do they also match this um like uh so so
- 48:55let's say they execute two plan that
- 48:58like um that can be paralyzed and then
- 49:00they collect the context and then add it
- 49:03to the prompt for the next uh level. So
- 49:06they also do that in the training phase
- 49:09as well to match like how they are
- 49:11prompting it. The training is shown
- 49:14here. This is how the training data will
- 49:16look like.
- 49:17>> So plan one and two are independent. So
- 49:20plan one and two are put together like
- 49:23next to each other. And then we have
- 49:24execution one and two during training.
- 49:26So that's how the model sees
- 49:30um during training that platum one and
- 49:33two could could be outputed together.
- 49:36But at inference the execution is
- 49:38actually also done in parallel.
- 49:42Okay, let's move on to the last paper
- 49:45because I want to make sure we cover
- 49:47that. But just before that opportunity,
- 49:50so here the the work that supervised
- 49:52fine-tuning, but of course methods like
- 49:54RL and GRPO can enable potentially much
- 49:58more kind of benefit from this data and
- 50:01much more kind of this generalization
- 50:03property usually works well with RL. um
- 50:09um and and other other kind of notions
- 50:13about tool use overlapping different
- 50:15tools or like doing um actually
- 50:18realizing the wall clock speedups is
- 50:20other work that can be done here in the
- 50:23implementation of this method. Um so now
- 50:26let's go through another method called
- 50:29swirl. This is also a kind of
- 50:31continuation of multi-step
- 50:34synthetic data generation and
- 50:36encouraging the model to do to and
- 50:38helping the model do multi-step better.
- 50:41And this is a work that is going to be
- 50:43presented next week at column um in
- 50:46conference and language modeling in
- 50:47Montreal. So this is another just a
- 50:51preview. This is another training like
- 50:53you're using training and basically
- 50:55fine-tuning a language model to help it
- 50:57do multi-step reasoning better. So
- 51:00motivation again many real world tasks
- 51:03require multi-step reasoning and tool
- 51:05use. For example, if you want to answer
- 51:08a multihop question using a search
- 51:10engine, you want to solve math problems
- 51:12or use solving a software engineering
- 51:15like doing a project, planning a trip,
- 51:18analyzing data and so on. Usually we go
- 51:20as humans we use these tools and reason
- 51:23through them for like uh important task
- 51:26more than once. So we need a cohesive
- 51:29kind of number of steps of reasoning and
- 51:31tool use in order to solve a uh problem.
- 51:35So the challenges again in multi-step
- 51:37reasoning and tool use setting is that
- 51:42um
- 51:43when you're doing reasoning and tool use
- 51:45even for one step it can get complicated
- 51:48but as we expand on this and generate
- 51:52multiple steps of reasoning and tool use
- 51:54the errors and the complications can
- 51:56compound over these different steps. Um
- 52:01if we want the model to and the another
- 52:04focus of this paper is enabling tool use
- 52:06like teaching the model to write to use
- 52:08the right tools for example a calculator
- 52:11Python executor and so on. Using these
- 52:14tools live during the training process
- 52:17can be very challenging because tools
- 52:20can fail they can be slow and the
- 52:22training process is already kind of like
- 52:25time consuming and challenging. So this
- 52:27can further slow that down. Um
- 52:31and if you look back in terms of like
- 52:34the fine-tuning processes such as
- 52:36reinforcement learning from human
- 52:38feedback from AI feedback or execution
- 52:41feedback many of these are optimized on
- 52:44the singlestep kind of are optimized for
- 52:47singlestep task. Basically the model
- 52:50takes a lot of whatever it wants to do
- 52:52generates a final answer and the reward
- 52:55is just based on the final answer
- 52:57whether it's correct or not and then we
- 52:59kind of back propagate that towards a
- 53:01actions and here we want to have a more
- 53:04have a have more kind of governance and
- 53:07kind of uh
- 53:10uh on the process of generating these
- 53:12steps and how we can optimize them. Uh
- 53:16so this framework called swirl um
- 53:20and the design goal for SAR is the
- 53:23following. First of all
- 53:26at a high level we want the model to
- 53:27solve complex uh problem and multi-step
- 53:30reasoning task. Um we want the model to
- 53:33know when to call a tool. Um generate
- 53:37the right queries to invoke a tool
- 53:39because we need to know how to use a
- 53:42tool like the model needs to know that.
- 53:44um carry out these reasoning steps and
- 53:47maintain accuracy across them um and
- 53:51learn to how to recover from error and
- 53:55learn to when to stop taking new steps
- 53:57and calling new tools and be and say
- 54:01okay I'm now ready to generate a final
- 54:03answer. So we want the model to know
- 54:05these steps. We also uh want to avoid
- 54:08using tools during the training process
- 54:13uh because like I mentioned this can be
- 54:14slow tools can fail and we we and can
- 54:18have bugs. We want to avoid that and
- 54:21ideally we want the model to generalize
- 54:23this. So ideally we want the model to
- 54:26learn how to you when to adapt to new
- 54:29tools and new reasoning uh tasks and
- 54:32capabilities.
- 54:34So to approach this the um here's the
- 54:39here's the process. The first step of
- 54:42this process is that let's start with
- 54:45creating synthetic
- 54:48let's start with creating synthetic
- 54:49multi-step data for a model. So given a
- 54:53prompt um and in order to really like
- 54:56annotate these steps, let's have the
- 54:59model um take one step at a time and
- 55:06let the model know at each step that is
- 55:08free to reason, create a chain of
- 55:10thought, call a tool, um or propose a
- 55:14final answer. So having an input prompt
- 55:18at step one, we tell the model, you have
- 55:21access to these tools. Uh you can
- 55:24generate a reasoning step. If you're
- 55:26ready to to generate the final answer,
- 55:29just say that and create that. U so
- 55:32given this prompt, the model can would
- 55:35take the first action which could be a
- 55:39reasoning step followed by the by a tool
- 55:41call and then we show the model the
- 55:43environment response.
- 55:45Um
- 55:49so given that then we ask the model
- 55:52again we show the model again the same
- 55:54prompt but this time we have kind of the
- 55:57context from the previous step. So
- 56:00basically we say here is the original
- 56:02prompt here is the previous action and
- 56:05here is the result of taking that action
- 56:07from the environment. You can take a new
- 56:09action which is and call the tool or if
- 56:14you're ready to create the final answer
- 56:16just uh output the final answer. So by
- 56:20design we are this through through this
- 56:22adapt to iterative prompting we are
- 56:25creating this multi-step data set and
- 56:28the steps can be from one to three or
- 56:31five and so on for different queries.
- 56:35um
- 56:37the then we need kind of a label. We
- 56:40want to to um have an a notation of how
- 56:44good this uh step is. And to do to do
- 56:48so, we can we ask an LLM as a judge
- 56:51given the prior context and the current
- 56:54action which is a reasoning state
- 56:57followed by a tool call give us a reward
- 56:59function. give us like your estimate of
- 57:02how good this uh kind of trajectory and
- 57:05final action is.
- 57:10Um given that we have for each query and
- 57:13reason we have a set of steps and for
- 57:16each step we have a LLM as a judge kind
- 57:19of like score that is assigned to that
- 57:22step and we can do that offline. We can
- 57:24go through many many questions in
- 57:26parallel offline and generate these
- 57:28steps and uh labeled annotations.
- 57:33Once we have these uh steps per prompt,
- 57:37we can filter this data in different
- 57:39ways. For example, um we can only keep
- 57:43the data where the the judge LLM as a
- 57:46judge kind of decided every single step
- 57:49was a good kind of step. Every single
- 57:52action was good. Or we can go based on
- 57:55outcome filter data and that would be we
- 57:58just keep we keep all the trajectories
- 58:00that the final answer was correct no
- 58:02matter what the label per step was. And
- 58:04we're going to see how these two kind of
- 58:06deferred with each other. But the whole
- 58:09part the whole pro the whole kind of
- 58:11like intuition motivation behind this
- 58:14part is that for for these reasoning pro
- 58:17prompts we have a number of pre like a
- 58:21number of steps and then for each step
- 58:24we have a reward uh created by the model
- 58:26which we can use or not use during our
- 58:29training. But let's see how these two
- 58:30play out. Um then having this data that
- 58:35we have generated offline we can start
- 58:38the training process and this training
- 58:40in this part is done based on
- 58:42reinforcement learning. So maybe you can
- 58:44pay attention to this figure on the
- 58:46right. Um this is a very simple example
- 58:49but let's go through that. Who is older?
- 58:51Glenn who I don't know the last name or
- 58:54Rossling. So these two people who is
- 58:56older. So action one is to figure out
- 59:00who is older. I should first search for
- 59:03age of the first person.
- 59:07Then we have a reward for this action.
- 59:09We ask the judge LLM as a judge to say
- 59:12given an input prompt and this action
- 59:15what is the reward for this uh step.
- 59:19Then we have the then we actually go and
- 59:23um
- 59:25show the model um the result of this
- 59:28step. This is already we have in our
- 59:30training data. So we have the
- 59:32environment resp response and then we
- 59:34prompt the model to to take the next
- 59:36action and in the next action is the
- 59:39second question which is about the age
- 59:40of the second person. We have a reward
- 59:43based on that and at the last stage we
- 59:48say given the result of the previous
- 59:50searches we we ask the model to generate
- 59:53the final another action. In this case
- 59:55the model seems to be ready to to output
- 59:58the final answer. So it outputs the
- 1:00:01answer in these tags answer and u and uh
- 1:00:06uh the final answer is there and we can
- 1:00:09get a reward based on that. Uh so the
- 1:00:11point that I want you to pay attention
- 1:00:13to is how we manage to not have the tool
- 1:00:16calls during training. So basically what
- 1:00:20we are doing here is that we have this
- 1:00:22trajectory from the prompt and from
- 1:00:25these um kind of uh pre pre-esign pre
- 1:00:30kind of collected actions and tool calls
- 1:00:34during RL process we get the reward we
- 1:00:38show the the prompt and steps and
- 1:00:41actions onto that action K in this case
- 1:00:44for example up to action one and the
- 1:00:47environment response
- 1:00:48And then that we ask the model to take
- 1:00:51the next step. So this is the part that
- 1:00:53is done during training. The the model
- 1:00:55takes the next action but before but we
- 1:00:59don't need to execute that action or
- 1:01:01call the tool. We just collect a reward
- 1:01:04based on that um specific action um and
- 1:01:09use that for RL optimization. All the
- 1:01:11tool calls are just done during the data
- 1:01:14annotation process outside of the RL
- 1:01:16fine-tuning part. Um because we realize
- 1:01:19that the model the the LLMs just does a
- 1:01:22good job based on the quality of the
- 1:01:24action that's proposed. We're good on
- 1:01:28just evaluating that. We don't need to
- 1:01:30get execute the action and evaluate
- 1:01:33that. So that's how we separated the
- 1:01:35two.
- 1:01:42We so we did not need we did not train
- 1:01:45an LLM as a judge for this. We just
- 1:01:47prompted uh I I'll talk about what
- 1:01:49models we used for each one.
- 1:01:52So there was no training for that.
- 1:01:55>> But if you if the judge cannot see the
- 1:01:58real like
- 1:02:01from
- 1:02:04how can like judge
- 1:02:07>> Yeah. So the jud So the question is if
- 1:02:09the judge cannot see the output of the
- 1:02:11tool how can it give a reasonable score.
- 1:02:14So the here's the the point here. So we
- 1:02:17are asking the judge to judge the
- 1:02:21quality of the the query that is
- 1:02:23generated by the model to call the tool
- 1:02:26rather than the output of the tool. Like
- 1:02:29here what the judge sees is that the
- 1:02:31model is asking age of this person right
- 1:02:35and the model can judge that this is a
- 1:02:38good kind of question to create for the
- 1:02:40search engine
- 1:02:42it before seeing the result of the
- 1:02:45search engine right the model doesn't
- 1:02:46need to know the age of this person to
- 1:02:48know this question was good or bad this
- 1:02:50is a good question this is a reasonable
- 1:02:52question right
- 1:02:56Um
- 1:02:59so basically what we are doing is
- 1:03:01providing this process feedback process
- 1:03:04reward for this step and the tool calls
- 1:03:07are captured in the prior context. So
- 1:03:10all of these tool call resources is we
- 1:03:12have collected them in our offline
- 1:03:14training data set. We are not doing that
- 1:03:16during during the actual RL fine-tuning.
- 1:03:21So um to just show you the objective
- 1:03:24function that we that is being optimized
- 1:03:26in this multi-step RL is
- 1:03:30let's say we have a number of steps S S1
- 1:03:33to SK and then each followed by an
- 1:03:36action which is a reasoning step
- 1:03:38followed by a tool call. What we are
- 1:03:41doing here is that we are optimizing the
- 1:03:43expected reward of an action of a single
- 1:03:47action given all the context so far
- 1:03:50which is a set of states and actions
- 1:03:52that we have collected off.
- 1:03:59Um so that's [snorts] how we are
- 1:04:01optimizing the expected reward of an
- 1:04:04action of a single action in a
- 1:04:06multi-step process given all the prior
- 1:04:08steps. But of course this action this
- 1:04:12varies from action one all the way to
- 1:04:14action K.
- 1:04:18Um now during inference
- 1:04:21once we RL this model we let's walk
- 1:04:24through an inference process of how we
- 1:04:26encourage the model to do this
- 1:04:28multi-step process. So for example here
- 1:04:31the the user the prompt is help me
- 1:04:33answer the following questions uh in
- 1:04:36just a few words.
- 1:04:39uh and then we uh specify the tool that
- 1:04:41the model can use. In this case, a
- 1:04:43calculator. If you think it would help
- 1:04:45to use a calculator, please generate a
- 1:04:47mathemat mathematical query uh enclosed
- 1:04:50by this kind of these kind of tags. Um
- 1:04:55and then
- 1:04:57we also tell the model once you have
- 1:04:59enough information you can generate an
- 1:05:02answer tag and generate the final
- 1:05:04answer. So through these tags, the model
- 1:05:07can tell us the tool call um or or or if
- 1:05:11it's ready to generate the final answer.
- 1:05:13So here is the input question. Uh so in
- 1:05:18step one, the model is prompted um here
- 1:05:21is the input question. The model u uh
- 1:05:24responses to that question. uh and it in
- 1:05:27this response is calling it the
- 1:05:29calculator and it's calling this uh kind
- 1:05:32of like this is the math that it wants
- 1:05:34to run. The user provides that um output
- 1:05:38like basically that tool is executed
- 1:05:40with that given input. We give the
- 1:05:43output to the model and then the model
- 1:05:45is prompted again
- 1:05:47again here is the input here is the
- 1:05:50result from the previous kind of like
- 1:05:53thinking process and tool call. Um and
- 1:05:56the model takes the next action and and
- 1:05:59next action and so far. Um so we are
- 1:06:02kind of iteratively prompt the model.
- 1:06:04Here is what happened so far. Here's the
- 1:06:06tool you have. If you're ready to
- 1:06:07generate the final answer, do it. If
- 1:06:10not, continue using the tool.
- 1:06:16So the experimental setup for this
- 1:06:18approach was the following. We have
- 1:06:19there is a uh mod GMO 227B
- 1:06:24used to was used to create this
- 1:06:26multi-step synthetic data. Uh the
- 1:06:29questions were coming from hotspot QA
- 1:06:31and GSM8K.
- 1:06:33uh we had something like 50k
- 1:06:36trajectories
- 1:06:38uh sourced from a number of problems and
- 1:06:40created for uh different kinds of data
- 1:06:43that were like I said we can process
- 1:06:46this data that we created based on
- 1:06:49process filter
- 1:06:51outcome filtered both process and uh
- 1:06:54outcome filtered or random and then we
- 1:06:56also corrected a number of trajectories
- 1:06:58I think um so let's take a look at
- 1:07:02impact of data of filtering on the
- 1:07:04performance of swirl. Um one perhaps in
- 1:07:10the beginning this was non-intuitive but
- 1:07:12we kind of realized what why this is
- 1:07:14happening is that it seems like when our
- 1:07:17training data was only process filtered
- 1:07:20meaning we took reasoning steps that
- 1:07:23were majority like uh uh voted yes by
- 1:07:28LLM as a judge from the reasoning steps
- 1:07:30but we kind of like didn't filter them
- 1:07:33based on the correctness of final
- 1:07:34answer. This seems to help the the
- 1:07:37process more the the training more than
- 1:07:41if we kind of rigorously
- 1:07:43uh only took trajectories where the
- 1:07:46outcome was uh correct or both process
- 1:07:49and outcome were correct. Um, and the
- 1:07:52reason for that is if we only get
- 1:07:54trajectories where the model already
- 1:07:57knows the outcome and is correct,
- 1:07:59perhaps you're not helping the model
- 1:08:01solve problems that it couldn't solve
- 1:08:03during test time because you're training
- 1:08:05it to think differently about these
- 1:08:07problems. So, it can solve new problems
- 1:08:10that it couldn't solve before, but it
- 1:08:12had kind of gotten the some processes uh
- 1:08:15correctly.
- 1:08:18Um but perhaps the most interesting and
- 1:08:21this is again something that we are
- 1:08:23seeing in the sprint project as well is
- 1:08:26the generalization performance of the
- 1:08:29model. So for example we had a swirl on
- 1:08:33GSM8K. These are math problems and we
- 1:08:35were teaching the model to use like simp
- 1:08:39calculator basically to solve these
- 1:08:41problems. Uh so that was the training
- 1:08:44data and then we when once we kind of
- 1:08:47did do this multi-step RL optimization
- 1:08:50using GSM8K we then tested on hotspot QA
- 1:08:54and this is the accuracy that uh
- 1:08:57increase that we get from the base
- 1:08:59model. So it goes from 65 to 751.
- 1:09:03And if we were to use exactly hotspot QA
- 1:09:07and in this case the tool for hotspot QA
- 1:09:09was a search tool uh not a calculator
- 1:09:12the optimization the increase was from
- 1:09:1565 to 73. So and vice versa this was
- 1:09:19true as well. If we train the model on
- 1:09:21hotspot QA with a search tool it could
- 1:09:23also do well on GSM8K with Python. So it
- 1:09:27seems like there is something going
- 1:09:29beyond just like learning to use a
- 1:09:32specific tool. Rather the model is
- 1:09:35learning how to think in steps and how
- 1:09:39learn how to invoke a tool. Um and and
- 1:09:42this was perhaps u and and these data
- 1:09:44sets the other data sets are separate uh
- 1:09:47from uh any of our training data.
- 1:09:51Uh another uh important observation here
- 1:09:54was that again in this case we were the
- 1:09:58model is being trained on hotspot QA
- 1:10:01using a search tool for all of these but
- 1:10:04we are showing the test results um as we
- 1:10:07are increasing this synthetic data the
- 1:10:10training data size. So it seems like as
- 1:10:12we go from 100 training examples to uh
- 1:10:1510,000 training examples even at
- 1:10:18inference the model is improving on a
- 1:10:21completely different task which is math
- 1:10:23problems and GSM8K.
- 1:10:25So this is like again u I think it's the
- 1:10:29most important graph from this paper
- 1:10:31showing that by creating synthetic data
- 1:10:35in environments that are perhaps like
- 1:10:38easier to create create these data for
- 1:10:41and teaching the model how to use these
- 1:10:43tools and how to do think uh in multi
- 1:10:46multiple steps. We can generalize these
- 1:10:50behavior to entirely new tools and
- 1:10:52domains. And perhaps scaling this up
- 1:10:55could be a very um kind of imp powerful
- 1:11:00uh methodology.
- 1:11:04Um
- 1:11:05and here we are showing some results on
- 1:11:10the like to to kind of try to interpret
- 1:11:14why the model is becoming better uh by
- 1:11:17in through this RL processes. And what
- 1:11:21we did here is to look into the average
- 1:11:23kind of process reward per step of the
- 1:11:27model in answering these questions
- 1:11:29before and after being fine-tuned uh
- 1:11:33through this reinforcement learning
- 1:11:35process. And perhaps this is again very
- 1:11:38intuitive that the process correctness
- 1:11:40of the model has improved throughout
- 1:11:43this process for both in distribution
- 1:11:46domain where we train on hotspot QA and
- 1:11:48out of dist out of distribution when we
- 1:11:50just tested on GSM8K. So the model
- 1:11:53thinks more correctly per step both for
- 1:11:58on the training data but on other but
- 1:12:00out of distribution data. And here are
- 1:12:03some other results um that uh we can
- 1:12:06also be look also looked into precision,
- 1:12:09recall and other metrics across a number
- 1:12:11of tasks. Um
- 1:12:15um and um here are how this works
- 1:12:18compared to frontier models. Um
- 1:12:23something that is uh perhaps it's worth
- 1:12:28noting here is that
- 1:12:31we could do all of this that all of this
- 1:12:33process that we did with RL we could do
- 1:12:35it with supervised finetuning as well
- 1:12:39and it turns out that this multi-step RL
- 1:12:41does better by a good amount over
- 1:12:44supervised finetuning
- 1:12:47uh and especially for supervised
- 1:12:49finetuning it seemed like the model
- 1:12:51really benefited like the training data
- 1:12:54needed to be correct like both process
- 1:12:57and outcome filtered um supervised
- 1:13:00finding on that kind of training data
- 1:13:02worked better than when we only uh when
- 1:13:05we selected only the process filtered
- 1:13:08data and it kind of makes sense because
- 1:13:10in supervised fine-tuning we're kind of
- 1:13:13it's kind of an imit imitation learning
- 1:13:16right we're showing these are the
- 1:13:17trajectories and we want the model to
- 1:13:19repeat those in a Okay. Uh whereas in
- 1:13:21the and then if they're incorrect, the
- 1:13:23outcome is incorrect. It might hurt
- 1:13:25performance. Whereas in RL, we are
- 1:13:28giving the model a new chance in in to
- 1:13:31take a new action given the prior steps
- 1:13:34and we are kind of giving a reward based
- 1:13:36on that new action and that's how it can
- 1:13:38break out from this. Um and here are
- 1:13:43some other results. Um but because we're
- 1:13:47out of time let's just take a look at
- 1:13:49the summary of this. Uh so again a
- 1:13:53important observation was that sort
- 1:13:56generalizes across data sets and tools.
- 1:13:59um it transfers to desperate task. H and
- 1:14:03the model learns better from process
- 1:14:05filtered data and it can get get a lot
- 1:14:08of gains from more synthetic data both
- 1:14:11for in domain and out of domain and um
- 1:14:15and from an just understanding why this
- 1:14:18happens. It turns out that after this
- 1:14:20sort of fine-tuning the process behavior
- 1:14:23like the process correctness of the
- 1:14:25model improves. So if we just go to
- 1:14:27evaluate that the model becomes better
- 1:14:30at this multi-step um thinking um again
- 1:14:34this is true for both in distribution
- 1:14:36and out of distribution uh data and with
- 1:14:39that you can conclude this lecture.
- 1:14:42I hope you learn more about multistep
- 1:14:44and reasoning and planning which is a
- 1:14:47very active field that is going forward.
About this transcript
This page contains the full transcript of YouTube transcript (Ml_fp9XkB8Y) , generated from the public captions YouTube serves with the video. The transcript has 11,030 words across 1,580 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.