YouTube2Text

YouTube transcript (Lxh9RF5S-K0) — Transcript

12,681 words · 1,887 segments · language en · Watch on YouTube

Full transcript

  1. 0:05In the first lecture, what that we
  2. 0:07covered is that large language models
  3. 0:08are really good at solving natural
  4. 0:11language processing problems. And
  5. 0:13[snorts] I think most of you are very
  6. 0:14familiar with using them in chatbot kind
  7. 0:16of scenarios. But to make them useful in
  8. 0:19real world tasks, they do need to be
  9. 0:20able to interact with real world
  10. 0:23environments, tools, and code and learn
  11. 0:26from what they interact with. So you
  12. 0:29already saw some examples of test time
  13. 0:32compute and robust verification that
  14. 0:33Asia covered in the last two lectures.
  15. 0:35Now we'll build a little bit more on top
  16. 0:37of that. Okay. So today's lecture we
  17. 0:40will focus on three different papers.
  18. 0:42The first paper will start with the
  19. 0:44notion of tool calling and how can we
  20. 0:47get the models to go beyond just uh
  21. 0:49reasoning to also take into account
  22. 0:52actions via tool calls. And the paper
  23. 0:54that we'll cover here is called React
  24. 0:56which actually was one of the first that
  25. 0:58went around to combine reasoning and
  26. 1:00acting in language models. The second
  27. 1:03paper that we'll look into is RLEF or
  28. 1:06grounding code LLMs in execution
  29. 1:09feedback. What this will focus on is how
  30. 1:12do you how do you actually do code
  31. 1:14generation by using execution feedback
  32. 1:17from like being able to run the code or
  33. 1:19run the tests of the code. And the third
  34. 1:21thing that we'll look into is uh
  35. 1:23constitutional AI where we use the mo
  36. 1:25model critiquing itself uh as a feedback
  37. 1:28loop to improve the model. So all three
  38. 1:30of those techniques are ways for the
  39. 1:32model to improve itself. But what
  40. 1:34differs in each of these techniques is
  41. 1:36where is the feedback coming from? It's
  42. 1:38some form of interaction with either the
  43. 1:40environment or some form of critique
  44. 1:42mechanism or grounding using what we
  45. 1:45know should be the right answer.
  46. 1:48So let's start with um
  47. 1:51just uh let's start with tool calling as
  48. 1:54the first abstraction.
  49. 1:56So what React really uh tried to focus
  50. 2:00on was this notion of when humans want
  51. 2:02to go and do some action, they think
  52. 2:04about it first. For example, if you
  53. 2:06decide that you want to come take a
  54. 2:08class, you think about how that might
  55. 2:10actually help you. Um
  56. 2:13[snorts] and uh what this roughly means
  57. 2:15is that once you have thought about it
  58. 2:19then you will have a reason to act and
  59. 2:21then based on that action you might
  60. 2:22observe that you have a new observation
  61. 2:25about the environment. So like once you
  62. 2:26come to the class you might decide you
  63. 2:27like the class or you don't like the
  64. 2:29class and based on that information you
  65. 2:31come up with new reasoning. Maybe you'll
  66. 2:33go do the homework and then that will
  67. 2:35make you decide something else. So there
  68. 2:37is this loop between thinking and action
  69. 2:39that helps us function as humans.
  70. 2:41A similar loop can be very useful in
  71. 2:44terms of refining what uh language
  72. 2:47models generate. And typically when you
  73. 2:50look at language models um they have
  74. 2:53struggle to combine reasoning and acting
  75. 2:55by themselves as isolated processes. In
  76. 2:58today's models the reasoning has become
  77. 2:59innate because thinking has become part
  78. 3:01of the models. But if you look at the
  79. 3:03history of the LMS in the last couple of
  80. 3:05years this was not something that came
  81. 3:07out of the box. And one of the
  82. 3:09challenges of why it was hard for models
  83. 3:12to combine reasoning and acting is
  84. 3:13because they typically will hallucinate.
  85. 3:16They will have no context of what is
  86. 3:18actually happening in the environment.
  87. 3:20So for example, if you were to type into
  88. 3:22a model like Gemini or Chad GPT or
  89. 3:25claude um what is the temperature uh
  90. 3:28today? What is where where is something
  91. 3:30happening today? It has no information
  92. 3:33about the current events unless it
  93. 3:35actually goes and does a search call and
  94. 3:37then fetches that information. So it has
  95. 3:40no notion of grounding in the real
  96. 3:42world. And as a result of that, it
  97. 3:45cannot go and take actions and then
  98. 3:47actually uh combine that back into
  99. 3:49reasoning. So React was one of the first
  100. 3:51abstractions that tried to combine it in
  101. 3:53a way that would be effective. And and
  102. 3:55what you see today's models do is
  103. 3:57actually go beyond React to do this in
  104. 4:00in the chain of thought. itself. So
  105. 4:02let's take a look at what we covered in
  106. 4:04lecture one. So if you look at chain of
  107. 4:07thought by itself, chain of thought
  108. 4:09already gives the model some sense of
  109. 4:11reasoning. So if you gave it a math
  110. 4:12problem, the model will show the steps
  111. 4:14the intermediate steps it takes to get
  112. 4:17to the answer. But these steps may or
  113. 4:19may not be grounded because they don't
  114. 4:20they are based on model's internal
  115. 4:22state. They have no feedback from the
  116. 4:24external world. And then there is a
  117. 4:25second class of uh LMS that were
  118. 4:27developed for example web GBT which go
  119. 4:29and interact with say web browsers and
  120. 4:32what they're basically learning is how
  121. 4:33to interact with web browsers or which
  122. 4:36is a form of a tool. So they don't
  123. 4:38necessarily have a reasoning process but
  124. 4:40they're basically learning how to go
  125. 4:42interact with uh web browsers. So you
  126. 4:44basically can fine-tune on traces that
  127. 4:46are uh interaction traces with web
  128. 4:48browsers and then what do humans prefer
  129. 4:50and not. But as a result of those two
  130. 4:53different things, one is focused more on
  131. 4:55reasoning and one is focused more on
  132. 4:56actions. How do we combine these two
  133. 4:59paradigms where we can both reason and
  134. 5:01act in an uh in a useful way? A very
  135. 5:04simple abstraction that React came up
  136. 5:06with was uh just using prompting you can
  137. 5:08get the model to generate verbal
  138. 5:10reasoning traces. So first you say okay
  139. 5:12I want to want the model to go do this
  140. 5:14task and ask the model to think say step
  141. 5:17by step about it and then it comes back
  142. 5:19with its reasoning trace. You append
  143. 5:21that in the prompt and then you say okay
  144. 5:23what action should be taken based on
  145. 5:25that and then you go take an action.
  146. 5:27This really helps the model improve
  147. 5:29performance where grounding matters. So
  148. 5:32hotspot QA for example is a question
  149. 5:34answering task. Then fever is a
  150. 5:35fact-checking task. So these require
  151. 5:37real world knowledge. They require
  152. 5:39knowledge about what is happening in the
  153. 5:40world. And then web shop for example is
  154. 5:43an task where you're supposed to uh ask
  155. 5:46the model to go buy products on the
  156. 5:48internet. So it's supposed to do a
  157. 5:49series of tool calls to actually
  158. 5:51identify what product to search and then
  159. 5:54have sequence of those actions to
  160. 5:55actually complete the purchase for the
  161. 5:57user. So each of these tasks requires
  162. 6:00some notion of grounding in the real
  163. 6:02world and without that grounding um it's
  164. 6:04not possible for the model to keep
  165. 6:06making progress. A second benefit of
  166. 6:08having uh the model explicitly do
  167. 6:11reasoning and action steps is that it
  168. 6:14will allow the model to give traces that
  169. 6:16are more interpretable. And
  170. 6:17interpretable allows um humans to like
  171. 6:21really trust the model's responses. It's
  172. 6:22almost like getting the model to break
  173. 6:24down uh what it's doing step by step.
  174. 6:28So what you might be familiar with is
  175. 6:29that if you prompt the LLM and you ask
  176. 6:31it to think step by step which we were
  177. 6:34showing in uh earlier uh examples then
  178. 6:37you will get some form of a reasoning
  179. 6:38trace where it shows its intermediate
  180. 6:40steps and then if you ask the model to
  181. 6:42say do a tool call like go search for
  182. 6:45example um Google or find the
  183. 6:48temperature it will go call an API and
  184. 6:50it will get a bunch of observations. So
  185. 6:51that would be action only. Um typically
  186. 6:54you will have a list of actions if you
  187. 6:56have a give uh if you have a list of two
  188. 6:58calls that you are valid. What react
  189. 7:01does is it will take a goal and have
  190. 7:04some form of reasoning. So that will be
  191. 7:06the left loop and then based on those
  192. 7:07reasoning chains it will go and act that
  193. 7:09will be the loop in the right.
  194. 7:14So what what this is setting up is a
  195. 7:16full agent in in itself where you have
  196. 7:19some observations about the world and
  197. 7:21then some set of actions based on what's
  198. 7:23the context and if you were to for
  199. 7:24example take this entire context with
  200. 7:27observations and the set of actions that
  201. 7:28have happened in the past typically you
  202. 7:31could go learn a policy but that would
  203. 7:32like require a full loop of which will
  204. 7:35be complex and expensive but you can
  205. 7:37actually start doing this in language
  206. 7:39space which is what react is doing where
  207. 7:40it's basically just generating the
  208. 7:43thoughts in the language space and those
  209. 7:46thoughts are not affecting the
  210. 7:47environment and then based on those
  211. 7:48thoughts it's then going and taking an
  212. 7:50action just in the prompting space. So a
  213. 7:52very simple abstraction of how to prompt
  214. 7:54the models to start thinking about these
  215. 7:57things and and and generate uh actions
  216. 8:00which are valid. One interesting concept
  217. 8:02I'll mention here is that when you get
  218. 8:04the models to generate actions uh in
  219. 8:06this particular slide typically how do
  220. 8:09you know that these actions are valid?
  221. 8:11So one typical way in which you get
  222. 8:13these models to generate um correct
  223. 8:16actions is to give them uh more uh to
  224. 8:20frame the problem more as a
  225. 8:21classification task. So you say that
  226. 8:22this is the valid subset of actions and
  227. 8:25then use that as a way to say okay here
  228. 8:27is your reasoning here's the state of
  229. 8:29the world and here is what are the valid
  230. 8:30set of actions to go take next and then
  231. 8:32based on that it goes and decides okay
  232. 8:34this is the action to take and then that
  233. 8:36generally provides a more grounded
  234. 8:38response and in fact this was also used
  235. 8:40in another paper that uh we worked on in
  236. 8:43collaboration at Google with robotics
  237. 8:45folks where the state of the world and
  238. 8:48all of that requires very valid action
  239. 8:50so you can't really operate uh without
  240. 8:52having a list of actions. So that
  241. 8:54provides one way to like really grounded
  242. 8:55knowledge and what actions to take next.
  243. 8:59[snorts] Okay. So in terms of
  244. 9:01implementing this idea and uh in a very
  245. 9:04simple way this was done uh with uh this
  246. 9:07is this is an older model but with the
  247. 9:09pal model with a frozen LLM in few short
  248. 9:12examples the model was given some
  249. 9:14actions some thoughts and some
  250. 9:15observations and then asked to go take
  251. 9:17the next action. So for the reasoning
  252. 9:19traces, it was basically seeing actions
  253. 9:21and thoughts. I'll show you an example.
  254. 9:23And for the decision tasks, it it was
  255. 9:25basically looking at what's the state of
  256. 9:27the world, what is the thinking and then
  257. 9:30deciding whether to reason and whether
  258. 9:32to take action next. So you can either
  259. 9:34go and reason or you can decide whether
  260. 9:36I have to reason or take action next. So
  261. 9:39let's look through an example and walk
  262. 9:41through it carefully. So this is uh like
  263. 9:45aside from the Apple remote, what other
  264. 9:47device can control the program Apple
  265. 9:50report uh remote was originally designed
  266. 9:52to interact with? So this is basically a
  267. 9:54question from hot pot QA. If you
  268. 9:57basically just do standard prompting,
  269. 9:59the answer that will come back will not
  270. 10:01be correct. Now you can do chain of
  271. 10:03thought where you basically ask the
  272. 10:04model to go things step by step. It's
  273. 10:06showing you all the intermediate steps
  274. 10:08here. However, um the answer is still
  275. 10:11not coming out to be completely correct.
  276. 10:13Um
  277. 10:15now let's see if we ask it to take some
  278. 10:17actions where it can like do some
  279. 10:19grounded knowledge and it can call do
  280. 10:21some search calls. So it goes and sees
  281. 10:22that okay the thing that I'm really
  282. 10:24needing more information on is Apple
  283. 10:27remote. So it goes and does an action on
  284. 10:30Apple remote. It gets some observation.
  285. 10:32Then it goes and does another search
  286. 10:34call on front row uh which is some text
  287. 10:37that is there in observation one and
  288. 10:40then follow continues to follow on and
  289. 10:42then it's like realizes that okay this
  290. 10:45is a discontinued something. So as a
  291. 10:47result there's not really a good answer
  292. 10:49that it can give.
  293. 10:52Now how does thinking and action like
  294. 10:55interle those traces help? So here it
  295. 10:58thinks first that okay I have to search
  296. 10:59for Apple remote and then find the
  297. 11:01program it was originally designed to
  298. 11:03interact with. So it first goes and
  299. 11:05searches Apple remote. It finds the
  300. 11:07information that it's a remote control
  301. 11:09introduced very early on like 2005 two
  302. 11:12decades ago and it was originally
  303. 11:14designed to control the front row media
  304. 11:17center. Then it thinks okay so I need to
  305. 11:20search front row next. So it goes and
  306. 11:22searches for this. It's not able to find
  307. 11:24it. So then it comes up with a new
  308. 11:26terminology called front row software
  309. 11:28and then it searches that and it's able
  310. 11:30to figure out okay it's a discontinued
  311. 11:31media software center and then it thinks
  312. 11:34about it again. So it's able to give an
  313. 11:37answer based on that. So basically uh
  314. 11:40the reasoning process is an abstraction
  315. 11:42which allows it to come back with better
  316. 11:44answer than just taking actions and then
  317. 11:46coming back with answers in between and
  318. 11:48and uh interlection
  319. 11:51and the observation aspect is basically
  320. 11:53allowing the model to behave better. Now
  321. 11:56what is happening in the LLMs today
  322. 11:58where for example if you go in the
  323. 11:59thinking mode of say Quen or um other
  324. 12:02models you'll see this happening
  325. 12:04automatically. So if you actually turn
  326. 12:05on the thinking mode in sequent models,
  327. 12:07you'll see all of this starting to
  328. 12:09happen because the models have already
  329. 12:12been distilled on these kind of traces.
  330. 12:13So like the thinking fusion stuff that
  331. 12:15happens and several of the open source
  332. 12:17models already captures this kind of
  333. 12:19things. So they've already learned how
  334. 12:20to do for example tool calls and so on.
  335. 12:23Questions?
  336. 12:27>> Yes. Uh how do you how do does the model
  337. 12:31know what it knows like what to search
  338. 12:33or when to search like clearly you don't
  339. 12:36want to search on plus one but like how
  340. 12:38do you determine search
  341. 12:40>> how do you determine uh I mean here it's
  342. 12:43searching and then it's basically coming
  343. 12:44up with an obs like here it's getting a
  344. 12:46feedback right it doesn't know what it
  345. 12:48knows this is from interaction right
  346. 12:51>> yeah but you already have been trained
  347. 12:53on from roll with the figure page you
  348. 12:56shouldn't need to search right Yes, it
  349. 12:57does. I need to search. Yes.
  350. 12:58>> But does the model know whether it knows
  351. 13:00this?
  352. 13:01>> So, so I think there's contradictory set
  353. 13:04of opinions on whether the model knows
  354. 13:06what it knows. Right? Like there's one
  355. 13:08set of people that will tell you that
  356. 13:10models are very confident in knowing
  357. 13:12what they know. But I think the other
  358. 13:14set is that typically if you were to ask
  359. 13:16the model to rate its output of like
  360. 13:18does do you know are you confident about
  361. 13:19set output? Typically the models are
  362. 13:21overconfident.
  363. 13:23They're not well calibrated. I mean
  364. 13:25that's that's a research problem that is
  365. 13:27still being solved. So uh as a as
  366. 13:31someone who's designing a application
  367. 13:34what you are looking for is not so much
  368. 13:37knowing whether the model knows what to
  369. 13:38know but like getting the model to use
  370. 13:40the right set of tools so that you have
  371. 13:41grounded knowledge.
  372. 13:43>> Does that make sense?
  373. 13:45>> Yes.
  374. 13:46>> With the react framework on the right um
  375. 13:49when you saying with the left loop
  376. 13:51>> you elicited the reasoning to then
  377. 13:53append to original part. Yes.
  378. 13:55>> Will it produce the reasoning of thought
  379. 13:57one, thought two, thought three, thought
  380. 13:59four initially and then it goes and acts
  381. 14:03in each one or does the act influence
  382. 14:05the next reasoning step?
  383. 14:06>> Act it's interle. So it's thought one
  384. 14:10then act one. So it's happening in an
  385. 14:12interle fashion like thought one act one
  386. 14:14thought two act two.
  387. 14:16>> Okay.
  388. 14:17>> Yeah. So it's basically each one is
  389. 14:19informing the next. It's like it's very
  390. 14:21much like the human process. you thought
  391. 14:23about you're thirsty. So you basically
  392. 14:27start walking towards the kitchen. You
  393. 14:28get to the kitchen, maybe water is out.
  394. 14:30So then you decide the next step based
  395. 14:32on that and you so you think that maybe
  396. 14:34you have to go to the supermarket to go
  397. 14:36do something. So it's very sequential in
  398. 14:38that respect. You can do parallel
  399. 14:41sampling and all of those tricks. Uh but
  400. 14:43then you have to explicitly design that
  401. 14:45process.
  402. 14:49Yes,
  403. 14:49>> there's no guarantee that the surgery
  404. 14:51topic should take so L
  405. 14:56is contradicting the surgery.
  406. 15:00>> That's a great question like if the if
  407. 15:02there's contradiction between the
  408. 15:04results then what do you want the like I
  409. 15:08think this is this is a question that
  410. 15:10the user has to decide like if there's
  411. 15:12not enough uh consensus. So typically
  412. 15:16one of the things that we covered in
  413. 15:17second class was that um we can give
  414. 15:20more get more confidence by doing say
  415. 15:22majority voting right so you basically
  416. 15:25say okay or or you have some way of
  417. 15:27validating the answer before you give it
  418. 15:29to the user so for the end application
  419. 15:31what you care about is the answer is
  420. 15:32valid so you need more guard rails.
  421. 15:36Yeah. Yeah.
  422. 15:38But hallucination with search results
  423. 15:41can be controlled much better than just
  424. 15:43depending on the internal state of the
  425. 15:44model.
  426. 15:47>> Other questions?
  427. 15:50>> Yes. But like maybe this is like not
  428. 15:52answerable but I was wondering like from
  429. 15:54the I wonder if people have looked at
  430. 15:55like the KV cache representation of like
  431. 15:58the thought and versus like the
  432. 16:00observation and see if there's any sort
  433. 16:02of interleing like kind of patterns
  434. 16:04between them
  435. 16:05>> given that the observations are
  436. 16:06generally given by the environment right
  437. 16:08they are not generated by the LM itself.
  438. 16:10>> Yes.
  439. 16:10>> So I wonder if that there will be sort
  440. 16:12of this kind of changes you know in
  441. 16:14between
  442. 16:15>> that might be your research project for
  443. 16:17this class. There there are open source
  444. 16:19LMS that you can work with.
  445. 16:24>> Yes,
  446. 16:25>> maybe it's just a termination like
  447. 16:27technology detail but this is like the
  448. 16:31action space of react frame where it's
  449. 16:33like the actions plus the sauce. Why do
  450. 16:37we just think of like sauce internal to
  451. 16:40the policy model and I think maybe the
  452. 16:43action is just like like search or
  453. 16:46finish. Why why do we say like sauce is
  454. 16:49also part of action space?
  455. 16:51>> We're not calling it part of action
  456. 16:52space. We are calling it a separate
  457. 16:54thing. It's like actions are on the
  458. 16:57right loop and the reasoning traces are
  459. 16:59on the left loop. Right?
  460. 17:02>> Oh, you're talking about this one.
  461. 17:05Um so I think because the language
  462. 17:08models are trained on language uh
  463. 17:10typically they benefit from having the
  464. 17:11reasoning tokens in the right
  465. 17:13abstraction as a way to um output the
  466. 17:16right action.
  467. 17:18So so that that's that's the main reason
  468. 17:20to have those tokens. I mean if you had
  469. 17:22intermediate representations then maybe
  470. 17:24it doesn't matter.
  471. 17:28Okay. So let's take a look at some
  472. 17:30results. So the these two tasks hotspot
  473. 17:32QA is a multihub question answering task
  474. 17:35over Wikipedia and then fever is more of
  475. 17:37a factchecking task. The action space in
  476. 17:40these two tasks are very much focused on
  477. 17:41say search over uh Wikipedia pages or
  478. 17:45looking up a certain string or or
  479. 17:47finishing that like okay I have finished
  480. 17:48whatever task I was given. The action
  481. 17:50space is actually very simple. It's
  482. 17:52basically simulating uh the human
  483. 17:54interaction with Wikipedia here.
  484. 17:57So the baselines here are simple where
  485. 17:59you're basically building a prompt the
  486. 18:01standard prompting that you uh will see
  487. 18:03as like simple prompting no thoughts no
  488. 18:06actions no observations chain of thought
  489. 18:08where you're basically asking the model
  490. 18:09to think step by step chain of thought
  491. 18:12self-consistency SC stands for
  492. 18:14self-consistency where you're basically
  493. 18:15doing uh majority voting or
  494. 18:17self-consistency both of those
  495. 18:18terminology is exactly the same thing
  496. 18:20and then ACT uh refers to like there's
  497. 18:22no thinking in between you're basically
  498. 18:24just taking actions and u there is uh
  499. 18:27two variants you will see in the table
  500. 18:28where you can fall back to chain of
  501. 18:30thought self-consistency if react fails
  502. 18:32after a certain steps and then this uh
  503. 18:35if the majority answer occurs less than
  504. 18:37half the time then it can like back off
  505. 18:38to react so you'll see this in the
  506. 18:40results so this is an example of when
  507. 18:43they uh prompted uh this large model
  508. 18:46what they found was that uh react
  509. 18:48generally does better than action only
  510. 18:51it did not always outperform chain of
  511. 18:53thought uh which was interesting uh it
  512. 18:55outperformed chain of thought in the
  513. 18:57case of fever but in case of hot pot Q8
  514. 18:59it did not always outperform but if you
  515. 19:02combined this chain of thought
  516. 19:03self-consistency with uh or either
  517. 19:06fallback or the other way around then
  518. 19:08you do actually outperform u the
  519. 19:10standard techniques. So what that
  520. 19:11roughly tells you is that there's value
  521. 19:13in properly combining the model internal
  522. 19:15knowledge with the external knowledge
  523. 19:17and then using reasoning as an
  524. 19:19intermediate way for the model to arrive
  525. 19:21at the right answer. So basically that
  526. 19:23allows the model to reason uh what is
  527. 19:26the right and accurate information to uh
  528. 19:29retrieve here and it's so and it's
  529. 19:31basically showing that it's able to use
  530. 19:33search as a tool uh to retrieve the
  531. 19:36right information
  532. 19:38and then another interesting aspect here
  533. 19:40is that what this is saying is when when
  534. 19:43it's successful what is happening did it
  535. 19:45get the correct reasoning traces and
  536. 19:47when it's failing what kind of errors
  537. 19:49are happening so one of the things that
  538. 19:51I want to highlight in this slide
  539. 19:52without going through too much detail is
  540. 19:54that in chain of thought hallucination
  541. 19:56ends up being a a major problem a major
  542. 19:58failure mode but in react you basically
  543. 20:00end up having uh grounded information
  544. 20:03and the model is more trustworthy
  545. 20:05because it has access to this external
  546. 20:06knowledge base so it allows it to um
  547. 20:09make fewer errors because it can
  548. 20:11successfully retrieve the knowledge via
  549. 20:13search
  550. 20:15and then there is some difference
  551. 20:16between prompting versus fine-tuning
  552. 20:18when you can fine-tune then react
  553. 20:20definitely does better and then if you
  554. 20:21can RL loop then it does even better
  555. 20:23which we'll cover uh next week.
  556. 20:26Okay. So then that was knowledge
  557. 20:29intensive tasks. If you were to look at
  558. 20:31decision-m tasks and this can be say um
  559. 20:34online web browser experiments or say
  560. 20:36robotics experiments or like gaming
  561. 20:38environments where you we will look at
  562. 20:41web shop as an example. You require the
  563. 20:43agent to purchase a product based on
  564. 20:45user instructions. For example, you're
  565. 20:47asking um the model to look for a
  566. 20:49nightstand with drawers and then you're
  567. 20:51basically evaluating whether the model
  568. 20:53gets to success when it's interacting in
  569. 20:55this environment. It's a simulated
  570. 20:57environment and then you compare it as a
  571. 20:59baseline to imitation learning. This
  572. 21:01just fine-tuning and then imitation
  573. 21:02learning plus RL which is basically just
  574. 21:04supervised fine-tuning plus RL. And the
  575. 21:07results that you see here are impressive
  576. 21:09in the sense that even compared to say
  577. 21:11imitation learning or imitation learning
  578. 21:12plus RL having the reasoning abstraction
  579. 21:15with react uh you get higher score and
  580. 21:18you get higher success rates compared to
  581. 21:20what's the baseline here. So uh the
  582. 21:22score refers to like in immediate steps
  583. 21:25and the success rate refers to getting
  584. 21:27to the to the final uh getting success
  585. 21:31on the action or sorry the task that the
  586. 21:33user had assigned in this particular
  587. 21:34case. So, React generally uh outperforms
  588. 21:38what was uh possible with just uh
  589. 21:40imitation learning or supervised
  590. 21:42fine-tuning before,
  591. 21:44but it's still far below what human
  592. 21:46experts can do. So, there's still a lot
  593. 21:48of headroom compared to say human
  594. 21:50experts as you can see like React just
  595. 21:52gets 66.6 versus human experts get 82.1
  596. 21:55in this particular case. And [snorts] a
  597. 21:57lot of challenges happen with respect to
  598. 21:59success rate which is lower because if
  599. 22:01you get any of the steps right because
  600. 22:03this is a multi-step process then the
  601. 22:06errors cascade over time.
  602. 22:10So we covered react first. Uh it's
  603. 22:13basically a simple method that allows
  604. 22:16you to combine actions and thoughts. But
  605. 22:18one of the challenges with this
  606. 22:20particular approach is that if you have
  607. 22:21very large action spaces, then you need
  608. 22:23a lot more um demonstrations and that
  609. 22:26that cannot fit in context. And then
  610. 22:29since you require multiple reasoning
  611. 22:30steps, your inference costs will be
  612. 22:32higher.
  613. 22:34But overall, it's generally shown to
  614. 22:36have better performance in question
  615. 22:38answering, in facteing, and in decision
  616. 22:40tasks. And then your hallucinations are
  617. 22:42lower and you get better decision
  618. 22:44traces.
  619. 22:46So let's have uh a few minutes of
  620. 22:48discussion questions. So what I will do
  621. 22:50is I will ask the class to think through
  622. 22:52these questions um and talk to the
  623. 22:54person next to you um to think through
  624. 22:57these questions and then we'll come back
  625. 22:58in 2 minutes.
  626. 23:03Let let's start with the last question.
  627. 23:05Any takers for the last question?
  628. 23:09>> By show of hands. Any takers for the
  629. 23:11last question to summarize what you guys
  630. 23:13discussed.
  631. 23:15>> How how what happens if the environment
  632. 23:17is noisy? If the feedback that you're
  633. 23:19getting is misleading,
  634. 23:27you can make it up on the go if you
  635. 23:28haven't discussed this one.
  636. 23:34Okay.
  637. 23:35So if the environment feedback noisy or
  638. 23:38incorrect, you can add another layer of
  639. 23:40like reflection the agent to reflect on
  640. 23:43what what the environment gives you and
  641. 23:45then reason about that.
  642. 23:48>> Okay.
  643. 23:50>> Yeah.
  644. 23:50>> I was thinking maybe it's important for
  645. 23:52the agent to have an ability to
  646. 23:53backtrack whenever something doesn't
  647. 23:55make sense or or you know if it's you
  648. 23:58know going through a a chain of thought
  649. 24:00it doesn't fit anywhere. You may want to
  650. 24:02backtrack.
  651. 24:03>> Yeah, backtracking becomes important
  652. 24:05because the noisy feedback might lead it
  653. 24:08down repetitive loops. Yeah,
  654. 24:10>> you need to fix
  655. 24:13times and
  656. 24:15>> Okay. Yeah. So better confidence
  657. 24:17metrics. So like you need some way to
  658. 24:19build confidence over things.
  659. 24:22>> Okay.
  660. 24:23>> You could uh have it perform like the
  661. 24:25same task multiple times and take the
  662. 24:27highest sample or whatever.
  663. 24:30>> Yeah. Yeah, that makes sense. They
  664. 24:32basically have better uh understanding
  665. 24:35of what how confident the model is on
  666. 24:36this environment feedback. Okay, good.
  667. 24:41Um any ideas on the second one? So this
  668. 24:44like react is one way you can think
  669. 24:46about reasoning and actions. What other
  670. 24:48cognitive mechanisms should we take into
  671. 24:50account if we are building these
  672. 24:53processes? Yes.
  673. 24:54>> I mean humans like their condition is
  674. 24:56very different, right? Like depending on
  675. 24:58the task sometimes we rely on our like
  676. 25:02our own experiences in the past.
  677. 25:03Sometimes we think through things step
  678. 25:06by step sometimes. So it depends on the
  679. 25:07task that at hand that we do that. So
  680. 25:11just relying on react and taking an
  681. 25:13action like doesn't necessarily lead us
  682. 25:15to the right place like sometimes we
  683. 25:17have to actually think and analyze and
  684. 25:20like do reasoning before we actually do
  685. 25:22any actions. So I think what you're
  686. 25:24roughly saying is that there is other
  687. 25:26thinking mechanisms that perhaps are
  688. 25:28worth exploring. One of them what I I I
  689. 25:31would phrase it as task decomposition.
  690. 25:32Maybe the task is too complex. So maybe
  691. 25:34I should decompose it into subtasks
  692. 25:37before attacking it with these kind of
  693. 25:39approaches. Or maybe there is something
  694. 25:41to be said about like having parallel
  695. 25:43approaches to thinking which someone had
  696. 25:45brought up here as well as to like is
  697. 25:46this approach better is this approach
  698. 25:48better and then having
  699. 25:49>> memory past experience
  700. 25:51>> have past memory past experiences. Okay.
  701. 25:54So yeah memory is another aspect. Okay.
  702. 25:57Yes.
  703. 25:58>> Yeah. Um I I think humans also uh try to
  704. 26:01fine-tune what is the ideal ratio for
  705. 26:04reasoning to action. Like for some tasks
  706. 26:06you might learn over time that it's
  707. 26:08better to think give it much more
  708. 26:10reasoning time before acting it out. And
  709. 26:12it might be interesting to see if the
  710. 26:15paper actually tries to train this on um
  711. 26:19different tasks to see what is the ideal
  712. 26:22um outcome to compute like ratio for
  713. 26:26each tasks. That's a great point. In
  714. 26:29fact, uh related to that, you'll find
  715. 26:31that some of the models today overthink
  716. 26:34because they have like really long
  717. 26:36thinking traces. And yes, and u even for
  718. 26:40simple tasks, you'll see them like have
  719. 26:43very long thinking traces. So there's
  720. 26:45definitely some interesting set of works
  721. 26:46there of like how to how to get the
  722. 26:48models to not think too much.
  723. 26:51Um let's go there. Yeah. Another
  724. 26:54interesting direction would be like uh
  725. 26:56given the different model at the number
  726. 26:59of parameters like maybe some model is
  727. 27:01better at um being able to do the whole
  728. 27:05like um tool calling or train of thought
  729. 27:08reasoning or even delegating tasks. So
  730. 27:11being able to do like based on what
  731. 27:14models you're working with um splitting
  732. 27:17those different tasks
  733. 27:18>> almost like building a compound system
  734. 27:20where you benchmark subtasks on
  735. 27:22different models and then delegating
  736. 27:24based on the strengths of the model.
  737. 27:26>> Okay. Yeah, that might be another
  738. 27:27project idea. Cool. Okay. Let's move to
  739. 27:32the second pro second uh paper now. So
  740. 27:35this one is called RLEF. It's uh based
  741. 27:37on coding agents and what what it's
  742. 27:41basically saying is that when you're
  743. 27:42building coding agents, one of the
  744. 27:44things that you want to do is give some
  745. 27:45feedback for the reinforcement learning
  746. 27:47loop and often times what really helps
  747. 27:49is execution feedback where we can
  748. 27:51execute and get that feedback. So RLEF
  749. 27:54was one of the first papers that showed
  750. 27:56that with execution feedback you can
  751. 27:58actually get much better performance in
  752. 27:59coding LLMs.
  753. 28:01Um why do we care about this problem? So
  754. 28:04how many of you use cloud code today?
  755. 28:07Okay, that that's almost majority of the
  756. 28:09class here. So I don't think I need to
  757. 28:11explain that a lot of the engineering
  758. 28:14and coding tasks seem to be have been
  759. 28:16delegated to these agents. And the
  760. 28:19[snorts] aspect that matters more in
  761. 28:21building these coding agents to be
  762. 28:22extremely strong is that we need to be
  763. 28:24able to understand the user intent and
  764. 28:26based on what the code was generated, we
  765. 28:30need some feedback uh from the code
  766. 28:32generated. So that there's a way to
  767. 28:35iterate on top of that.
  768. 28:37So what this paper shows is um basically
  769. 28:40an end to end RL fine-tuning framework.
  770. 28:42The actions in this particular case are
  771. 28:44generated code and the observations that
  772. 28:46I was showing earlier come from
  773. 28:48execution feedback. Execution feedback
  774. 28:50is test feedback. You're running some
  775. 28:52tests and you're collecting output of
  776. 28:53whether those tests pass or fail. And
  777. 28:55you get binary reward based on whether
  778. 28:57those tests pass or fail. And then based
  779. 29:00on that feedback you can iteratively
  780. 29:02refine in fine-tuning time um and decide
  781. 29:06to make the model better based on that.
  782. 29:07So PPU can be used for this kind of
  783. 29:10approach.
  784. 29:11The two techniques that this paper
  785. 29:13covers are two-tier test strategy and
  786. 29:16then hybrid token turnle level policy.
  787. 29:18Both of those are very interesting. So
  788. 29:20I'll cover the basic ideas here but I do
  789. 29:22encourage you to read this paper very
  790. 29:24very carefully. So the core of their
  791. 29:26framework is an iterative feedback loop.
  792. 29:28They're using both training time and
  793. 29:30inference time execution feedback. So um
  794. 29:34let me explain the training time and the
  795. 29:36inference time feedback. So at the very
  796. 29:38top in the purple block, what you're
  797. 29:39seeing is that the model gets a natural
  798. 29:42language problem description. For
  799. 29:43example, someone asked you to say write
  800. 29:45a hello world program. Then it generates
  801. 29:47a code solution which then it evaluates
  802. 29:50on some public set of tests. If the code
  803. 29:53fails, the execution feedback is
  804. 29:55provided to the LLM for another attempt.
  805. 29:57And this cycle will continue until the
  806. 29:59either until either the code will pass
  807. 30:01or it will reach a limit of the number
  808. 30:02of turns it's supposed to um do this
  809. 30:05loop for. And then based on u this
  810. 30:09whatever set of solutions it has
  811. 30:10generated for passing solutions a
  812. 30:12private set of tests will determine
  813. 30:14determine what reward to give and then
  814. 30:17that will be used in the PO training
  815. 30:19loop with RL.
  816. 30:22So what here is happening is there are
  817. 30:24two fundamental phases. This is the
  818. 30:26exploitation phase of RL where it's
  819. 30:28basically exploiting um the current
  820. 30:30policy through inference time feedback
  821. 30:32loops like whatever policy model you
  822. 30:34have got and on the right side you have
  823. 30:36update of the policy based on the
  824. 30:37execution results and this allows
  825. 30:39continuous improvement for the model to
  826. 30:42uh self-improve here. So let's take a
  827. 30:45look at how this works. Uh you're given
  828. 30:48a simple example where you're creating
  829. 30:50code to detect say palendrome
  830. 30:52substrings. Uh so that's what the
  831. 30:55problem statement in uh on the top is in
  832. 30:57the first turn it generates a basic
  833. 30:59solution but the implementation actually
  834. 31:01fails in the public tests and uh there's
  835. 31:04execution timeout which is a simple u
  836. 31:07which is a very common issue after
  837. 31:09receiving this feedback the model
  838. 31:11actually generates a better solution
  839. 31:13where it does some optimization and now
  840. 31:16it does pass the public tests based on
  841. 31:19that feedback. So you see that yellow
  842. 31:21block now it submits the solution to the
  843. 31:24the private set of tests and based on
  844. 31:28that it will go and try to improve the
  845. 31:30model now that the solution is is
  846. 31:32looking better.
  847. 31:33One of the key aspects of u their
  848. 31:36approach was that during iteration the
  849. 31:38public tests will provide immediate
  850. 31:40feedback and will help it do uh better
  851. 31:42solution development. So but this is a
  852. 31:45small subset for faster iteration and
  853. 31:47this is basically allowing you to guide
  854. 31:49allowing the model to guide and get
  855. 31:51better solution while the private tests
  856. 31:53are completely hidden during the
  857. 31:54generation process. So basically this
  858. 31:57separation allows it to like do u like
  859. 32:00not go train on the public test but like
  860. 32:02only use the private test as the way to
  861. 32:04get signal and this is one way in which
  862. 32:07the model cannot simply memorize the
  863. 32:09test outputs because it's getting the
  864. 32:10exe execution feedback. So this they
  865. 32:13found as a very useful innovation um in
  866. 32:15the self-improvement loop. A second
  867. 32:18innovation. So I will actually not make
  868. 32:20you go through the details of this RL
  869. 32:22algorithm. This is basically PO. But the
  870. 32:25one thing I want to stress is that when
  871. 32:26you're in a language model space, you're
  872. 32:28outputting tokens. So you're outputting
  873. 32:30one token at a time. In the policy
  874. 32:32model, they are generating code tokens
  875. 32:34token by token. So this gives you final
  876. 32:36control over the the generation process.
  877. 32:39But when they're using the value
  878. 32:40function, they're computing this at turn
  879. 32:42level. So this evaluation or the reward
  880. 32:44is happening over the entire response
  881. 32:46and it's using the last token of the
  882. 32:48prompt. So there's a single advantage
  883. 32:50value for all tokens. So if you were to
  884. 32:53uh match this to where we are in say our
  885. 32:56RL algorithms,
  886. 32:58this is closer to what GSPO would do in
  887. 33:00terms of like giving rewards to the
  888. 33:02entire sequence as opposed to doing it
  889. 33:05uh doing it per token.
  890. 33:09Yes.
  891. 33:11>> At the first time, how do you where do
  892. 33:13you get the public?
  893. 33:15>> Um, it's a test set, right? You keep you
  894. 33:18you have a set of tests that you're
  895. 33:20keeping as public test and another set
  896. 33:22that you're keeping as private test.
  897. 33:25>> So, you have a question again.
  898. 33:27>> So, so on the left you said that's part
  899. 33:30of difference.
  900. 33:32>> Mhm. By deference the user could give
  901. 33:34like
  902. 33:36all sorts of like program descriptions
  903. 33:39right
  904. 33:41>> this is for the auto loop right so for
  905. 33:45example code contests
  906. 33:47there's a set of tests that are combined
  907. 33:49with code contest you have to design the
  908. 33:51auto loop for the model to get better
  909. 33:54you can keep some subset of tests as
  910. 33:55public tests on which you will do the
  911. 33:57inference time feedback and then some
  912. 33:59subset of tests you can keep to train
  913. 34:01the
  914. 34:04Yes.
  915. 34:05>> What does it mean for the test to fail?
  916. 34:07>> When the test is failing, that's
  917. 34:09basically saying that the solution that
  918. 34:11the model generated is not correct.
  919. 34:13>> Right?
  920. 34:13>> The model itself evaluates that the
  921. 34:16correctness or who evaluates the
  922. 34:18incorrectness output.
  923. 34:20>> Uh the the test the test output is fed
  924. 34:23to the model like you have failed and
  925. 34:25then that's what's that's the execution
  926. 34:28feedback that's going into the LM.
  927. 34:29You're solving this problem. This is the
  928. 34:31output you generated and this is the
  929. 34:33feedback you got.
  930. 34:36This [snorts] is um shown in the example
  931. 34:38that I was shown here like this was the
  932. 34:40first thing this code solution and then
  933. 34:42the public test failed. So you appending
  934. 34:44all of this and then this is the
  935. 34:46execution feedback and then you're
  936. 34:48asking it to generate the second
  937. 34:49solution.
  938. 34:50>> I was just wondering like what's the
  939. 34:52evaluation process of a fail or a pass?
  940. 34:55>> This is an actual running of a test like
  941. 34:57it's a Python test. It's a simple Python
  942. 35:00function.
  943. 35:01Um in your homework you will actually
  944. 35:03not for code but for uh uh math uh for
  945. 35:07any uh problems that you'll actually try
  946. 35:10some of this out as like not execution
  947. 35:12feedback but just like identifying the
  948. 35:14error in the generated solution.
  949. 35:22So why does this help or what's the
  950. 35:24benefit of doing this? So one of the
  951. 35:26things that uh this paper showed was
  952. 35:28that on the y-axis is showing solve
  953. 35:31rates and on the x-axis it's showing um
  954. 35:34the sampling budget and uh this is for
  955. 35:37two different sets for validation set
  956. 35:38and for test set and even though the
  957. 35:40results are a little bit older because
  958. 35:41they're on llama 3.1 they clearly showed
  959. 35:44that after RLE uh and training on code
  960. 35:48contests which is competitive uh coding
  961. 35:50problems uh you clearly get much better
  962. 35:53results in terms of solve rate
  963. 35:55U basically solve rate 10 at K means
  964. 35:58that you're um you're passing at least
  965. 36:01one out of uh you you have 10 solutions
  966. 36:03generated and then you're passing a
  967. 36:04certain number out of that. So the solve
  968. 36:06rate definitely goes up with the RLEF
  969. 36:09and the other thing to note here is that
  970. 36:10this is log scale on the x-axis. So this
  971. 36:13is like definitely improving uh with the
  972. 36:15execution feedback. Now why does it help
  973. 36:18is the other good question to ask. So um
  974. 36:21the base models typically don't benefit
  975. 36:23from access to just faulty solutions and
  976. 36:25execution feedback. Uh what is really
  977. 36:28helping here is the the fact that when
  978. 36:31we are giving u when we are training on
  979. 36:34code contest we are showing it in each
  980. 36:36turn what's the execution feedback and
  981. 36:39uh with that you're basically also
  982. 36:41generalizing to all the other
  983. 36:42benchmarks. So it's it's it's the error
  984. 36:46in the solution that that's what's
  985. 36:48helping the model uh start to get
  986. 36:50better. And and this becomes really
  987. 36:53clear in this particular example where
  988. 36:55what they're looking at is number of
  989. 36:57errors in turn one, the number of errors
  990. 36:59in turn two, the number of errors in
  991. 37:01turn three, and then the number of code
  992. 37:03changes being made um and the error
  993. 37:05type. And this is for a smaller model,
  994. 37:08and this is for a larger model. So what
  995. 37:10you basically find is that with RLEF um
  996. 37:14you as you go about iteratively in turn
  997. 37:17one and turn two and turn three you have
  998. 37:19uh fewer wrong outputs and in subsequent
  999. 37:22turns you basically start to repair the
  1000. 37:24output while if you were to
  1001. 37:27if if you didn't have this uh iteration
  1002. 37:30loop then you basically are u not making
  1003. 37:33edits that are correct. So effectively
  1004. 37:34you are leveraging both the fact that
  1005. 37:36you have higher diversity in terms of
  1006. 37:38the number of samples that you're making
  1007. 37:40but also your edits are more targeted
  1008. 37:42because you can look at where you made
  1009. 37:43the error and that's one idea that you
  1010. 37:46will use in in your homework problem as
  1011. 37:48well.
  1012. 37:50>> Sorry I missed this but with the
  1013. 37:52execution feedback does it also include
  1014. 37:55it includes where the the faults you
  1015. 37:58made the errors does it include any
  1016. 38:00suggestions for how to fix them? It's
  1017. 38:03just getting a sense of like this is the
  1018. 38:05part that given out
  1019. 38:09>> but the problems are very simple.
  1020. 38:12>> The code corners problems are still like
  1021. 38:15I would say uh not more than other lines
  1022. 38:18of code.
  1023. 38:20So they're much smaller problems.
  1024. 38:25>> Yes. How how is the binary feedback
  1025. 38:28enough to um create the like I I I have
  1026. 38:32a feeling that maybe this were like very
  1027. 38:34easy problems. So binary feedback was
  1028. 38:37enough but for harder problems you would
  1029. 38:38probably also need to have like the
  1030. 38:40error trace or other metadata to
  1031. 38:43actually know how to debug it more
  1032. 38:44efficiently.
  1033. 38:46>> That's quite possible. I think that
  1034. 38:48might make a very good project as well.
  1035. 38:51>> Yeah. Does this necessarily encourage
  1036. 38:54like correct accuracy at the first time?
  1037. 38:56I feel like reward is final reward for
  1038. 39:00like the final solution, right? Maybe
  1039. 39:02this is something encouraging the model
  1040. 39:04to just like
  1041. 39:06like just repair
  1042. 39:10like
  1043. 39:15>> uh what's the question there?
  1044. 39:17>> Oh, sorry. So, I'm looking at the
  1045. 39:19reward. Is this like binary cor like
  1046. 39:22corrupt or incorrect?
  1047. 39:23>> But the model has a freedom to just like
  1048. 39:25do model terms, right? How does this
  1049. 39:29method like encourage the model to get
  1050. 39:31it corrupt like problem corrupt in the
  1051. 39:33first turn? So I think it really depends
  1052. 39:36on the kind of error it made and I agree
  1053. 39:38with you that for more complex problems
  1054. 39:40as was brought up it is possible that it
  1055. 39:41will take multiple turns but if it was a
  1056. 39:43simple enough problem and um then I mean
  1057. 39:46if you remember there's inference time
  1058. 39:48feedback here also right and you're
  1059. 39:50you're appending what is the error that
  1060. 39:52it saw and you're allowing [snorts] the
  1061. 39:53public test to pass be before you send
  1062. 39:56it to PBO so to some extent it will have
  1063. 40:00had a few chances to go correct itself
  1064. 40:03Yeah, can we just like increase like the
  1065. 40:06number of turns to finish the problem
  1066. 40:08like in real?
  1067. 40:10>> Yeah, you can you can try all of those
  1068. 40:12things. I I think these are I mean this
  1069. 40:14is one abstraction of that problem that
  1070. 40:16I'm showing you and overall I think what
  1071. 40:18we want to learn out of here is that
  1072. 40:21um the the self-improvement loop works
  1073. 40:23that's the first thing that we're
  1074. 40:24learning and it can work with uh in
  1075. 40:26simple enough problems with binary
  1076. 40:28reward and then potentially I think the
  1077. 40:30question is through process reward
  1078. 40:31models versus outcome reward models
  1079. 40:33which works better I mean what you're
  1080. 40:35saying is that do we need to give
  1081. 40:36feedback at every single step and and
  1082. 40:39it's possible that that is what matters
  1083. 40:41asia covered it in cross class outcome
  1084. 40:42versus process reward model. Right? So I
  1085. 40:44think that debate is not completely
  1086. 40:46solved in terms of like in each domain
  1087. 40:49and each benchmark you might have to
  1088. 40:51make different set of choices to help
  1089. 40:52climate.
  1090. 40:54>> Yes.
  1091. 40:55>> Uh I might have missed this but why why
  1092. 40:58doesn't encourage generalization
  1093. 41:01uh because I think like isn't contest is
  1094. 41:03more difficult than human level and I
  1095. 41:05mean
  1096. 41:06>> that that might be why it generalizes
  1097. 41:09better. Uh and another is that like um
  1098. 41:12what about like super supervised fine
  1099. 41:15tuning? um would it be be able to beat
  1100. 41:18like RDF for example like is since it's
  1101. 41:21>> so supervised fine tuning or what always
  1102. 41:22matters right like supervised fine
  1103. 41:24tuning on reasoning traces might
  1104. 41:26actually still get you some of the gains
  1105. 41:29as you probably have papers out there uh
  1106. 41:32saying that but generally um the I mean
  1107. 41:36this is still a question up for debate
  1108. 41:37but I think with RL you are able to
  1109. 41:39solve slightly newer problems so there's
  1110. 41:41a little bit more generalization that's
  1111. 41:43seen but with supervised fine tuning
  1112. 41:44anything that's within domain will
  1113. 41:46definitely start to see value, right?
  1114. 41:48It's the still the same loss function.
  1115. 41:51>> But do they have an inflation of the two
  1116. 41:55tier test strategy? Cuz one way is we
  1117. 41:59can just have all the tests in
  1118. 42:02I think public and they run this loop
  1119. 42:05and then you do PO.
  1120. 42:07>> I do.
  1121. 42:08>> Right. So why did they do that?
  1122. 42:10>> What do you do the PPO on? um the final
  1123. 42:13result after the how many returns to I
  1124. 42:18>> uh I didn't see that application I think
  1125. 42:20there must be like some amount of just
  1126. 42:21like they wanted to use more fine grain
  1127. 42:23feedback than just uh the feedback of
  1128. 42:26the public test right so that there is
  1129. 42:27no leakage between the two sides
  1130. 42:29>> like why would you care about leakage
  1131. 42:31like
  1132. 42:32>> why would you not care about
  1133. 42:33>> I mean they split the test into public
  1134. 42:35private themselves like right
  1135. 42:36>> it's all it's all test right like it's
  1136. 42:38all in the training part of the model
  1137. 42:41>> so why When do you after splitting get
  1138. 42:42two tiers like can you still get
  1139. 42:44>> I mean in the auto loop if you're
  1140. 42:45training on the thing that you're
  1141. 42:46basically going to use as the the
  1142. 42:48feedback then that that aspect matters
  1143. 42:50right
  1144. 42:52to
  1145. 42:54>> uh we can take this one offline
  1146. 42:56>> yeah I think there's a little bit of
  1147. 42:57terminology get off
  1148. 43:01>> um yes in the appalation study I was
  1149. 43:05curious why our produces fewer raw
  1150. 43:08outputs but more like timeout errors for
  1151. 43:12Oh, because uh it's probably so it's
  1152. 43:14pure wrong outlook is because um it's
  1153. 43:17able to fix itself but then if it ran
  1154. 43:20out of time in I mean basically the the
  1155. 43:24test ran out of time because the
  1156. 43:26solution was still not correct.
  1157. 43:28Um a lot of this is very domain specific
  1158. 43:32also.
  1159. 43:37Okay, I'm actually uh going to skip this
  1160. 43:41slide, but I think the main main thing
  1161. 43:42that I want you folks to take away is
  1162. 43:44that there is a way to incorporate
  1163. 43:46execution feedback to uh improve code
  1164. 43:49generation as a domain and and
  1165. 43:51competitive programming tasks is one
  1166. 43:53place where it has shown promise and it
  1167. 43:56does generalize to other benchmarks in
  1168. 43:57the code generation u realm.
  1169. 44:01Um so let's take a look at say question
  1170. 44:05two and discuss that for one minute uh
  1171. 44:08and then um among your peers and then
  1172. 44:10we'll come back together as a class
  1173. 44:16>> any takers for this problem like the
  1174. 44:18codebase doesn't fit the context window
  1175. 44:23>> okay
  1176. 44:23>> so one thing I know is that some tools
  1177. 44:25what they'll do is they'll do something
  1178. 44:27uh similar to the previous paper we were
  1179. 44:29discussing where they'll uh think about
  1180. 44:31what information they need. They'll have
  1181. 44:33access to some search tools and then
  1182. 44:35they will continue training on that
  1183. 44:36until at some point they decide they
  1184. 44:37have enough information and then they
  1185. 44:39move on to like something like what we
  1186. 44:41are discussing.
  1187. 44:42>> Okay, that definitely makes sense. Uh
  1188. 44:46any other takers?
  1189. 44:53Yes,
  1190. 44:54>> I think we can condense the
  1191. 44:57the code of each document into like a
  1192. 45:00short summary so that like can keep a
  1193. 45:02summary of each document and then
  1194. 45:05together they can fit in the context.
  1195. 45:07>> Okay.
  1196. 45:10Any other ideas?
  1197. 45:12>> Yes. I don't know if this applies here
  1198. 45:14but uh like in a regular setting I feel
  1199. 45:17like you can do like graph factoriize
  1200. 45:19version of your code and then do a
  1201. 45:23similarity based on like what you can
  1202. 45:25find and then again do another iteration
  1203. 45:28on [clears throat] that like just simple
  1204. 45:30rag right
  1205. 45:31>> and then you can have like in the loop
  1206. 45:33like what he said about like verifying
  1207. 45:35and saying if you have enough
  1208. 45:36information and then
  1209. 45:38>> if not you can do that cuz in that case
  1210. 45:41like you can use this organization you
  1211. 45:43can use the things that you're
  1212. 45:44extracting and then come with the rest.
  1213. 45:47>> Okay,
  1214. 45:49so this this is actually the kind of
  1215. 45:51thing that actually runs in cloud code,
  1216. 45:53right? Like it has to go search for what
  1217. 45:55is relevant and then like actually apply
  1218. 45:57the code edits there and one of the
  1219. 45:59benchmarks that targets this is like SWE
  1220. 46:01bench. So all the ideas that you folks
  1221. 46:04have proposed in the realm of like
  1222. 46:05searching for something having some
  1223. 46:07summary doing some representation all of
  1224. 46:10those are perhaps the first step to
  1225. 46:12solving that problem before you [snorts]
  1226. 46:14now do the test like what what code
  1227. 46:17patch to apply and then whether the test
  1228. 46:19pass or not. So code monkeyy's paper the
  1229. 46:22from Aalia's lab also targets very
  1230. 46:25similar ideas here.
  1231. 46:28Okay.
  1232. 46:30Okay. Let's move to the last topic. The
  1233. 46:32last topic is constitutional AI where
  1234. 46:34we'll have the model learn from AI
  1235. 46:37feedback. And the thing that we're
  1236. 46:39improving about the model is it is
  1237. 46:41harmlessness or its ability to generate
  1238. 46:44harmless outputs. So it we want it to be
  1239. 46:47helpful but we also want it to be
  1240. 46:48harmless. So what happened with LLMs uh
  1241. 46:52when they're base models is that you can
  1242. 46:55give them feedback in a lot of ways. uh
  1243. 46:57a typical way to give feedback when you
  1244. 46:59are trying to build a chatbot would be
  1245. 47:01that you look at the outputs and you ask
  1246. 47:03humans to rank them in like is the model
  1247. 47:05output correct. So you show it like two
  1248. 47:07different outputs. You ask it whether
  1249. 47:09it's correct, whether it's useful and
  1250. 47:11whether it's specific enough and then
  1251. 47:13based on those human preferences uh you
  1252. 47:15can build a reward model and then you
  1253. 47:17can help use that to help clients. So
  1254. 47:19here is like uh Python fine-tuning with
  1255. 47:21RLHF versus just Python finetuning and
  1256. 47:24as you increase the model size you
  1257. 47:26clearly see better responses with RLHF.
  1258. 47:29So basically that's this whole notion of
  1259. 47:31like you can use um these preference
  1260. 47:34model these preference uh responses from
  1261. 47:36humans as human feedback to fill client
  1262. 47:38on the model. Now that doesn't scale
  1263. 47:41very well because uh if you have to
  1264. 47:43collect tens of thousands of human
  1265. 47:44labels that's extremely time consuming
  1266. 47:48and tedious. Imagine that you generate
  1267. 47:50all these model outputs then you have to
  1268. 47:51ask humans to like rate them. So one of
  1269. 47:53the very interesting uh principles given
  1270. 47:56that the models can reason was to use
  1271. 47:58this notion of constitutional uh that
  1272. 48:00enthropy came up with which was very
  1273. 48:02much based on human written principles.
  1274. 48:04So they basically used constitutional AI
  1275. 48:06or human written principles called the
  1276. 48:08constitution and then use them to
  1277. 48:10improve the model by describing what is
  1278. 48:12the desired behavior. So humans don't
  1279. 48:14need to be in the loop except to write
  1280. 48:16that constitution. And the reason this
  1281. 48:18notion of rules works is because the
  1282. 48:20models get better at instruction
  1283. 48:21following. So if you ask the model to
  1284. 48:24like format the the response in a
  1285. 48:26certain way, the model is able to follow
  1286. 48:28that instruction. or the if you ask the
  1287. 48:30model that does this response have this
  1288. 48:32particular behavior then the model is
  1289. 48:34able to actually answer that in uh
  1290. 48:36truthful ways that's what uh the
  1291. 48:38constitutional AI aspect will will be
  1292. 48:40able to exploit. So what constitutional
  1293. 48:43AI did was it came up with a set of 16
  1294. 48:45principles which they call constitution
  1295. 48:48and they those will define the model
  1296. 48:50behavior and they use that so these are
  1297. 48:53going to be the set of prompts which
  1298. 48:54will elicit uh whether it's following
  1299. 48:56the constitution or not and then use
  1300. 48:58that to critique the model itself. I'll
  1301. 49:00show you an example and then ask it to
  1302. 49:03revise its response. So you're basically
  1303. 49:04saying whether it's uh you're basically
  1304. 49:08using some red theming prompts. You're
  1305. 49:09looking at the model output you're
  1306. 49:11critiquing it. you're getting a revision
  1307. 49:13and then you're using that to fine-tune
  1308. 49:14the model. And so that's that's the
  1309. 49:16supervised finetuning stage for um um
  1310. 49:20constitutional AI. And then this is the
  1311. 49:21RL stage where you're basically doing
  1312. 49:24the same set of responses and then using
  1313. 49:26AI feedback to train a preference model
  1314. 49:28and then using that to train uh the
  1315. 49:30final model. I'll show that in detail in
  1316. 49:33just a second. So uh before we go there,
  1317. 49:36let's take a look at what might be an
  1318. 49:39example constitution. I will not read
  1319. 49:41this word by word but I'll show you the
  1320. 49:42basic examples. So the critique request
  1321. 49:45in this particular
  1322. 49:47box diagram that I showed you is that
  1323. 49:49there's a red triming prompt. The model
  1324. 49:51has an output and then the critique
  1325. 49:53request is basically asking if the model
  1326. 49:56output has something harmful or
  1327. 49:58unethical and so on. And the revision
  1328. 50:00request is basically asking you to
  1329. 50:02remove any of those responses. A second
  1330. 50:04critique request might be that does it
  1331. 50:06have any gender bias and um the argument
  1332. 50:10about why that might be having a gender
  1333. 50:12bias and then the revision request is
  1334. 50:14can you remove any trace of that and the
  1335. 50:16third one is more like is it
  1336. 50:18inappropriate for uh young children and
  1337. 50:21then what would it take for it to be
  1338. 50:23appropriate and then the revision
  1339. 50:25request is rewrite it. So if you look at
  1340. 50:27each of these, it requires the model to
  1341. 50:30be able to identify these behaviors. And
  1342. 50:32then the second thing it requires is to
  1343. 50:33be able to follow the instruction of
  1344. 50:35like now rewrite it with this particular
  1345. 50:38uh style or way or removing this kind of
  1346. 50:40content.
  1347. 50:43And then the the way this loop works is
  1348. 50:45that humans come in and set a right uh
  1349. 50:47write a set of principles um that will
  1350. 50:50be used for the self-improvement loop.
  1351. 50:52In the supervised learning stage, you're
  1352. 50:54basically fine-tuning the model on this
  1353. 50:56data generated by the self-critique and
  1354. 50:58revision stage. So the critique request
  1355. 51:00might as I showed you might be like
  1356. 51:02something harmful, something unethical
  1357. 51:04and the revision might be okay remove
  1358. 51:06anything that's harmful and unethical
  1359. 51:10and um just with supervised learning
  1360. 51:13with the number of turns you are able to
  1361. 51:16um like just with the number of
  1362. 51:17revisions the harmlessness improves and
  1363. 51:19the help helpfulness
  1364. 51:21u will decline if you just like keep
  1365. 51:23increasing in supervised finetuning but
  1366. 51:25overall the helpfulness plus
  1367. 51:28harmlessness will improve monotonically
  1368. 51:30because um if you're trying to get the
  1369. 51:32model to like u to a certain set of
  1370. 51:35fixed principles then it does become
  1371. 51:37less helpful is what they're saying but
  1372. 51:38overall it's more helpful and more
  1373. 51:41harmless together is their claim
  1374. 51:44and then in terms of the reinforcement
  1375. 51:46learning stage first they train a
  1376. 51:47preference model based on the responses
  1377. 51:50in step one and the constitution and
  1378. 51:52then they fine-tune the LLM to maximize
  1379. 51:54over this uh preference model so they're
  1380. 51:57basically getting the model to response
  1381. 51:59to respond to in a way that's most
  1382. 52:02thoughtful, respectful and cordial. So
  1383. 52:04this is basically the loop. So there's a
  1384. 52:06preference model that's being trained
  1385. 52:07separately with this constitution and
  1386. 52:09then that's what is being used to uh
  1387. 52:11fine-tune the LLM to get better. So this
  1388. 52:13is instead of the RL HF loop where you
  1389. 52:16had a lot of human feedback now you're
  1390. 52:18using this preference model which is
  1391. 52:19trained with the constitution.
  1392. 52:21>> Yes.
  1393. 52:22>> So like all constitutions maybe there
  1394. 52:24may be some amendments. Um if so how do
  1395. 52:27you make sure that uh you're uh
  1396. 52:29costefficiently updating the
  1397. 52:31constitutions for this model without
  1398. 52:33having to um train all over again and if
  1399. 52:35so how do you make sure that the u
  1400. 52:37previous uh rules are removed
  1401. 52:39completely?
  1402. 52:41>> So there's two answers to your question.
  1403. 52:43So one answer is that uh r af is
  1404. 52:46generally done as the last stage of a
  1405. 52:49model and typically uh post training
  1406. 52:52like like once you have a pre-trained
  1407. 52:54base model post- training has typically
  1408. 52:56been um much smaller percentage of
  1409. 52:58compute so maybe 5% and that happens
  1410. 53:01fairly frequently for models to get
  1411. 53:03updated so in that sense um if you do
  1412. 53:06think that the constitution should be
  1413. 53:07updated
  1414. 53:09that happens at a certain frequency. Uh
  1415. 53:11overall I think the question you're
  1416. 53:13asking is this notion of continual
  1417. 53:14learning and how do we get the models to
  1418. 53:15adhere to certain behavior. I think
  1419. 53:17that's an open research problem at this
  1420. 53:18point in time like how do we get the
  1421. 53:20models to forget certain set of
  1422. 53:22knowledge or to adhere to like a new set
  1423. 53:24of knowledge or to follow a new set of
  1424. 53:25rules. So [snorts] that's definitely
  1425. 53:27something there are interesting answers
  1426. 53:29to that problem where you can like do
  1427. 53:31some cancelling of like getting it to
  1428. 53:33forget a certain set of knowledge by
  1429. 53:35looking at say interpretability methods
  1430. 53:37and so on of like can you cancel that
  1431. 53:38knowledge but then it's not proven that
  1432. 53:41you can get the models to forget
  1433. 53:43something.
  1434. 53:49So in terms of uh how this scales so
  1435. 53:52this is the number of training sequences
  1436. 53:54they're using and on the x-axis they're
  1437. 53:55showing the score of helpfulness elo
  1438. 53:59means that humans prefer it in terms of
  1439. 54:01helpfulness and then similarly on the
  1440. 54:04right side they're showing harmlessness
  1441. 54:06elo where the the humans prefer it in
  1442. 54:09terms of it being more harmless. So now
  1443. 54:12that we have replaced human preferences
  1444. 54:13with AI feedback, we're comparing it to
  1445. 54:15say uh just using helpfulness based RLHF
  1446. 54:19or helpful plus harmlessness based RLHF
  1447. 54:22which is all human feedback based and
  1448. 54:24then just using constitutional AI and
  1449. 54:26constitutional AI with chain of thought.
  1450. 54:28And what they roughly show is that just
  1451. 54:30getting the model to evaluate its
  1452. 54:32responses based on these principles, you
  1453. 54:34still get the model to be equally
  1454. 54:36helpful, maybe a little bit less
  1455. 54:39helpful, but it's much less harmless as
  1456. 54:41a result. So the harmlessness scores are
  1457. 54:44much higher [snorts] and that was
  1458. 54:45something that uh Claude and um the
  1459. 54:49claude models were extremely strong at.
  1460. 54:51And now that's that's a set of
  1461. 54:52techniques that used across the models.
  1462. 54:55>> Yes.
  1463. 55:00Say that again.
  1464. 55:00>> The chain the chain of sound has lower
  1465. 55:03health.
  1466. 55:06>> Uh yes without
  1467. 55:08compar
  1468. 55:11means that chain of sound actually
  1469. 55:12worse.
  1470. 55:15>> A possible that's a good point.
  1471. 55:20>> I mean you on the right.
  1472. 55:23So I think I think the correlation is
  1473. 55:25less with chain of thought and more with
  1474. 55:26the fact that as we as I showed you in
  1475. 55:28the last slide um
  1476. 55:31this one like anytime harmless is going
  1477. 55:34up there is some amount of like inverse
  1478. 55:35relationship between these two. So um
  1479. 55:38it's almost like
  1480. 55:41uh in this particular case if it was
  1481. 55:43more harmless then it does hurt the
  1482. 55:45helpful lens but overall you have to
  1483. 55:47find the right balance between these
  1484. 55:48two.
  1485. 55:51>> Yes. go back to like step one of like
  1486. 55:54the constitution AI to the supervised
  1487. 55:56learning part.
  1488. 55:57>> Okay.
  1489. 55:57>> So like it said in the slides that like
  1490. 55:59we want to fine tune on like the data
  1491. 56:01generated by self critique and repeat
  1492. 56:03issues. Yeah. So like I want to
  1493. 56:04understand like whether this just simply
  1494. 56:06means that we want to just reinforce the
  1495. 56:08lock likelihoods over like literally
  1496. 56:10like the generations like the robots of
  1497. 56:13like the of like the original policy
  1498. 56:16like you know when so basically we just
  1499. 56:18ask it to critique itself then we just
  1500. 56:20like fine-tune like this kind of like
  1501. 56:22sample robots so that they're more
  1502. 56:24likely. That's like what this stage is
  1503. 56:26basically doing. That's basically what
  1504. 56:29it's it's it's uh it's a stage that's
  1505. 56:31used in a lot of uh lot of other things
  1506. 56:34that you'll see but what this is
  1507. 56:36basically is doing a set of these are
  1508. 56:39kind of traces that it's generated like
  1509. 56:40it's based on reasoning you wanted to
  1510. 56:42follow certain set of principles and
  1511. 56:44then it critiqued itself it revised
  1512. 56:46itself and it got fine-tuned on that
  1513. 56:48these set of traces right I mean if you
  1514. 56:51were training it for thinking for
  1515. 56:52example these would be the reasoning
  1516. 56:54traces right so being being trained on
  1517. 56:58it's being fine tuned on those reasoning
  1518. 56:59traces.
  1519. 57:01>> But I guess like it's kind of
  1520. 57:02interesting that like there's not really
  1521. 57:03like explicit feedback, right?
  1522. 57:05>> There's no feedback,
  1523. 57:06>> right? Because it's just asked to like
  1524. 57:08do this thing and then we just fine tune
  1525. 57:09it over like what it has tried to do,
  1526. 57:11right? Then
  1527. 57:12>> yeah, but as long as the fine tuning is
  1528. 57:13not very large scale. It's like much
  1529. 57:15smaller than what the base model was
  1530. 57:17initially trained on, it will not lose
  1531. 57:19its initial capabilities, but the
  1532. 57:21distribution of what it will output will
  1533. 57:23start to get biased towards these set of
  1534. 57:25responses.
  1535. 57:28So the validation is feedback
  1536. 57:34um the AI feedback.
  1537. 57:36>> Yes. How do they validate whether or not
  1538. 57:38they provide accurate feedback or
  1539. 57:40>> that's a good question. So I think uh
  1540. 57:42for the preference model when you do
  1541. 57:44train this preference model you want to
  1542. 57:46have some sort of test set or validation
  1543. 57:48set to make sure that the preference
  1544. 57:50model will do a great job. So you do
  1545. 57:52want to have some human like typically
  1546. 57:54what you'll do is you will do a lot of
  1547. 57:56AI feedback but for the prevalence model
  1548. 57:58you'll also like get it to give some
  1549. 58:00scores on set of things and then match
  1550. 58:02it with humans. So you do want to do
  1551. 58:04some sort of like consistency with
  1552. 58:06humans for the preference model.
  1553. 58:10It's not like
  1554. 58:11>> it's not scaled to 10,000 or or that
  1555. 58:14level. You're basically able to do based
  1556. 58:17on compositional principles, right?
  1557. 58:26So overall in terms of results uh what
  1558. 58:28this roughly means is that if you were
  1559. 58:30to plot the harmlessness ELO on y-axis
  1560. 58:33and the helpfulness ELO on x-axis the
  1561. 58:36pre-trained base model is basically the
  1562. 58:38raw base model. So it will uh have a
  1563. 58:41certain set of scores uh but which which
  1564. 58:43are not very high. But with standard
  1565. 58:45standard RLHF you will if you were doing
  1566. 58:48that with just helpful only you will
  1567. 58:50start to push that frontier towards
  1568. 58:51getting higher scores on helpfulness.
  1569. 58:53And then if you start to make it helpful
  1570. 58:55plus harmless that that's what the
  1571. 58:56orange curve shows you. But then if you
  1572. 58:58do constitutional supervised learning
  1573. 59:00then you're still worse than doing RLHF.
  1574. 59:02But when you do constitutional RL with
  1575. 59:04chain of thought that's where you get
  1576. 59:06the frontier in terms of uh like the
  1577. 59:09best parto frontier in terms of
  1578. 59:10trade-off between harmlessness and
  1579. 59:12helpfulness. So that that's one of the
  1580. 59:14key ideas of this paper as to like you
  1581. 59:16can strike the right predictor frontier
  1582. 59:17between helpfulness and harmlessness. In
  1583. 59:20this particular case, if you were to
  1584. 59:21generalize the set of ideas across I
  1585. 59:23mean generally anything you want to do
  1586. 59:25in instruction following um where you
  1587. 59:28want the model to follow a sub subset of
  1588. 59:30instructions but they might be
  1589. 59:31conflicting then this style of
  1590. 59:34principles applies.
  1591. 59:38And some follow-on work that um went and
  1592. 59:41built on top of that includes the fact
  1593. 59:42that there was another work that tried
  1594. 59:45to compare RLIF with RLHF. There was
  1595. 59:48self-refin where it talked about
  1596. 59:50iterative refinements with self
  1597. 59:51feedback. One comment that's worth uh
  1598. 59:54noting here is that often times getting
  1599. 59:56the model to critique itself can be
  1600. 59:58harder. So having a consensus of other
  1601. 1:00:01models to critique the models sometimes
  1602. 1:00:03works better because the models might be
  1603. 1:00:05overconfident in know uh in not knowing
  1604. 1:00:07what they know. Uh and then there was
  1605. 1:00:10another paper that tried to like teach
  1606. 1:00:12models to self-correct reinforcement
  1607. 1:00:14learning. So this is an active area of
  1608. 1:00:15research and just trying to get the
  1609. 1:00:17models to be better at selfcorrection
  1610. 1:00:19um just beyond just the helpfulness and
  1611. 1:00:21harmlessness paradigm. So that might be
  1612. 1:00:24other set of project ideas that you
  1613. 1:00:26might want to explore.
  1614. 1:00:28So let's [snorts] uh recap um and then
  1615. 1:00:31um we'll have uh we'll close out the
  1616. 1:00:33class. So in terms of uh the react
  1617. 1:00:35approach, what we first looked at was
  1618. 1:00:37this notion of uh when we talk to LLMs,
  1619. 1:00:40we can get them to give model outputs
  1620. 1:00:42and what we wanted these model outputs
  1621. 1:00:44to uh be preferable by humans. Um which
  1622. 1:00:47is been a focus. But what React starts
  1623. 1:00:49to look at is this notion of can we get
  1624. 1:00:52the models to act in real world and
  1625. 1:00:54based on that feedback um and combining
  1626. 1:00:57that with reasoning we can get them to
  1627. 1:00:59be grounded so they can give better
  1628. 1:01:01answers to questions can check facts
  1629. 1:01:02better or if they if we put these LLMs
  1630. 1:01:05as decision makers in say game gaming
  1631. 1:01:08environments or in other environments
  1632. 1:01:10related to say web browser agents and so
  1633. 1:01:13on then they can make useful decisions
  1634. 1:01:16and one interesting aspect of like doing
  1635. 1:01:18it in the react style and language space
  1636. 1:01:20ends up being that the uh decision
  1637. 1:01:22traces are extremely interpretable.
  1638. 1:01:24There's several works on top of that
  1639. 1:01:25that try to combine this reasoning and
  1640. 1:01:27acting in different ways um and and
  1641. 1:01:30trying trying to get the models to do
  1642. 1:01:31better tool calling to the point where
  1643. 1:01:33like this tool calling is kind of innate
  1644. 1:01:35in several models that are out of the
  1645. 1:01:38box today. But this is kind of the
  1646. 1:01:40building block of how to get the
  1647. 1:01:41language models to to combine reasoning
  1648. 1:01:43and acting. A second aspect that we
  1649. 1:01:46covered today was this notion of RLEF.
  1650. 1:01:48So in in coding agents getting the
  1651. 1:01:51models to act in the correct way
  1652. 1:01:54requires some form of execution feedback
  1653. 1:01:56and you want to iteratively incorporate
  1654. 1:01:58that feedback so that you can do the
  1655. 1:02:01generate the right code solutions for
  1656. 1:02:03code. One of the best ways to get
  1657. 1:02:04execution feedback ends up being tests
  1658. 1:02:07uh unit tests. So that that's one way uh
  1659. 1:02:10the models have been used to uh
  1660. 1:02:12self-improve and um just this also
  1661. 1:02:15reduces the amount of budget you need to
  1662. 1:02:17get the models to get better at and get
  1663. 1:02:20state-of-the-art performance in say code
  1664. 1:02:21contests and other competitive
  1665. 1:02:23programming tasks. So that's one aspect
  1666. 1:02:26of just uh getting execution feedback in
  1667. 1:02:29the coding domain. And then finally what
  1668. 1:02:31we covered was this notion of
  1669. 1:02:32constitutional AI where we are getting
  1670. 1:02:34the model to follow a set of
  1671. 1:02:35constitutions which is a set of
  1672. 1:02:37principles written by humans to generate
  1673. 1:02:39feedback for self-improvement.
  1674. 1:02:41In general you can also generalize it to
  1675. 1:02:44anything where you can get the model to
  1676. 1:02:45follow a set of rules and then based on
  1677. 1:02:47whether it's following the rules well or
  1678. 1:02:49not you can get a self-improvement loop
  1679. 1:02:51going. So hopefully with these set of
  1680. 1:02:54papers you uh got a sense of like how we
  1681. 1:02:56can build a feedback loop on top of the
  1682. 1:02:58models and when the feedback loop has
  1683. 1:03:01enough signal then you have a way to
  1684. 1:03:03improve the model beyond just um what is
  1685. 1:03:06the data it was trained on
  1686. 1:03:09and these were several examples of where
  1687. 1:03:11this has been shown to work well. Sorry
  1688. 1:03:14this slide was not meant to be there.
  1689. 1:03:16Okay so this that would be the end of
  1690. 1:03:19the lecture but let's take any
  1691. 1:03:20questions.
  1692. 1:03:30Okay, this is like a really um just
  1693. 1:03:32naive question, but are there like um so
  1694. 1:03:35so because like a lot of like human
  1695. 1:03:37cognitive thinking is very paralleled in
  1696. 1:03:39how we're designing LLMs. Is there like
  1697. 1:03:41actual um very like systemic research to
  1698. 1:03:46uh combine like cognitive behavioral
  1699. 1:03:48science with um LLMs or like how do how
  1700. 1:03:51do we like think of new procedures to
  1701. 1:03:54innovate like this?
  1702. 1:03:56>> That's a great question. Um
  1703. 1:03:59I think where we are right now um that's
  1704. 1:04:02what we are like we we're using
  1705. 1:04:04parallels from how humans solve problems
  1706. 1:04:06because we are in this um space of
  1707. 1:04:09reasoning LMS like we're in the but I
  1708. 1:04:12think at the end of the day um we're
  1709. 1:04:14still trying to solve the problem of
  1710. 1:04:16what would get the models to hill climb
  1711. 1:04:18without like explicitly
  1712. 1:04:20uh saying in words what's the reasoning
  1713. 1:04:23space right so um I think the the the
  1714. 1:04:27closed source LMS have done better than
  1715. 1:04:30just like saying that this is their
  1716. 1:04:32reasoning space in words.
  1717. 1:04:35So effectively what I'm trying to say
  1718. 1:04:38here is that you can do a lot of
  1719. 1:04:40techniques where you can be like I need
  1720. 1:04:41to think you I need to break down the
  1721. 1:04:43task step by step which is something
  1722. 1:04:45that Aalia presented in the first
  1723. 1:04:47lecture. I need to decompose the task. I
  1724. 1:04:49need to analyze the task and send it in
  1725. 1:04:51parallel loops. And that's kind of how
  1726. 1:04:54humans solve problems, right? But at the
  1727. 1:04:56end of the day, you also want to answer
  1728. 1:04:59the question of like can that whole
  1729. 1:05:01process of search in the reasoning space
  1730. 1:05:04be automated and is there a well-
  1731. 1:05:07definfined process to do that search and
  1732. 1:05:09if there is if the search space is well
  1733. 1:05:12defined then you can automate it. the
  1734. 1:05:14the challenge of why we're doing it not
  1735. 1:05:16in an automated way but in the in in
  1736. 1:05:19this like language space is because a
  1737. 1:05:21lot of tasks that we're giving to these
  1738. 1:05:22models is not in a well- definfined
  1739. 1:05:24search space. A good example of that
  1740. 1:05:26would be that if you were basically in
  1741. 1:05:28gaming space where the action space is
  1742. 1:05:30well limited and the search space is
  1743. 1:05:32well limited then you can define models
  1744. 1:05:34to go figure out what the search space
  1745. 1:05:37is and how to explore that search space.
  1746. 1:05:39But we are talking about experience and
  1747. 1:05:42like going and experiencing actual
  1748. 1:05:44environments whether that's search tools
  1749. 1:05:46or everything else [snorts] and so so
  1750. 1:05:47you have to collect observations there
  1751. 1:05:50and then use that. So that that's why
  1752. 1:05:52you're seeing this.
  1753. 1:05:57>> Um yeah so far we've been talking about
  1754. 1:05:59improving LMS through different
  1755. 1:06:00techniques. I wonder how those
  1756. 1:06:02techniques are transferable to improving
  1757. 1:06:04agents.
  1758. 1:06:06You will see that in some of the
  1759. 1:06:08subsequent lectures but um I mean all of
  1760. 1:06:11this what's your definition of agents
  1761. 1:06:13versus LMS?
  1762. 1:06:14>> It's basically uh some LM that are
  1763. 1:06:18interconnected and have memories and
  1764. 1:06:20sessions and can't carry all functioning
  1765. 1:06:22calls.
  1766. 1:06:23>> Okay. So I think this is starting to
  1767. 1:06:25represent what I would call an agent but
  1768. 1:06:28not with doesn't have sessions, doesn't
  1769. 1:06:30have memory but because one of the
  1770. 1:06:33fundamental building blocks of agents is
  1771. 1:06:35how do we get the LMS to respond in a
  1772. 1:06:37certain way. So this ends up being uh
  1773. 1:06:39very useful to understand.
  1774. 1:06:42>> Okay. Okay. So for like for like react
  1775. 1:06:45my understanding is that they have some
  1776. 1:06:47show what kind of
  1777. 1:06:51cause and reason
  1778. 1:06:53but but their relation show that it only
  1779. 1:06:56benefits certain [clears throat] domains
  1780. 1:06:58and then help versus other. So now that
  1781. 1:07:02we have the more like RL based post
  1782. 1:07:05training methods will this kind of
  1783. 1:07:07handcrafted
  1784. 1:07:09framework become also weak?
  1785. 1:07:12Yes and no.
  1786. 1:07:14The reason the answer is a yes is
  1787. 1:07:16because if you can define the search
  1788. 1:07:18space of like what to go explore then
  1789. 1:07:21yes. Uh no because defining the search
  1790. 1:07:24space for all tasks of like what to go
  1791. 1:07:27explore is not well defined. Like if you
  1792. 1:07:30wanted to do the task of an accountant
  1793. 1:07:32like if you wanted to build a finance
  1794. 1:07:34agent, if you wanted to build a legal
  1795. 1:07:35agent, what is the set of steps they
  1796. 1:07:37follow? That's very domain specific,
  1797. 1:07:40right?
  1798. 1:07:42But you will be just uh generating
  1799. 1:07:44tokens like toolk is also just tokens
  1800. 1:07:46right so you're just generating robots
  1801. 1:07:49and using the reward to super
  1802. 1:07:51>> right so I think you can in an
  1803. 1:07:53abstraction I can answer it as yes but
  1804. 1:07:55like the specifics still matter right so
  1805. 1:07:57the reason react as an approach matters
  1806. 1:08:00is because they are basically saying
  1807. 1:08:01okay I can reason then I can take action
  1808. 1:08:03then I can go reason I can take action
  1809. 1:08:05so it's basically defining the sequence
  1810. 1:08:06and the workflow if you remember from
  1811. 1:08:08the first uh lecture we that we defined
  1812. 1:08:10the agent we said it's basically some
  1813. 1:08:12abstraction of like how I would define
  1814. 1:08:14that workflow. So how I would generalize
  1815. 1:08:16the whole react approach to an agent is
  1816. 1:08:19I would say okay this is the workflow
  1817. 1:08:20that I need to follow to accomplish the
  1818. 1:08:22task that the user has given but the
  1819. 1:08:24workflow to accomplish the task is still
  1820. 1:08:26very domain specific.
  1821. 1:08:29>> So that's why it's like very hard to
  1822. 1:08:30generalize across domains for
  1823. 1:08:32everything.
  1824. 1:08:34>> Yes.
  1825. 1:08:35>> I have a question about the homeism on
  1826. 1:08:37page on slide number 12.
  1827. 1:08:39>> Okay. the methodology setup page.
  1828. 1:08:41>> Okay.
  1829. 1:08:41>> Um like one question I have like is that
  1830. 1:08:44like you know there like you know the
  1831. 1:08:46way that you define like C subscript T
  1832. 1:08:48like the context like is the context
  1833. 1:08:50just simply being treated as a state.
  1834. 1:08:53>> Yes.
  1835. 1:08:53>> Okay.
  1836. 1:08:54>> I mean the reason it's called context is
  1837. 1:08:56that I mean state in prompting is like
  1838. 1:09:00literally what's in the context.
  1839. 1:09:01>> No. And another thing is that like with
  1840. 1:09:04react, right? Cuz like react like it has
  1841. 1:09:06this thought and then there's this
  1842. 1:09:07action but but it seems like you know in
  1843. 1:09:09the formalism in like page 12 like the
  1844. 1:09:12action I suppose that action would
  1845. 1:09:15include presumably both the thought and
  1846. 1:09:17sort of like the because like since the
  1847. 1:09:20action from that thought would just be
  1848. 1:09:21extracted right you know from the output
  1849. 1:09:24of the
  1850. 1:09:25>> so in the in that particular case it's
  1851. 1:09:27it's uh it's being given the choice. So
  1852. 1:09:30it's basically either outputting a
  1853. 1:09:32reasoning trace or it's outputting an
  1854. 1:09:33action or and it's making a decision
  1855. 1:09:36whether to output one of those two. So
  1856. 1:09:39it's
  1857. 1:09:41>> Oh, I see. So the action the action can
  1858. 1:09:43be just like a spend on reasoning trace,
  1859. 1:09:45right? And then it stops and then like
  1860. 1:09:47invest another action.
  1861. 1:09:49>> Yeah.
  1862. 1:09:52Um this might be a late question but I
  1863. 1:09:55was just wondering like this hless have
  1864. 1:09:57certain features but like have certain
  1865. 1:10:00messes so we can like impose this
  1866. 1:10:03concentrations like instead of like just
  1867. 1:10:06like to like try to find the model to
  1868. 1:10:10somehow like improve the hlessness like
  1869. 1:10:12for example like can we directly
  1870. 1:10:14restrict
  1871. 1:10:15this can use like when they generate
  1872. 1:10:17[clears throat] certain methods to
  1873. 1:10:18restrict like um to research you believe
  1874. 1:10:23hardly
  1875. 1:10:25>> uh yes uh I think it's that is done to
  1876. 1:10:28some extent uh at the same time these
  1877. 1:10:31models are trained on internet so no
  1878. 1:10:34amount of restriction is really going to
  1879. 1:10:37like get all of that out
  1880. 1:10:41so it's it's a it's a game of like when
  1881. 1:10:44you are training on a lot of data
  1882. 1:10:48there's data
  1883. 1:10:51Yeah, there is definitely filtering of
  1884. 1:10:54data that happens.
  1885. 1:10:59>> Okay, if there are no further questions,
  1886. 1:11:04um we'll call it a close of the class.
  1887. 1:11:06Thanks everyone.

About this transcript

This page contains the full transcript of YouTube transcript (Lxh9RF5S-K0) , generated from the public captions YouTube serves with the video. The transcript has 12,681 words across 1,887 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.