YouTube2Text

YouTube transcript (Ml_fp9XkB8Y) — Transcript

11,030 words · 1,580 segments · language en · Watch on YouTube

Full transcript

  1. 0:05So today's lecture is going to be about
  2. 0:08planning and multi-step reasoning. Um so
  3. 0:11today's lecture we are going to cover
  4. 0:14three papers on multi-step reasoning and
  5. 0:17planning let's start with this paper um
  6. 0:21from
  7. 0:23uh ICML of last year. So the title uh of
  8. 0:28the paper is language agent tree
  9. 0:31research unifies reasoning acting and
  10. 0:34planning in uh language models. So the
  11. 0:40kind of the target the types of
  12. 0:42applications that we want to target in
  13. 0:44multi-step task are tasks that we uh
  14. 0:48need not only need to reason about
  15. 0:50things but also need to act through
  16. 0:52those reasoning steps and um kind of
  17. 0:55search our trajectories or optimize
  18. 0:58trajectories on how we get to a final
  19. 1:00correct answer. So in the reasoning
  20. 1:03step, the model needs to think about
  21. 1:06what needs to be done. For example, what
  22. 1:09the budget is, where where the plan is.
  23. 1:11This these are the reasoning steps for a
  24. 1:13trip or vacation planning prompt. The
  25. 1:17act is okay. Now that you have
  26. 1:21certain types of reasoning or thinking,
  27. 1:24how do you kind of gather more
  28. 1:26information or act on these reasoning
  29. 1:28steps? For example, the action could be
  30. 1:30a browsing uh browsing the web,
  31. 1:33generating a query to search uh readits
  32. 1:37Reddit or a travel blog and so so on.
  33. 1:41And then another step is search um
  34. 1:45given these feedback or the information
  35. 1:47that's uh gathered online um how can we
  36. 1:52refine our uh our plan so far? Maybe we
  37. 1:56can consider alternative destinations
  38. 1:59uh search new things to do while we are
  39. 2:01there and so on. So there were a a
  40. 2:04series of reasoning action and search
  41. 2:07steps that needs to be done to solve
  42. 2:09this problem of for example planning a
  43. 2:12trip. So the problem um or the challenge
  44. 2:15that this paper specifically wanted to
  45. 2:18address was the following. Um
  46. 2:23the goal here was let's go from the LLM
  47. 2:26generate a plan and like executing on on
  48. 2:30that plan to really try to encourage
  49. 2:32diversification and exploration of
  50. 2:36different types of uh plans or path that
  51. 2:39the model can take. uh because models
  52. 2:42and this is true still to this day that
  53. 2:44they can be
  54. 2:46weak in creating a diversity of
  55. 2:49solutions or acting upon them and um
  56. 2:52planning multiple steps of optimization
  57. 2:55to reach a solution. Um so this paper
  58. 2:59focused on bringing known techniques
  59. 3:01from reinforcement learning and multi-
  60. 3:05kind of multi-step planning that existed
  61. 3:07in the past um including multi-step uh
  62. 3:10Monte Carlo research into the LLM
  63. 3:13reasoning path. Um and given that the
  64. 3:18models can uh take feedback in it also
  65. 3:22introduce ways for the model to take
  66. 3:24different feedback as the model explores
  67. 3:27with the the environment and bring that
  68. 3:29back in in order to f refine and
  69. 3:32optimize future uh plans and search
  70. 3:35processes.
  71. 3:39So
  72. 3:41just a quick kind of example of how uh
  73. 3:45how this worked. Uh for example the the
  74. 3:48prompt is to plan a trip to Hawaii.
  75. 3:51There are different ways and different
  76. 3:52actions that the model can take. Um so
  77. 3:57it can for example the if we sample the
  78. 4:01model for this prompt the model might
  79. 4:05decide that uh we might consider asking
  80. 4:08friends that already went to Hawaii or
  81. 4:11read subreddits uh related to that. And
  82. 4:14then this this uh framework introduce a
  83. 4:17mechanism for getting a score for each
  84. 4:20of these actions. Um and then kind of
  85. 4:24update the search space or the
  86. 4:26trajectory of follow-up kind of
  87. 4:28expansion of this tree that is being
  88. 4:30formed based on that score. So in this
  89. 4:33case and we talked about how these
  90. 4:35scores are generated in this case action
  91. 4:38one has a higher score. So we expand
  92. 4:40that action. So the model expands that
  93. 4:43action. Um so in this case ask two
  94. 4:46friends uh about uh friend A and friend
  95. 4:49B about opinions and then based on the
  96. 4:52quality of responses there's score for
  97. 4:54that and we can follow on from from uh
  98. 4:58the model can expand from there. So
  99. 5:01there is a there's a flavor of
  100. 5:03multi-action sampling. In this case, the
  101. 5:06actions can be in fact ex be executed in
  102. 5:09parallel like these two actions or these
  103. 5:11two actions. They both can be executed
  104. 5:14in parallel. And there's this notion of
  105. 5:17like let's do continue exploration based
  106. 5:20on the best state but also consider
  107. 5:24a a mix of exploration and exploitation.
  108. 5:27And that's where the MCTS comes in.
  109. 5:32Um so there are two kind of papers that
  110. 5:37uh this paper was basically saying how
  111. 5:39it diverges from those. Math sheepard is
  112. 5:42a paper that we saw previously and in
  113. 5:45that paper there was a verifier that was
  114. 5:48guiding the search process uh in the
  115. 5:51test time. Basically um the the
  116. 5:54reasoning kind of trajectories are
  117. 5:56scored by this verifier and then um the
  118. 6:00the the expansion is uh guided by that.
  119. 6:04But in lats which is this paper that we
  120. 6:06are going to uh learn more about in this
  121. 6:10lecture uh the scoring is not based on
  122. 6:13reasoning choices but it's based on the
  123. 6:15outcomes of the actions that the model
  124. 6:18takes. uh and also there is this part
  125. 6:21about reflection of the model to kind of
  126. 6:24evaluate how this trajectory went uh and
  127. 6:28um also about the observations from the
  128. 6:30environment. Um it also improves based
  129. 6:34on previous uh methods uh uh frameworks
  130. 6:38and reasoning such as the React work. um
  131. 6:43where um basically in React uh
  132. 6:50there there is this extra step of we're
  133. 6:52going to see how this works but there is
  134. 6:54this extra step of kind of memorization
  135. 6:56and again reflection and then
  136. 6:58interaction with the environment that we
  137. 7:00have in the lats uh p paper and
  138. 7:04specifically we have more and more
  139. 7:07planning in into the process
  140. 7:11So um here is uh the intuition
  141. 7:15[clears throat] uh behind lats. Uh there
  142. 7:18is the chain of thought uh where the
  143. 7:22reasoning process is basically
  144. 7:23decomposed into a number of steps. There
  145. 7:26is this notion of tree expansion. Um
  146. 7:30basically through this type types of
  147. 7:33actionings that action uh generation
  148. 7:36that we have we have a tree that we form
  149. 7:38a tree and we do search and planning
  150. 7:40through that and then we have this kind
  151. 7:43of like borrowed that from the react
  152. 7:45framework where uh the feedback from
  153. 7:48these actions are incorporated into into
  154. 7:51this search process for the future
  155. 7:54search search and so on.
  156. 7:57So this method concretely has six types
  157. 8:02of kind of uh
  158. 8:06uh stages.
  159. 8:08Selection, expansion, evaluation,
  160. 8:11simulation, back propagation and
  161. 8:13reflection. So let's see exactly how
  162. 8:15this method works. Um and let's walk
  163. 8:17through an example an example prompt. So
  164. 8:20in this case, the prompt is um navigate
  165. 8:24through a maze to reach an exit. Um and
  166. 8:27then the initial observation is that
  167. 8:30you're in a dimly lit room. There are
  168. 8:32two doors, one on the left and one on
  169. 8:34the right. And the goal is to reach an
  170. 8:36exit in this case. So let's see how
  171. 8:39these different steps of lats uh come
  172. 8:42into play. So first is the selection
  173. 8:46process. In this stage, we need to
  174. 8:48select a node to expand. Let's say we
  175. 8:50have done that. We see exactly how
  176. 8:52that's done. Uh but given a node, we
  177. 8:56want to see what kind of actions we can
  178. 8:59given that we have selected a node and
  179. 9:01this is based on UTC. We're going to see
  180. 9:03it in a bit. We want to see what kind of
  181. 9:05actions that we can take from that node.
  182. 9:08So in this case our initialized node is
  183. 9:13uh this thing you're in a dimly lit room
  184. 9:15and so on. Now let's say the model
  185. 9:18samples different actions here. In this
  186. 9:21case three actions are sampled. One is
  187. 9:24open the left door, open the right door
  188. 9:26and the third one is inspect the room
  189. 9:28for clues. Then the next step is each of
  190. 9:31these actions are executed in the
  191. 9:33environment and the observation is kind
  192. 9:36of basically appended to uh to the
  193. 9:39context. So in this case say if the
  194. 9:43action is open the left room the
  195. 9:45observation is dark corridor with
  196. 9:47paintings. Action B is open the right
  197. 9:50there's another observation and so on
  198. 9:51for action C.
  199. 9:54Now uh comes the evaluation. So let's
  200. 9:57say we have an action. We have executed
  201. 10:00an action. We want to evaluate our new
  202. 10:03state that we are going into. For this
  203. 10:06part um they suggest averaging for
  204. 10:10creating a score based on the current uh
  205. 10:14kind of action and observation. They
  206. 10:16suggest adding up two scores together.
  207. 10:19One is using an LM score basically
  208. 10:23prompting using LLM as a judge and
  209. 10:25prompting the model for the for
  210. 10:28evaluating how promising this state is
  211. 10:31and literally asking it to give a score
  212. 10:33based on 0 to one for this state and the
  213. 10:37other one is the self-consistency score
  214. 10:40and that is let's assume instead of
  215. 10:42three actions here we had sampled
  216. 10:45uh 50 times
  217. 10:48um we had sampled called 50 actions and
  218. 10:50we categorize them into different types
  219. 10:52of actions. And if an action is sampled
  220. 10:54more, we kind of give a score like we
  221. 10:58give a score corresponding to the the
  222. 11:01rate or the frequency of an action being
  223. 11:03sampled. So in this case, the
  224. 11:05self-consistency
  225. 11:07score for state A was higher because 75%
  226. 11:11of the time maybe the action A was um uh
  227. 11:15sampled. So the way to create just one
  228. 11:18value for this state for this action is
  229. 11:20to add up these two. So now we have a
  230. 11:23value for for action A corresponding to
  231. 11:26to to state SA.
  232. 11:30Um and then we have the simulation part.
  233. 11:34For example in a greedy method we from
  234. 11:37the previous stage we have SA having the
  235. 11:39highest score. SB and S SC have much
  236. 11:43lower scores. So we we go and expand SA
  237. 11:47all the way again we can continue this
  238. 11:50process we sample more uh from SA and we
  239. 11:53continue expansions until we reach an
  240. 11:56end state or or whether it's successful
  241. 11:59or it fails or until we reach a a maxim
  242. 12:03the budget that we have for expansion of
  243. 12:06this state. So um in this case from
  244. 12:09state SA um so this was SA and then we
  245. 12:14have um the candidate actions that start
  246. 12:16from that state and then in this case
  247. 12:19it's greedy it takes one approach one
  248. 12:22action approach the staircase um and
  249. 12:26then we reach an observation
  250. 12:29uh which we are lucky in this case we
  251. 12:32have the exit door clearly marked we we
  252. 12:34got a point here.
  253. 12:37Um and then let's say the simulation is
  254. 12:43done. We either have an successful
  255. 12:45trajectory or it's a failure. Um uh then
  256. 12:48we can we the important part here is how
  257. 12:52do we use this observation to kind of
  258. 12:54backrop and update the scores that we
  259. 12:57had for different actions that were
  260. 12:59taken. So this is the backrop stage and
  261. 13:02then that is used to influence the score
  262. 13:05of each each state um and uh and we're
  263. 13:10going to talk about it in a bit. Okay,
  264. 13:11let's talk about how these value
  265. 13:13function and back propagation is used.
  266. 13:16So for the value function we already saw
  267. 13:18that that is a weighted average of
  268. 13:21asking an LLM as a judge given this
  269. 13:23observation this action how do you have
  270. 13:26what are the chances of success give us
  271. 13:28a score between 0 to one and then
  272. 13:30there's the self-consistency which
  273. 13:31basically we just count how many times a
  274. 13:35given action is sample
  275. 13:38then there is the notion of UCT or upper
  276. 13:42confidence bounds applied to trees
  277. 13:44that's something that this is the the
  278. 13:46the basically the number or score that
  279. 13:50is used for selection because we have at
  280. 13:53each point we have a range of like
  281. 13:55values that we want to see which node we
  282. 13:58go and expand. So the way UCT works and
  283. 14:01this is like completely borrowed from
  284. 14:04the MCTS kind of literature. Uh
  285. 14:08the way it's designed is to try to
  286. 14:10balance between exploration and
  287. 14:12exploitation. If we just go based on the
  288. 14:15highest value at that point, we might
  289. 14:17miss out other nodes that right now
  290. 14:20maybe at the current moment have a lower
  291. 14:22uh value but down the road at the end
  292. 14:25might have higher value. So let's
  293. 14:27balance the the two of them. So the way
  294. 14:29UCT works is that it has this
  295. 14:31exploitation
  296. 14:33uh one which is V of S plus a
  297. 14:36hyperparameter times this other term
  298. 14:39which encourages exploration. And the
  299. 14:42way this work here is that the np is the
  300. 14:45parent the number of times a parent of a
  301. 14:47node is visited and ns is the number of
  302. 14:50the nodes that this current node is not
  303. 14:52the parent but the current node is
  304. 14:54visited. And basically think about it
  305. 14:56this way relative to the parent node. If
  306. 14:59a node is visited less we want to
  307. 15:02encourage visiting that node more. And
  308. 15:05if that node relative to the parent is
  309. 15:07in is visited um a high a large number
  310. 15:10of times then this number this uh
  311. 15:13division this becomes a smaller number
  312. 15:15and UCT becomes
  313. 15:18uh lower relative to unexplored kind of
  314. 15:22children of a parent node. So um UCT
  315. 15:27again is the number that we use for
  316. 15:29expans for selection of a node and going
  317. 15:31from there. Now back propagation and
  318. 15:34that's where we go at the end of an a
  319. 15:37trajectory either we succeed or fail the
  320. 15:40return of that trajectory is used to
  321. 15:43update the values and this is like back
  322. 15:45propagated through the the steps. So at
  323. 15:48each point the value of an of a state is
  324. 15:51the value of the old state times the
  325. 15:54number of v visits to that to that node
  326. 15:58uh minus one plus the return divided by
  327. 16:01the total number of visits to that node.
  328. 16:02So that's that's how the math behind
  329. 16:05this um framework. Yes.
  330. 16:08UCP
  331. 16:11one
  332. 16:13long
  333. 16:15take a long
  334. 16:19>> it's it's just something there's some
  335. 16:21math and theoretical intuitions behind
  336. 16:23it. There's no proof that this is the
  337. 16:26optimal round but you want to just
  338. 16:28balance the two in that like this is
  339. 16:31considered a more optimized way of doing
  340. 16:33things. Oh.
  341. 16:37>> Yes. Yes. Um
  342. 16:43so once back propagation is done uh they
  343. 16:47also they also append this reflection of
  344. 16:51the model itself about the uh the
  345. 16:54trajectory that was expanded. If it
  346. 16:56fails or if it succeeds, the model adds
  347. 16:58some thinking behind what happened, what
  348. 17:02led to the failure or the success of
  349. 17:05this trajectory. And this apparently has
  350. 17:07been very helpful in overall increasing
  351. 17:09the quality of this approach.
  352. 17:13Um so they tested this approach on
  353. 17:16hotspot QA which is some data set that
  354. 17:19we still uh uh we use it for multi-step
  355. 17:22reasoning optimization. Basically the
  356. 17:25way this data set works is that for each
  357. 17:28question for answering them you need
  358. 17:30retrieval from at least two like
  359. 17:32different Wikipedia pages um because
  360. 17:35it's just designed like that. So you
  361. 17:37need this multi-step by design kind of
  362. 17:40process in order to find an answer and
  363. 17:43um obvious and they're doing really well
  364. 17:46like just look in in terms of like as
  365. 17:48they increase the number of samples or
  366. 17:51the number of trajectories that they
  367. 17:53sample they can significantly improve
  368. 17:56performance.
  369. 17:58um and the the the reflection and
  370. 18:01bringing those kind of reasoning traces
  371. 18:04also gives a lot of boosts at the end to
  372. 18:06the model. So basically they have
  373. 18:08provided a mechanism to um translate
  374. 18:11more compute at test time effectively to
  375. 18:15better kind of uh solutions for this
  376. 18:17multi-step reasoning tasks. Um they also
  377. 18:20tested that on webshaw which is this
  378. 18:22interesting um data set uh for practical
  379. 18:27app applications.
  380. 18:29Um
  381. 18:31there are um this is like just to show
  382. 18:35you an example how this data set works.
  383. 18:37For example, there is I'm looking for a
  384. 18:39small portable hoarding desk that's
  385. 18:41already fully assembled. It should have
  386. 18:43a this color and this finish and so on
  387. 18:46and the prices. So it's by design it's a
  388. 18:49very multi-step pro it's a multi-step
  389. 18:52process and um they're showing that
  390. 18:54their approach without any kind of
  391. 18:56fine-tuning and just at test time they
  392. 18:59can get really high results even close
  393. 19:02to human um experts in this case. Uh
  394. 19:09so to summarize what LZ proposed was a
  395. 19:13new technique for kind of bringing in
  396. 19:15reasoning uh taking actions and planning
  397. 19:18all together and kind of brought in our
  398. 19:21known ideas like MCTS into the into the
  399. 19:24language model world. um and they got
  400. 19:28very strong results on multiple domains
  401. 19:31and um given the test time approach and
  402. 19:35the modular approach it's very portable
  403. 19:37and easy to uh relatively easy to
  404. 19:41create. The downside of course is the
  405. 19:43cost. um
  406. 19:46um each of these kind of like back
  407. 19:48propagation and like expansion of a tree
  408. 19:51all of those are adding a lot of cost
  409. 19:53and um they like um the cost benefits
  410. 19:58was not really analyzed in the paper.
  411. 20:00Another assumption that this is not this
  412. 20:02paper didn't address was really that um
  413. 20:07there are scenarios where taking an
  414. 20:08action may be reversible. So there are
  415. 20:11that's going to be challenging like how
  416. 20:12do we adapt uh to those scenarios right
  417. 20:15if like for example the model is running
  418. 20:18a transaction like if if it actually
  419. 20:20takes those actions it could be very
  420. 20:22consequential like paying for a service
  421. 20:24and so on. So so that is another uh
  422. 20:27scenario where u this approach might not
  423. 20:31be um adaptable to. So here there are a
  424. 20:36few questions about this paper that I
  425. 20:39really would like you to think about it
  426. 20:41maybe for a couple minutes and then we
  427. 20:43discuss uh anything related to where you
  428. 20:46see the strengths or weaknesses of this
  429. 20:48paper or if you were to adapt it or
  430. 20:52extend it how do you how would you do
  431. 20:53that?
  432. 20:55So let's start doing that and I'll get
  433. 20:57back to you in a couple of minutes.
  434. 21:03All right, let's get back. Anyone wants
  435. 21:05to comment on on this fork?
  436. 21:10>> So the UCT method, it's basically like
  437. 21:13confidence found like from like bandit
  438. 21:15learning setting, right? There's other
  439. 21:17algorithms for like picking like in
  440. 21:19bandit learning like picking and
  441. 21:21exploring various arms. Did they try
  442. 21:24like different ones in this paper?
  443. 21:26>> Okay, the question you think is one way
  444. 21:28to create this exploration.
  445. 21:30There are a lot of literature. know that
  446. 21:33whether they compared.
  447. 21:35>> Yeah.
  448. 21:35>> Um no and there is that whole literature
  449. 21:40multi-arm bandit and other ways that we
  450. 21:42can uh bring in exploration exploitation
  451. 21:45into the optimization process and all of
  452. 21:47that could be like also explored here.
  453. 21:50They just like I think their main
  454. 21:52contribution is that created a platform
  455. 21:55that now can others can bring in other
  456. 21:57approaches to optimization.
  457. 22:01Yeah. Anything else?
  458. 22:05Questions or comments?
  459. 22:11Okay, let's move on to the next paper.
  460. 22:17>> Yes, go ahead. Um so if we were to keep
  461. 22:20track of um the action trajectory based
  462. 22:23with the Monte Carlo tree search what if
  463. 22:26there were times when there's like
  464. 22:27repeated actions like action A B A B if
  465. 22:30or or like um when the same action is
  466. 22:34seen in multiple nodes uh is there any
  467. 22:37way to optimize this tree or does this
  468. 22:39tree recognize all of these repeated
  469. 22:42actions as uh independent trajectories?
  470. 22:49Um so the question is if if a series of
  471. 22:51actions are repeated how do you so so
  472. 22:55the whole the philosophy behind this is
  473. 22:57that if an action is repeated in inside
  474. 23:00a trajectory
  475. 23:02um given a parent node you would count
  476. 23:05you would increase the count of that
  477. 23:07action and that comes in in the UCT
  478. 23:10formulation right so to ideally you
  479. 23:14would capture that in that as you are
  480. 23:16forming this tree and ideally this is a
  481. 23:19tree that you're forming not like some
  482. 23:21kind of like fully connected graph. So
  483. 23:24this is kind of the assumption behind
  484. 23:25behind this. Yes.
  485. 23:29So let's uh now talk about spring. This
  486. 23:32is a new 2025 paper. So this hasn't been
  487. 23:35even presented here at the conference.
  488. 23:38Uh uh so the the this paper is about
  489. 23:42again it gives you a flavor of um this
  490. 23:46kind of like planning and parallel
  491. 23:48execution of those plans and how we can
  492. 23:51kind of use the model itself to enable
  493. 23:54it to think better in parallel and uh we
  494. 23:57can opt and optimize that. So the paper
  495. 24:01this paper sprint was motivated by this
  496. 24:04observation that the reasoning models
  497. 24:07such as 01 Gemini think Gemini 2.5 Pro
  498. 24:11and um pretty much all the frontier
  499. 24:14models right now they um they have this
  500. 24:18tendency that for harder problems they
  501. 24:20think more and this long longer thinking
  502. 24:24corresponds to higher accuracy. So we
  503. 24:26kind of like these models to think for
  504. 24:28longer and longer kind of like chain of
  505. 24:31thoughts. Uh for example, these two
  506. 24:33graphs here show that the deepseek R1
  507. 24:36during the training process as the
  508. 24:39training process continues uh obviously
  509. 24:42it becomes better at solving this ammy
  510. 24:44these math problems but also if we take
  511. 24:48a look at the average length per
  512. 24:50response that is also going up. So it
  513. 24:52seems like there is a correlation
  514. 24:54between model thinking for longer and a
  515. 24:56larger sum of to number of tokens and
  516. 24:58the accuracy that we get from that.
  517. 25:02Now um again so the observation here was
  518. 25:05that many uh like these long reasoning
  519. 25:09steps are helpful but at the same time
  520. 25:12many of these reasoning steps seem to be
  521. 25:14independent of each other. Um
  522. 25:19for example the model tries alternative
  523. 25:21approaches. It deco composes a task into
  524. 25:24subtasks that some of them can be run in
  525. 25:26parallel. Um and then some of these
  526. 25:29steps are verifying the previous steps.
  527. 25:31So but there is a lot of if you look
  528. 25:33into the graph that describes a uh kind
  529. 25:37of the reasoning trace um there are
  530. 25:40parts of these computations that are
  531. 25:42independent of of each other. So we
  532. 25:44don't need to really wait for all of
  533. 25:47these steps to be to be kind of created
  534. 25:50sequentially by the model. So we want to
  535. 25:53see how we can leverage this parallelism
  536. 25:56observation. And uh so the idea is we
  537. 25:59want the model identify this
  538. 26:02parallelization opportunities and kind
  539. 26:04of act on it. So sprint sprint is a
  540. 26:08framework that um does come in during
  541. 26:12the post- training and or fine-tuning
  542. 26:14process and what it does is that it
  543. 26:17takes a reasoning model and enables the
  544. 26:20reasoning model to execute the uh like
  545. 26:24the response generation via a um planner
  546. 26:28and a planner that creates a set of
  547. 26:32plans for how to approach solving a
  548. 26:35problem and a set of executors
  549. 26:38and those executors can be run in
  550. 26:40parallel in order to ex like carry out
  551. 26:44the plan and this can happen again and
  552. 26:46again. We can have the next one we can
  553. 26:49have a plan a bunch of um kind of uh
  554. 26:54execution plans that are carried out in
  555. 26:56parallel and then we can have another
  556. 26:58set of plans and then another set of
  557. 27:00parallel uh executions. uh so this inter
  558. 27:05uh the interleing of this planning and
  559. 27:08execution is what it can enable
  560. 27:10acceleration of the reasoning process.
  561. 27:13So let's say how we can enable that how
  562. 27:16we can enable the model to create these
  563. 27:18parallel kind of traces.
  564. 27:21Um and this is a this is something that
  565. 27:23I want you to kind of think about it
  566. 27:25beyond just this paper and you're seeing
  567. 27:27it in the following work that we are
  568. 27:29talking about. uh a lot of times when we
  569. 27:31want to show to kind of uh create data
  570. 27:36and figure out a certain behavior in the
  571. 27:39model we can use the LLMs itself in in
  572. 27:42the syn like the fine-tuning data
  573. 27:44creation process and here is an example
  574. 27:47of that of that given a reasoning model
  575. 27:50uh models response trajectory to a
  576. 27:53question to a qu to a question we can
  577. 27:57decompose it in the number of steps we
  578. 27:59and LLM. So in this case for example we
  579. 28:02had D6 R1 generate these reasoning
  580. 28:05traces and responses to these questions
  581. 28:08and then we had a model like GPT40 going
  582. 28:11through this reasoning trace and create
  583. 28:14this annotate the steps of the reasoning
  584. 28:17the reasoning response and not only that
  585. 28:20for each of these steps we ask the GPT40
  586. 28:25to annotate whether this is which part
  587. 28:28is the planning part and which part is
  588. 28:30the execution part and in some steps
  589. 28:34there were multiple execution pieces for
  590. 28:37a given plan.
  591. 28:39Um so for example we had this query we
  592. 28:43had the reasoning traits and then there
  593. 28:45are a bunch of things that needs to be
  594. 28:47done and then when the reasoning uh
  595. 28:49stops there's a final answer answer then
  596. 28:53we use GPT40 to go through this process
  597. 28:56and kind of like create these steps one
  598. 28:592 and k basically now we have these
  599. 29:02annotations and within each step the
  600. 29:05model also uh kind of annotates the plan
  601. 29:08and the execution. Which part is the
  602. 29:10planning part? Which part is the
  603. 29:12execution of that plan?
  604. 29:15Given that then we can create a DAG of
  605. 29:18these uh steps. So we have step one,
  606. 29:22step two and all the way. And we can
  607. 29:25again use the model and the model does a
  608. 29:27really good job here of saying whether
  609. 29:30how these steps are related to each
  610. 29:32other. For example, step four and two
  611. 29:34are not dependent on each other, but
  612. 29:36they both depend on step one is a
  613. 29:38follow-up to a step one. So now we have
  614. 29:40like a DAG of um an optimiz and
  615. 29:44basically creating a DAG that um
  616. 29:48describes how this reasoning trace
  617. 29:50works. Um and then we can do packing of
  618. 29:54these steps. For example, step one can
  619. 29:57be done first and step two and three can
  620. 29:59be done completely in parallel with each
  621. 30:01other and so on. Um and
  622. 30:05once we have these data set um that we
  623. 30:10have annotated then LRM here is just a
  624. 30:13large reasoning model. Basically all uh
  625. 30:16LLMs are now inherently reasoning
  626. 30:18models. So what we are uh creating here
  627. 30:21is this data set of the steps plan and
  628. 30:24executions in parallel and we basically
  629. 30:27fine-tune the model the for example deep
  630. 30:30R1 to now think in that way. So
  631. 30:34previously would just create those um
  632. 30:39inherently have these properties but now
  633. 30:42we want the model to think more and more
  634. 30:44in parallel by showing these parallel
  635. 30:46like planning and execution traces and
  636. 30:49we just fine-tune the model in this case
  637. 30:50just the supervised finetuning of
  638. 30:53basically showing the model the same the
  639. 30:56same stuff the same thinking processes
  640. 30:58but now annotated with these tags
  641. 31:01um
  642. 31:03And this helps the model that at
  643. 31:05inference time now the model can out uh
  644. 31:08can output these tags. For example, here
  645. 31:11is plan one and then here are the
  646. 31:14execution um patterns for this and here
  647. 31:18is plan two and so on. So for example
  648. 31:20for pan I there is a set of thinking and
  649. 31:23the parallel execution that the model
  650. 31:25just outputs itself and then we can uh
  651. 31:29kind of go over executing these plans in
  652. 31:32parallel and then syncing the output and
  653. 31:35returning the context and then the model
  654. 31:38goes through plan I + 1 and then there's
  655. 31:41a part of there's a number of parallel
  656. 31:44um kind of sub plans within that that
  657. 31:46the model can uh uh output and we can go
  658. 31:50from there.
  659. 31:52Uh why this matters? Um
  660. 31:56so the cost of LLM inference especially
  661. 32:00when we get to multi-step reasoning
  662. 32:02becomes a huge burden. Um and you might
  663. 32:05have already noticed that yourself when
  664. 32:07you spend a lot of time waiting for the
  665. 32:09model to output a response. It gets
  666. 32:13um it might get uh it might make you
  667. 32:16kind of like not happy. you want the
  668. 32:18answers fast but also it's a lot of cost
  669. 32:20and a lot of delay that goes into
  670. 32:22generating these responses. So right now
  671. 32:25here is how the sequential reasoning
  672. 32:27models work. So there's a query, there's
  673. 32:30a plan and then execution of that plan.
  674. 32:33There's plan two, execution of plan two
  675. 32:35and so on. So this is the time that it
  676. 32:37takes to generate or like go over this
  677. 32:41thinking process and generate a final
  678. 32:43answer. But if we could kind of leverage
  679. 32:47this independence from um plan one and
  680. 32:51plan two, we could have the model
  681. 32:55um execute we could have the execution
  682. 32:58of those plans be done um at the same
  683. 33:03time. Here is what after we fine-tune
  684. 33:05with the spring at inference time
  685. 33:07happens. So instead of model generating
  686. 33:09plan one and executing that then
  687. 33:12generating plan two, model generates
  688. 33:14these two plans first plan one and two
  689. 33:17and then and then and then it starts
  690. 33:20executing the execution of those plans
  691. 33:23happen at the same time and then the
  692. 33:25execution could be using a tool. For
  693. 33:27example, the model is come up with a
  694. 33:29calculation and then we can use this
  695. 33:31calculator or Python to execute plan one
  696. 33:34and plan two and so on and then go to
  697. 33:37the next step next stage and the
  698. 33:40fine-tuning data. Again, this is another
  699. 33:43visualization of how given these
  700. 33:46annotations that we have for plans and
  701. 33:48execution, we create the fine-tuning
  702. 33:50data. So we are basically asking the
  703. 33:52model to think in parallel if the plans
  704. 33:56are independent of each other. We are
  705. 33:58basically teaching the model to come up
  706. 34:00with plan one and two at the same time
  707. 34:02because they're independent of each
  708. 34:03other and we execute them. Yes.
  709. 34:06>> So if there's a need for ref planning,
  710. 34:10how does the model remember which plans
  711. 34:12corresponding to which executions and
  712. 34:15like all of those things, right? Like at
  713. 34:18like later in the stage, right? Like if
  714. 34:20like after the execution of four
  715. 34:23>> the one who realizes that oh what I did
  716. 34:25was wrong. How does it remember to like
  717. 34:28do a refining of like go to the plan of
  718. 34:30three instead of like two you know
  719. 34:35>> uh how
  720. 34:37so this this work I I think you are kind
  721. 34:40of like bringing the previous work in
  722. 34:42here like here the model can so what we
  723. 34:44are teaching the model here is that to
  724. 34:47think about plans at each point of time
  725. 34:51even if it's a like a revision of an
  726. 34:53existing plan if it can generate plans.
  727. 34:57If it if it can generate plans that can
  728. 35:00be uh executed in parallel, it should do
  729. 35:03so. It should not wait for the execution
  730. 35:06of plan one to generate plan two because
  731. 35:09plan two has is independent of plan one
  732. 35:12anyway. Right? So this is how we are
  733. 35:14creating this data set for training the
  734. 35:18model to teaching it to think maximally
  735. 35:20in parallel and generate those plans. If
  736. 35:23the model wants to go back and reverse
  737. 35:25on a plan, it still can do that. It
  738. 35:27still sees all of these kind of context.
  739. 35:30It's just like the model is trained to
  740. 35:32think more in parallel and also because
  741. 35:35it's trained to be like that. And we
  742. 35:36have these special kind of tags or ways
  743. 35:39of the model generating these plans and
  744. 35:42execution plans we can act on it and
  745. 35:44enable leverage those parallelism.
  746. 35:48Yes.
  747. 35:50actually change the structure of this
  748. 35:52outline because before you just need to
  749. 35:54predict the next token but now you see
  750. 35:56you have three parallel uh lines
  751. 35:59>> it's always next token it's just that
  752. 36:02there is like instead of like everything
  753. 36:04the plan and execution one at a time if
  754. 36:07there's a tag like here this is plan I
  755. 36:11and here are the the execution and here
  756. 36:14is plan two plan I and I + one for
  757. 36:17example here's plan one and PL plus two.
  758. 36:19This is the high level count. And then
  759. 36:21now that we know that there are these
  760. 36:23two plans, we can just grandchild and
  761. 36:25run them in parallel. So that's that's
  762. 36:27the idea here. Um
  763. 36:30so here is the training recipe starting
  764. 36:33from so we generate 6K thinking
  765. 36:36trajectories for math data set. um
  766. 36:41we keep the ones with higher
  767. 36:42parallelization
  768. 36:45and we do supervised fine-tuning on um
  769. 36:49deepse R1 distill 7B on this reformatted
  770. 36:54trajectories and the interesting
  771. 36:56property that we observed was that uh so
  772. 37:00when we started the project the goal was
  773. 37:03to maximize parallelism for reducing the
  774. 37:07the sequential
  775. 37:09token generation. So we save on that.
  776. 37:11But it turns out this process actually
  777. 37:13helps out with accuracy as well. Like
  778. 37:15the model seems to like this kind of
  779. 37:17more structured way of thinking and this
  780. 37:21uh way of encouraging parallelism helps
  781. 37:24the model have higher accuracy as well.
  782. 37:27And here what we are showing that is the
  783. 37:29average number of sequence sequential
  784. 37:31tokens over the baseline model like R1
  785. 37:34distill 7B and this the sprint model
  786. 37:37again is distilling R1 this basically
  787. 37:40there we are fine-tuning the 7B model
  788. 37:43and there's a big jump like a 3 and a
  789. 37:46half% jump over that um while also
  790. 37:50becoming more much more efficient than a
  791. 37:5332B model in terms of um number of
  792. 37:56sequential tokens
  793. 37:58>> might increase by more authentics for
  794. 38:04more approaches given the fixed computer
  795. 38:08because it
  796. 38:08>> it could be yeah there is and we have
  797. 38:11some data on that which I believe I'm
  798. 38:13going to show yeah the model does
  799. 38:15explore more and think in parallel
  800. 38:19more and the another interesting
  801. 38:21observation was that um
  802. 38:26we have out of domain generalization as
  803. 38:30well. So the thinking to train to like
  804. 38:35sorry training to think in parallel was
  805. 38:37done for the math data set but we also
  806. 38:40saw the model is doing better not only
  807. 38:44have lower have more opportunities for
  808. 38:46this parallelism but also higher
  809. 38:48accuracy for um for example uh countdown
  810. 38:52or GPQA diamond data set. So there is no
  811. 38:56training like we have not trained on
  812. 38:58those data set but the model generalizes
  813. 39:00and this like could go back to what
  814. 39:02you're suggesting that the model can
  815. 39:03think in parallel and that inherently
  816. 39:07seems to help the model but at a as a
  817. 39:09side effect um we also have
  818. 39:12opportunities for leveraging this
  819. 39:14parallelism parallelism and reducing the
  820. 39:16number of sequential tokens. Could there
  821. 39:20be a scenario where [clears throat]
  822. 39:22individually uh the answers are correct
  823. 39:24in the final uh you know in the parallel
  824. 39:27branches but when you combine it say in
  825. 39:29a sequential manner the answer may be
  826. 39:32wrong and in that case what will take
  827. 39:34precedence
  828. 39:35>> and in that case what
  829. 39:37>> what will take precedence because
  830. 39:39sometimes given in a mathematical
  831. 39:40equation individually when you look at
  832. 39:43them in isolation the answer might look
  833. 39:45seemingly correct but when you put them
  834. 39:47and put all the steps together the
  835. 39:49answer will be eventually.
  836. 39:51>> Yeah. So, so when we when the model
  837. 39:56generates the no matter if it generates
  838. 39:58sequentially or in parallel there at the
  839. 40:01end of the day everything is condensed
  840. 40:04into the context. So the model sees that
  841. 40:06and this is the thinking process. The
  842. 40:09answer after this the model should
  843. 40:11generate a synthesize a final answer. So
  844. 40:14if there are con contradictions in the
  845. 40:16sequential or in parallel the model is
  846. 40:19expected to resolve that before
  847. 40:21generating a final answer. So in that
  848. 40:24case it's it's a little difficult to say
  849. 40:26because both both approaches can be uh
  850. 40:29can can suffer from kind of
  851. 40:31contradictions in the thinking. But here
  852. 40:33we are what we are seeing is more that a
  853. 40:36like these plans are kind of like
  854. 40:39they're rather than being different
  855. 40:40approaches to solve the same problem
  856. 40:42they're like different steps to to solve
  857. 40:46uh one problem. Um so uh parallel the
  858. 40:50another interesting observation was that
  859. 40:54um
  860. 40:55and perhaps intuitive some that harder
  861. 40:58problems require more uh iterative
  862. 41:01planning and execution. Uh the other
  863. 41:04observation this was like maybe less
  864. 41:06intuitive was that in the early stages
  865. 41:10like so we have a bunch of these
  866. 41:11parallel planning execution parallel
  867. 41:14planning execution in the early stages
  868. 41:16the parallelism
  869. 41:18more parallelism or more exploration is
  870. 41:21observed by the model and then in the
  871. 41:23later stages uh we kind of converge to
  872. 41:27maybe uh to to um less plans Um
  873. 41:35yeah basically the exploration is is
  874. 41:37more in the early stages and towards the
  875. 41:39end we want to like really go dive deep
  876. 41:42into a single plan and execution. Yes.
  877. 41:45>> Um how can you ensure that the
  878. 41:47independent reasoning tasks um are
  879. 41:49evenly load balanced uh and do not
  880. 41:51encounter bottlenecks like do
  881. 41:54independent tasks for example like have
  882. 41:57similar expected execution times? Like
  883. 42:00here you're saying that how do we make
  884. 42:02sure
  885. 42:03>> right so so when we divide independent
  886. 42:06um tasks how do we ensure that these are
  887. 42:09going to be executed about similar
  888. 42:11times.
  889. 42:13>> So uh so the question is how do we
  890. 42:15ensure that these independent plans that
  891. 42:17are now run at the same time they're
  892. 42:19they're uh they they have they take
  893. 42:22similar times. But the thing is we can
  894. 42:24is we can ensure that right we we have
  895. 42:27uh there are some kind of measures taken
  896. 42:29to enable that but we still could have a
  897. 42:31straggler like maybe step two versus
  898. 42:34four here step four may take a lot
  899. 42:35longer than step two but at the same
  900. 42:38time we are kind of confined to just
  901. 42:41step four not step four plus step two
  902. 42:44runtime. Um and we have some some
  903. 42:47measures. For example, if the the plan
  904. 42:50um if the execution is just too simple,
  905. 42:53we kind of merge that into the plan and
  906. 42:55try to create these bigger and bigger
  907. 42:57chunks that we can we can do in
  908. 42:59parallel. But that could be an
  909. 43:01optimization as well. The the optim
  910. 43:05optimizing this across the stages
  911. 43:10analysis for reasoning function.
  912. 43:12>> I'm not sure. I'm not sure if there
  913. 43:15analysis exactly on that. Um question.
  914. 43:19>> Yes. Could you go back to the slide? So
  915. 43:22uh I saw on the math and GDPA the uh
  916. 43:26spring it has comparable accuracy and
  917. 43:28number of tokens as the baseline R. So
  918. 43:31I'm curious like for those uh benchmarks
  919. 43:35what is the main uh width of the tree
  920. 43:39and what's the maximum width?
  921. 43:44>> Um
  922. 43:45>> in terms of like cuz the width of the
  923. 43:47tree like determines how much
  924. 43:49parallelism you can exploit.
  925. 43:52So you're get what you're getting at is
  926. 43:54that with the it's task dependent
  927. 43:57basically [clears throat] the
  928. 43:58parallelism that we can exploit and for
  929. 44:00some of these if the if we can the
  930. 44:03basically if the ratio of the sequential
  931. 44:05tokens is uh like for one task like for
  932. 44:09example I believe for math it's like
  933. 44:12lower than for GPQ do domain um then yes
  934. 44:16that's an indication of parallelism like
  935. 44:19some task could be inherently more
  936. 44:20parallel than the
  937. 44:22And I don't know the exact number of the
  938. 44:24width of the tree here but that to to be
  939. 44:27able to leverage this approach uh
  940. 44:29parallelism should exist and it's but
  941. 44:32but what we observed is that that is the
  942. 44:34case for many of the reasoning problems
  943. 44:36like math and other kind of reasoning
  944. 44:38tasking GPQA and so on. Um and some of
  945. 44:42these are um
  946. 44:45again like for example if you look at
  947. 44:47this uh for the math data set uh
  948. 44:50compared to um
  949. 44:54some of these methods with like even
  950. 44:56lower but like comparable accuracy we
  951. 44:59increasing the uh the bandwidth or um
  952. 45:02then reducing the number of sequent
  953. 45:04token by something like 40% which is
  954. 45:08like a long large number Um
  955. 45:12but um it is true that this is going to
  956. 45:15be task dependent.
  957. 45:18Um and maybe getting back to your
  958. 45:20questions um we have larger savings for
  959. 45:25problems that need more thinking. So uh
  960. 45:29for example here we are showing the
  961. 45:30sequential token reduction by spring
  962. 45:33over the baseline just sorry over the uh
  963. 45:37RFD model. This is the rejection
  964. 45:39fine-tuning methods. So this is another
  965. 45:41baseline that uh this is a baseline we
  966. 45:44are comparing with. If the num the the
  967. 45:48number of tokens in generated like in
  968. 45:50the thinking process is small then there
  969. 45:54is probably less opportunity for
  970. 45:56parallelism right so by doing this like
  971. 45:59oh let's plan and execute we are
  972. 46:01actually we can be worse than the
  973. 46:04baseline but this appears in the harder
  974. 46:07problems and problems that require more
  975. 46:10thinking and more number of parallel
  976. 46:12tokens and that's where this method
  977. 46:14shines and shows parallelism. Um, I'm
  978. 46:17not sure how how many of you have read
  979. 46:19the recent uh sonnet 4.5
  980. 46:22system card, but it was very interesting
  981. 46:25to me that it says the prompt for for
  982. 46:27the system card um encourages the model
  983. 46:30to use tools as much as possible and at
  984. 46:33least 100 times. That's a very large
  985. 46:36number that we the model is encouraged
  986. 46:39to use the tool. And this is like just
  987. 46:42shows that for we are going into this
  988. 46:46regime that we are solving more and more
  989. 46:47interesting problems and we are actually
  990. 46:49go going more and way beyond 8 to 10k
  991. 46:51even for the number of tokens that the
  992. 46:54model deals with for solving a problem.
  993. 46:59Um yes
  994. 47:06data set diagram on all your
  995. 47:09>> uh fine chain process
  996. 47:13uh I think one
  997. 47:14>> yeah doing inference does it um produce
  998. 47:17the entire um like step one to step k
  999. 47:22the entire thing but different layers or
  1000. 47:24does it do a sequential
  1001. 47:25>> no during inference um it kind just like
  1002. 47:28this. So the model learns to generate
  1003. 47:31plans that can be executed in parallel
  1004. 47:35at the same time. So it first generates
  1005. 47:37plan one and two, plan one and two and
  1006. 47:40then once plan one um like is outputed
  1007. 47:44execution of plan one starts. One plan
  1008. 47:47once plan two is outputed execution of
  1009. 47:49plan two starts then the result is uh
  1010. 47:52put back in the context and then the
  1011. 47:55model is generating two two more plans.
  1012. 47:58So the model still takes this sequential
  1013. 48:00approach to generating plans and
  1014. 48:02execution but with the difference is
  1015. 48:05that if it kind of learns or is trained
  1016. 48:08to at each point of time if there are
  1017. 48:10plans that are can be gener can be
  1018. 48:13executed in parallel it generates those
  1019. 48:15at the same time. So here would be
  1020. 48:18generates uh after step one it generates
  1021. 48:20step two and four at the same time and
  1022. 48:22then you see the results for that and
  1023. 48:24then and then so on and it continues.
  1024. 48:31So each step, think about it, each step
  1025. 48:33is a plan and a set of executions in the
  1026. 48:36training.
  1027. 48:42>> But the step here is defined as plan one
  1028. 48:45and except one. And then it it kind of
  1029. 48:47we changed the notion of
  1030. 48:51um
  1031. 48:52>> do they also match this um like uh so so
  1032. 48:55let's say they execute two plan that
  1033. 48:58like um that can be paralyzed and then
  1034. 49:00they collect the context and then add it
  1035. 49:03to the prompt for the next uh level. So
  1036. 49:06they also do that in the training phase
  1037. 49:09as well to match like how they are
  1038. 49:11prompting it. The training is shown
  1039. 49:14here. This is how the training data will
  1040. 49:16look like.
  1041. 49:17>> So plan one and two are independent. So
  1042. 49:20plan one and two are put together like
  1043. 49:23next to each other. And then we have
  1044. 49:24execution one and two during training.
  1045. 49:26So that's how the model sees
  1046. 49:30um during training that platum one and
  1047. 49:33two could could be outputed together.
  1048. 49:36But at inference the execution is
  1049. 49:38actually also done in parallel.
  1050. 49:42Okay, let's move on to the last paper
  1051. 49:45because I want to make sure we cover
  1052. 49:47that. But just before that opportunity,
  1053. 49:50so here the the work that supervised
  1054. 49:52fine-tuning, but of course methods like
  1055. 49:54RL and GRPO can enable potentially much
  1056. 49:58more kind of benefit from this data and
  1057. 50:01much more kind of this generalization
  1058. 50:03property usually works well with RL. um
  1059. 50:09um and and other other kind of notions
  1060. 50:13about tool use overlapping different
  1061. 50:15tools or like doing um actually
  1062. 50:18realizing the wall clock speedups is
  1063. 50:20other work that can be done here in the
  1064. 50:23implementation of this method. Um so now
  1065. 50:26let's go through another method called
  1066. 50:29swirl. This is also a kind of
  1067. 50:31continuation of multi-step
  1068. 50:34synthetic data generation and
  1069. 50:36encouraging the model to do to and
  1070. 50:38helping the model do multi-step better.
  1071. 50:41And this is a work that is going to be
  1072. 50:43presented next week at column um in
  1073. 50:46conference and language modeling in
  1074. 50:47Montreal. So this is another just a
  1075. 50:51preview. This is another training like
  1076. 50:53you're using training and basically
  1077. 50:55fine-tuning a language model to help it
  1078. 50:57do multi-step reasoning better. So
  1079. 51:00motivation again many real world tasks
  1080. 51:03require multi-step reasoning and tool
  1081. 51:05use. For example, if you want to answer
  1082. 51:08a multihop question using a search
  1083. 51:10engine, you want to solve math problems
  1084. 51:12or use solving a software engineering
  1085. 51:15like doing a project, planning a trip,
  1086. 51:18analyzing data and so on. Usually we go
  1087. 51:20as humans we use these tools and reason
  1088. 51:23through them for like uh important task
  1089. 51:26more than once. So we need a cohesive
  1090. 51:29kind of number of steps of reasoning and
  1091. 51:31tool use in order to solve a uh problem.
  1092. 51:35So the challenges again in multi-step
  1093. 51:37reasoning and tool use setting is that
  1094. 51:42um
  1095. 51:43when you're doing reasoning and tool use
  1096. 51:45even for one step it can get complicated
  1097. 51:48but as we expand on this and generate
  1098. 51:52multiple steps of reasoning and tool use
  1099. 51:54the errors and the complications can
  1100. 51:56compound over these different steps. Um
  1101. 52:01if we want the model to and the another
  1102. 52:04focus of this paper is enabling tool use
  1103. 52:06like teaching the model to write to use
  1104. 52:08the right tools for example a calculator
  1105. 52:11Python executor and so on. Using these
  1106. 52:14tools live during the training process
  1107. 52:17can be very challenging because tools
  1108. 52:20can fail they can be slow and the
  1109. 52:22training process is already kind of like
  1110. 52:25time consuming and challenging. So this
  1111. 52:27can further slow that down. Um
  1112. 52:31and if you look back in terms of like
  1113. 52:34the fine-tuning processes such as
  1114. 52:36reinforcement learning from human
  1115. 52:38feedback from AI feedback or execution
  1116. 52:41feedback many of these are optimized on
  1117. 52:44the singlestep kind of are optimized for
  1118. 52:47singlestep task. Basically the model
  1119. 52:50takes a lot of whatever it wants to do
  1120. 52:52generates a final answer and the reward
  1121. 52:55is just based on the final answer
  1122. 52:57whether it's correct or not and then we
  1123. 52:59kind of back propagate that towards a
  1124. 53:01actions and here we want to have a more
  1125. 53:04have a have more kind of governance and
  1126. 53:07kind of uh
  1127. 53:10uh on the process of generating these
  1128. 53:12steps and how we can optimize them. Uh
  1129. 53:16so this framework called swirl um
  1130. 53:20and the design goal for SAR is the
  1131. 53:23following. First of all
  1132. 53:26at a high level we want the model to
  1133. 53:27solve complex uh problem and multi-step
  1134. 53:30reasoning task. Um we want the model to
  1135. 53:33know when to call a tool. Um generate
  1136. 53:37the right queries to invoke a tool
  1137. 53:39because we need to know how to use a
  1138. 53:42tool like the model needs to know that.
  1139. 53:44um carry out these reasoning steps and
  1140. 53:47maintain accuracy across them um and
  1141. 53:51learn to how to recover from error and
  1142. 53:55learn to when to stop taking new steps
  1143. 53:57and calling new tools and be and say
  1144. 54:01okay I'm now ready to generate a final
  1145. 54:03answer. So we want the model to know
  1146. 54:05these steps. We also uh want to avoid
  1147. 54:08using tools during the training process
  1148. 54:13uh because like I mentioned this can be
  1149. 54:14slow tools can fail and we we and can
  1150. 54:18have bugs. We want to avoid that and
  1151. 54:21ideally we want the model to generalize
  1152. 54:23this. So ideally we want the model to
  1153. 54:26learn how to you when to adapt to new
  1154. 54:29tools and new reasoning uh tasks and
  1155. 54:32capabilities.
  1156. 54:34So to approach this the um here's the
  1157. 54:39here's the process. The first step of
  1158. 54:42this process is that let's start with
  1159. 54:45creating synthetic
  1160. 54:48let's start with creating synthetic
  1161. 54:49multi-step data for a model. So given a
  1162. 54:53prompt um and in order to really like
  1163. 54:56annotate these steps, let's have the
  1164. 54:59model um take one step at a time and
  1165. 55:06let the model know at each step that is
  1166. 55:08free to reason, create a chain of
  1167. 55:10thought, call a tool, um or propose a
  1168. 55:14final answer. So having an input prompt
  1169. 55:18at step one, we tell the model, you have
  1170. 55:21access to these tools. Uh you can
  1171. 55:24generate a reasoning step. If you're
  1172. 55:26ready to to generate the final answer,
  1173. 55:29just say that and create that. U so
  1174. 55:32given this prompt, the model can would
  1175. 55:35take the first action which could be a
  1176. 55:39reasoning step followed by the by a tool
  1177. 55:41call and then we show the model the
  1178. 55:43environment response.
  1179. 55:45Um
  1180. 55:49so given that then we ask the model
  1181. 55:52again we show the model again the same
  1182. 55:54prompt but this time we have kind of the
  1183. 55:57context from the previous step. So
  1184. 56:00basically we say here is the original
  1185. 56:02prompt here is the previous action and
  1186. 56:05here is the result of taking that action
  1187. 56:07from the environment. You can take a new
  1188. 56:09action which is and call the tool or if
  1189. 56:14you're ready to create the final answer
  1190. 56:16just uh output the final answer. So by
  1191. 56:20design we are this through through this
  1192. 56:22adapt to iterative prompting we are
  1193. 56:25creating this multi-step data set and
  1194. 56:28the steps can be from one to three or
  1195. 56:31five and so on for different queries.
  1196. 56:35um
  1197. 56:37the then we need kind of a label. We
  1198. 56:40want to to um have an a notation of how
  1199. 56:44good this uh step is. And to do to do
  1200. 56:48so, we can we ask an LLM as a judge
  1201. 56:51given the prior context and the current
  1202. 56:54action which is a reasoning state
  1203. 56:57followed by a tool call give us a reward
  1204. 56:59function. give us like your estimate of
  1205. 57:02how good this uh kind of trajectory and
  1206. 57:05final action is.
  1207. 57:10Um given that we have for each query and
  1208. 57:13reason we have a set of steps and for
  1209. 57:16each step we have a LLM as a judge kind
  1210. 57:19of like score that is assigned to that
  1211. 57:22step and we can do that offline. We can
  1212. 57:24go through many many questions in
  1213. 57:26parallel offline and generate these
  1214. 57:28steps and uh labeled annotations.
  1215. 57:33Once we have these uh steps per prompt,
  1216. 57:37we can filter this data in different
  1217. 57:39ways. For example, um we can only keep
  1218. 57:43the data where the the judge LLM as a
  1219. 57:46judge kind of decided every single step
  1220. 57:49was a good kind of step. Every single
  1221. 57:52action was good. Or we can go based on
  1222. 57:55outcome filter data and that would be we
  1223. 57:58just keep we keep all the trajectories
  1224. 58:00that the final answer was correct no
  1225. 58:02matter what the label per step was. And
  1226. 58:04we're going to see how these two kind of
  1227. 58:06deferred with each other. But the whole
  1228. 58:09part the whole pro the whole kind of
  1229. 58:11like intuition motivation behind this
  1230. 58:14part is that for for these reasoning pro
  1231. 58:17prompts we have a number of pre like a
  1232. 58:21number of steps and then for each step
  1233. 58:24we have a reward uh created by the model
  1234. 58:26which we can use or not use during our
  1235. 58:29training. But let's see how these two
  1236. 58:30play out. Um then having this data that
  1237. 58:35we have generated offline we can start
  1238. 58:38the training process and this training
  1239. 58:40in this part is done based on
  1240. 58:42reinforcement learning. So maybe you can
  1241. 58:44pay attention to this figure on the
  1242. 58:46right. Um this is a very simple example
  1243. 58:49but let's go through that. Who is older?
  1244. 58:51Glenn who I don't know the last name or
  1245. 58:54Rossling. So these two people who is
  1246. 58:56older. So action one is to figure out
  1247. 59:00who is older. I should first search for
  1248. 59:03age of the first person.
  1249. 59:07Then we have a reward for this action.
  1250. 59:09We ask the judge LLM as a judge to say
  1251. 59:12given an input prompt and this action
  1252. 59:15what is the reward for this uh step.
  1253. 59:19Then we have the then we actually go and
  1254. 59:23um
  1255. 59:25show the model um the result of this
  1256. 59:28step. This is already we have in our
  1257. 59:30training data. So we have the
  1258. 59:32environment resp response and then we
  1259. 59:34prompt the model to to take the next
  1260. 59:36action and in the next action is the
  1261. 59:39second question which is about the age
  1262. 59:40of the second person. We have a reward
  1263. 59:43based on that and at the last stage we
  1264. 59:48say given the result of the previous
  1265. 59:50searches we we ask the model to generate
  1266. 59:53the final another action. In this case
  1267. 59:55the model seems to be ready to to output
  1268. 59:58the final answer. So it outputs the
  1269. 1:00:01answer in these tags answer and u and uh
  1270. 1:00:06uh the final answer is there and we can
  1271. 1:00:09get a reward based on that. Uh so the
  1272. 1:00:11point that I want you to pay attention
  1273. 1:00:13to is how we manage to not have the tool
  1274. 1:00:16calls during training. So basically what
  1275. 1:00:20we are doing here is that we have this
  1276. 1:00:22trajectory from the prompt and from
  1277. 1:00:25these um kind of uh pre pre-esign pre
  1278. 1:00:30kind of collected actions and tool calls
  1279. 1:00:34during RL process we get the reward we
  1280. 1:00:38show the the prompt and steps and
  1281. 1:00:41actions onto that action K in this case
  1282. 1:00:44for example up to action one and the
  1283. 1:00:47environment response
  1284. 1:00:48And then that we ask the model to take
  1285. 1:00:51the next step. So this is the part that
  1286. 1:00:53is done during training. The the model
  1287. 1:00:55takes the next action but before but we
  1288. 1:00:59don't need to execute that action or
  1289. 1:01:01call the tool. We just collect a reward
  1290. 1:01:04based on that um specific action um and
  1291. 1:01:09use that for RL optimization. All the
  1292. 1:01:11tool calls are just done during the data
  1293. 1:01:14annotation process outside of the RL
  1294. 1:01:16fine-tuning part. Um because we realize
  1295. 1:01:19that the model the the LLMs just does a
  1296. 1:01:22good job based on the quality of the
  1297. 1:01:24action that's proposed. We're good on
  1298. 1:01:28just evaluating that. We don't need to
  1299. 1:01:30get execute the action and evaluate
  1300. 1:01:33that. So that's how we separated the
  1301. 1:01:35two.
  1302. 1:01:42We so we did not need we did not train
  1303. 1:01:45an LLM as a judge for this. We just
  1304. 1:01:47prompted uh I I'll talk about what
  1305. 1:01:49models we used for each one.
  1306. 1:01:52So there was no training for that.
  1307. 1:01:55>> But if you if the judge cannot see the
  1308. 1:01:58real like
  1309. 1:02:01from
  1310. 1:02:04how can like judge
  1311. 1:02:07>> Yeah. So the jud So the question is if
  1312. 1:02:09the judge cannot see the output of the
  1313. 1:02:11tool how can it give a reasonable score.
  1314. 1:02:14So the here's the the point here. So we
  1315. 1:02:17are asking the judge to judge the
  1316. 1:02:21quality of the the query that is
  1317. 1:02:23generated by the model to call the tool
  1318. 1:02:26rather than the output of the tool. Like
  1319. 1:02:29here what the judge sees is that the
  1320. 1:02:31model is asking age of this person right
  1321. 1:02:35and the model can judge that this is a
  1322. 1:02:38good kind of question to create for the
  1323. 1:02:40search engine
  1324. 1:02:42it before seeing the result of the
  1325. 1:02:45search engine right the model doesn't
  1326. 1:02:46need to know the age of this person to
  1327. 1:02:48know this question was good or bad this
  1328. 1:02:50is a good question this is a reasonable
  1329. 1:02:52question right
  1330. 1:02:56Um
  1331. 1:02:59so basically what we are doing is
  1332. 1:03:01providing this process feedback process
  1333. 1:03:04reward for this step and the tool calls
  1334. 1:03:07are captured in the prior context. So
  1335. 1:03:10all of these tool call resources is we
  1336. 1:03:12have collected them in our offline
  1337. 1:03:14training data set. We are not doing that
  1338. 1:03:16during during the actual RL fine-tuning.
  1339. 1:03:21So um to just show you the objective
  1340. 1:03:24function that we that is being optimized
  1341. 1:03:26in this multi-step RL is
  1342. 1:03:30let's say we have a number of steps S S1
  1343. 1:03:33to SK and then each followed by an
  1344. 1:03:36action which is a reasoning step
  1345. 1:03:38followed by a tool call. What we are
  1346. 1:03:41doing here is that we are optimizing the
  1347. 1:03:43expected reward of an action of a single
  1348. 1:03:47action given all the context so far
  1349. 1:03:50which is a set of states and actions
  1350. 1:03:52that we have collected off.
  1351. 1:03:59Um so that's [snorts] how we are
  1352. 1:04:01optimizing the expected reward of an
  1353. 1:04:04action of a single action in a
  1354. 1:04:06multi-step process given all the prior
  1355. 1:04:08steps. But of course this action this
  1356. 1:04:12varies from action one all the way to
  1357. 1:04:14action K.
  1358. 1:04:18Um now during inference
  1359. 1:04:21once we RL this model we let's walk
  1360. 1:04:24through an inference process of how we
  1361. 1:04:26encourage the model to do this
  1362. 1:04:28multi-step process. So for example here
  1363. 1:04:31the the user the prompt is help me
  1364. 1:04:33answer the following questions uh in
  1365. 1:04:36just a few words.
  1366. 1:04:39uh and then we uh specify the tool that
  1367. 1:04:41the model can use. In this case, a
  1368. 1:04:43calculator. If you think it would help
  1369. 1:04:45to use a calculator, please generate a
  1370. 1:04:47mathemat mathematical query uh enclosed
  1371. 1:04:50by this kind of these kind of tags. Um
  1372. 1:04:55and then
  1373. 1:04:57we also tell the model once you have
  1374. 1:04:59enough information you can generate an
  1375. 1:05:02answer tag and generate the final
  1376. 1:05:04answer. So through these tags, the model
  1377. 1:05:07can tell us the tool call um or or or if
  1378. 1:05:11it's ready to generate the final answer.
  1379. 1:05:13So here is the input question. Uh so in
  1380. 1:05:18step one, the model is prompted um here
  1381. 1:05:21is the input question. The model u uh
  1382. 1:05:24responses to that question. uh and it in
  1383. 1:05:27this response is calling it the
  1384. 1:05:29calculator and it's calling this uh kind
  1385. 1:05:32of like this is the math that it wants
  1386. 1:05:34to run. The user provides that um output
  1387. 1:05:38like basically that tool is executed
  1388. 1:05:40with that given input. We give the
  1389. 1:05:43output to the model and then the model
  1390. 1:05:45is prompted again
  1391. 1:05:47again here is the input here is the
  1392. 1:05:50result from the previous kind of like
  1393. 1:05:53thinking process and tool call. Um and
  1394. 1:05:56the model takes the next action and and
  1395. 1:05:59next action and so far. Um so we are
  1396. 1:06:02kind of iteratively prompt the model.
  1397. 1:06:04Here is what happened so far. Here's the
  1398. 1:06:06tool you have. If you're ready to
  1399. 1:06:07generate the final answer, do it. If
  1400. 1:06:10not, continue using the tool.
  1401. 1:06:16So the experimental setup for this
  1402. 1:06:18approach was the following. We have
  1403. 1:06:19there is a uh mod GMO 227B
  1404. 1:06:24used to was used to create this
  1405. 1:06:26multi-step synthetic data. Uh the
  1406. 1:06:29questions were coming from hotspot QA
  1407. 1:06:31and GSM8K.
  1408. 1:06:33uh we had something like 50k
  1409. 1:06:36trajectories
  1410. 1:06:38uh sourced from a number of problems and
  1411. 1:06:40created for uh different kinds of data
  1412. 1:06:43that were like I said we can process
  1413. 1:06:46this data that we created based on
  1414. 1:06:49process filter
  1415. 1:06:51outcome filtered both process and uh
  1416. 1:06:54outcome filtered or random and then we
  1417. 1:06:56also corrected a number of trajectories
  1418. 1:06:58I think um so let's take a look at
  1419. 1:07:02impact of data of filtering on the
  1420. 1:07:04performance of swirl. Um one perhaps in
  1421. 1:07:10the beginning this was non-intuitive but
  1422. 1:07:12we kind of realized what why this is
  1423. 1:07:14happening is that it seems like when our
  1424. 1:07:17training data was only process filtered
  1425. 1:07:20meaning we took reasoning steps that
  1426. 1:07:23were majority like uh uh voted yes by
  1427. 1:07:28LLM as a judge from the reasoning steps
  1428. 1:07:30but we kind of like didn't filter them
  1429. 1:07:33based on the correctness of final
  1430. 1:07:34answer. This seems to help the the
  1431. 1:07:37process more the the training more than
  1432. 1:07:41if we kind of rigorously
  1433. 1:07:43uh only took trajectories where the
  1434. 1:07:46outcome was uh correct or both process
  1435. 1:07:49and outcome were correct. Um, and the
  1436. 1:07:52reason for that is if we only get
  1437. 1:07:54trajectories where the model already
  1438. 1:07:57knows the outcome and is correct,
  1439. 1:07:59perhaps you're not helping the model
  1440. 1:08:01solve problems that it couldn't solve
  1441. 1:08:03during test time because you're training
  1442. 1:08:05it to think differently about these
  1443. 1:08:07problems. So, it can solve new problems
  1444. 1:08:10that it couldn't solve before, but it
  1445. 1:08:12had kind of gotten the some processes uh
  1446. 1:08:15correctly.
  1447. 1:08:18Um but perhaps the most interesting and
  1448. 1:08:21this is again something that we are
  1449. 1:08:23seeing in the sprint project as well is
  1450. 1:08:26the generalization performance of the
  1451. 1:08:29model. So for example we had a swirl on
  1452. 1:08:33GSM8K. These are math problems and we
  1453. 1:08:35were teaching the model to use like simp
  1454. 1:08:39calculator basically to solve these
  1455. 1:08:41problems. Uh so that was the training
  1456. 1:08:44data and then we when once we kind of
  1457. 1:08:47did do this multi-step RL optimization
  1458. 1:08:50using GSM8K we then tested on hotspot QA
  1459. 1:08:54and this is the accuracy that uh
  1460. 1:08:57increase that we get from the base
  1461. 1:08:59model. So it goes from 65 to 751.
  1462. 1:09:03And if we were to use exactly hotspot QA
  1463. 1:09:07and in this case the tool for hotspot QA
  1464. 1:09:09was a search tool uh not a calculator
  1465. 1:09:12the optimization the increase was from
  1466. 1:09:1565 to 73. So and vice versa this was
  1467. 1:09:19true as well. If we train the model on
  1468. 1:09:21hotspot QA with a search tool it could
  1469. 1:09:23also do well on GSM8K with Python. So it
  1470. 1:09:27seems like there is something going
  1471. 1:09:29beyond just like learning to use a
  1472. 1:09:32specific tool. Rather the model is
  1473. 1:09:35learning how to think in steps and how
  1474. 1:09:39learn how to invoke a tool. Um and and
  1475. 1:09:42this was perhaps u and and these data
  1476. 1:09:44sets the other data sets are separate uh
  1477. 1:09:47from uh any of our training data.
  1478. 1:09:51Uh another uh important observation here
  1479. 1:09:54was that again in this case we were the
  1480. 1:09:58model is being trained on hotspot QA
  1481. 1:10:01using a search tool for all of these but
  1482. 1:10:04we are showing the test results um as we
  1483. 1:10:07are increasing this synthetic data the
  1484. 1:10:10training data size. So it seems like as
  1485. 1:10:12we go from 100 training examples to uh
  1486. 1:10:1510,000 training examples even at
  1487. 1:10:18inference the model is improving on a
  1488. 1:10:21completely different task which is math
  1489. 1:10:23problems and GSM8K.
  1490. 1:10:25So this is like again u I think it's the
  1491. 1:10:29most important graph from this paper
  1492. 1:10:31showing that by creating synthetic data
  1493. 1:10:35in environments that are perhaps like
  1494. 1:10:38easier to create create these data for
  1495. 1:10:41and teaching the model how to use these
  1496. 1:10:43tools and how to do think uh in multi
  1497. 1:10:46multiple steps. We can generalize these
  1498. 1:10:50behavior to entirely new tools and
  1499. 1:10:52domains. And perhaps scaling this up
  1500. 1:10:55could be a very um kind of imp powerful
  1501. 1:11:00uh methodology.
  1502. 1:11:04Um
  1503. 1:11:05and here we are showing some results on
  1504. 1:11:10the like to to kind of try to interpret
  1505. 1:11:14why the model is becoming better uh by
  1506. 1:11:17in through this RL processes. And what
  1507. 1:11:21we did here is to look into the average
  1508. 1:11:23kind of process reward per step of the
  1509. 1:11:27model in answering these questions
  1510. 1:11:29before and after being fine-tuned uh
  1511. 1:11:33through this reinforcement learning
  1512. 1:11:35process. And perhaps this is again very
  1513. 1:11:38intuitive that the process correctness
  1514. 1:11:40of the model has improved throughout
  1515. 1:11:43this process for both in distribution
  1516. 1:11:46domain where we train on hotspot QA and
  1517. 1:11:48out of dist out of distribution when we
  1518. 1:11:50just tested on GSM8K. So the model
  1519. 1:11:53thinks more correctly per step both for
  1520. 1:11:58on the training data but on other but
  1521. 1:12:00out of distribution data. And here are
  1522. 1:12:03some other results um that uh we can
  1523. 1:12:06also be look also looked into precision,
  1524. 1:12:09recall and other metrics across a number
  1525. 1:12:11of tasks. Um
  1526. 1:12:15um and um here are how this works
  1527. 1:12:18compared to frontier models. Um
  1528. 1:12:23something that is uh perhaps it's worth
  1529. 1:12:28noting here is that
  1530. 1:12:31we could do all of this that all of this
  1531. 1:12:33process that we did with RL we could do
  1532. 1:12:35it with supervised finetuning as well
  1533. 1:12:39and it turns out that this multi-step RL
  1534. 1:12:41does better by a good amount over
  1535. 1:12:44supervised finetuning
  1536. 1:12:47uh and especially for supervised
  1537. 1:12:49finetuning it seemed like the model
  1538. 1:12:51really benefited like the training data
  1539. 1:12:54needed to be correct like both process
  1540. 1:12:57and outcome filtered um supervised
  1541. 1:13:00finding on that kind of training data
  1542. 1:13:02worked better than when we only uh when
  1543. 1:13:05we selected only the process filtered
  1544. 1:13:08data and it kind of makes sense because
  1545. 1:13:10in supervised fine-tuning we're kind of
  1546. 1:13:13it's kind of an imit imitation learning
  1547. 1:13:16right we're showing these are the
  1548. 1:13:17trajectories and we want the model to
  1549. 1:13:19repeat those in a Okay. Uh whereas in
  1550. 1:13:21the and then if they're incorrect, the
  1551. 1:13:23outcome is incorrect. It might hurt
  1552. 1:13:25performance. Whereas in RL, we are
  1553. 1:13:28giving the model a new chance in in to
  1554. 1:13:31take a new action given the prior steps
  1555. 1:13:34and we are kind of giving a reward based
  1556. 1:13:36on that new action and that's how it can
  1557. 1:13:38break out from this. Um and here are
  1558. 1:13:43some other results. Um but because we're
  1559. 1:13:47out of time let's just take a look at
  1560. 1:13:49the summary of this. Uh so again a
  1561. 1:13:53important observation was that sort
  1562. 1:13:56generalizes across data sets and tools.
  1563. 1:13:59um it transfers to desperate task. H and
  1564. 1:14:03the model learns better from process
  1565. 1:14:05filtered data and it can get get a lot
  1566. 1:14:08of gains from more synthetic data both
  1567. 1:14:11for in domain and out of domain and um
  1568. 1:14:15and from an just understanding why this
  1569. 1:14:18happens. It turns out that after this
  1570. 1:14:20sort of fine-tuning the process behavior
  1571. 1:14:23like the process correctness of the
  1572. 1:14:25model improves. So if we just go to
  1573. 1:14:27evaluate that the model becomes better
  1574. 1:14:30at this multi-step um thinking um again
  1575. 1:14:34this is true for both in distribution
  1576. 1:14:36and out of distribution uh data and with
  1577. 1:14:39that you can conclude this lecture.
  1578. 1:14:42I hope you learn more about multistep
  1579. 1:14:44and reasoning and planning which is a
  1580. 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.