YouTube2Text

YouTube transcript (Uni9dqyuuDM) — Transcript

11,925 words · 1,779 segments · language en · Watch on YouTube

Full transcript

  1. 0:05So today's focus will be very much on
  2. 0:09improving the models using search and um
  3. 0:12there can be two kinds of search that we
  4. 0:14will see one in code models where we are
  5. 0:16sampling a lot and then we are searching
  6. 0:18based on that and then u deep research
  7. 0:21style search which you will see in
  8. 0:23homework 3. So a lot of what we will
  9. 0:25cover in alpha code and alpha code 2
  10. 0:28those kind of search patterns um you
  11. 0:31will use also in homework your homework
  12. 0:332 is focused on human eval. So this will
  13. 0:36have this will give you uh an overview
  14. 0:39of what to expect in simpler problems
  15. 0:42and then even more complex problems and
  16. 0:44then the agentic search this will be
  17. 0:47closer to what you'll we will give you
  18. 0:48in homework three. [snorts]
  19. 0:51Um I think the broad thing that I want
  20. 0:54to say with uh these models is that
  21. 0:57we kind of know that the solutions lie
  22. 1:00in the search space of the models but
  23. 1:02how do you curate the answer out of the
  24. 1:05search space of the what the model
  25. 1:07outputs is roughly what we are covering
  26. 1:09today.
  27. 1:11So let's start with alpha code.
  28. 1:15So the problem we want to solve here is
  29. 1:18um a more complex version of the simple
  30. 1:21coding agent problem. So if you use a
  31. 1:23coding agent, what you often get is some
  32. 1:26form of an autocomplete where you are
  33. 1:28have a line and then the coding agent or
  34. 1:32will complete the line for you. So this
  35. 1:34is closer to a competitive programming
  36. 1:36problem where you're given a programming
  37. 1:38uh problem like competitive programming
  38. 1:40problem. You're given a problem
  39. 1:41description and then you're given some
  40. 1:43input and outputs. So you have some sort
  41. 1:46of a contract in that programming
  42. 1:48problem which says that if you give this
  43. 1:50set of inputs you should get these set
  44. 1:52of outputs
  45. 1:55[snorts] and what you want to really
  46. 1:57solve for is how do we solve these
  47. 2:00competitive programming problems so that
  48. 2:03so the kind of things that we already
  49. 2:05are able to do is code completions but
  50. 2:06when we try to do blocks of code or like
  51. 2:09solve real problems uh end to end that
  52. 2:11that starts to be a much harder problem
  53. 2:13as you'll see in the ways that this
  54. 2:15problem gets solved.
  55. 2:17So just to give you a preview of what ho
  56. 2:21how um alpha code came about and like
  57. 2:23what it achieved and it was this is an
  58. 2:26older paper but it's worth remembering
  59. 2:27that at that point in time when alpha
  60. 2:29code was released which is almost like
  61. 2:32four years ago
  62. 2:34it ranked top 54% among the uh contest
  63. 2:37participants uh in 10 contests and this
  64. 2:40was the first time it was shown that AI
  65. 2:42can generalize beyond just narrow tasks
  66. 2:44and like solve problems end to
  67. 2:46in and this was a much harder problem
  68. 2:50than what you could do in just human
  69. 2:52eval where you basically are given a
  70. 2:55very small problem like complete this
  71. 2:56function or you're given instructions to
  72. 2:58exactly solve what you want to solve and
  73. 3:00you don't have to reason about like
  74. 3:02understanding the problem and then
  75. 3:04figuring out what it would take to solve
  76. 3:05the problem. So this was definitely
  77. 3:07longer problem descriptions, longer
  78. 3:09solution lengths and you were having to
  79. 3:12understand from the dock string what is
  80. 3:13the right solution approach even before
  81. 3:15going and solving that. So it's not just
  82. 3:17like taking the problem description from
  83. 3:19the programmer and then just like coding
  84. 3:21it up.
  85. 3:25And I think this is well understood that
  86. 3:28the when the models are generating
  87. 3:31suggestions in one single line it's much
  88. 3:33easier for us as um software developers
  89. 3:37to interact with that and you get much
  90. 3:39higher success rates for example in
  91. 3:40copilot and equivalent uh functions. But
  92. 3:44when you have to solve problems end to
  93. 3:46end, that ends up being a much harder
  94. 3:48problem. So if you look at and I'll go
  95. 3:51through each of these block diagrams uh
  96. 3:53one by one. Um so this is pre um
  97. 3:58uh this is pre having large models. So
  98. 4:00they actually were pre-training their
  99. 4:01own models. The pre-trained models in
  100. 4:03the next report uh will will get
  101. 4:05replaced. So what you see here is that
  102. 4:07you have a stage where you are basically
  103. 4:09coming up with a model from which you
  104. 4:10are going to sample. Now this model we
  105. 4:13will later replace with
  106. 4:16a large language model. So here they're
  107. 4:18also doing pre-training and fine-tuning
  108. 4:21and the data that fed that data that
  109. 4:23really helped this model train was
  110. 4:25GitHub data and then C code contest.
  111. 4:28What code contest is basically a large
  112. 4:31uh chunk of pro problems and solutions
  113. 4:33that come from competitive programming.
  114. 4:36So once they trained the model here,
  115. 4:38they're basically going to do a large um
  116. 4:41they're they're going to sample a lot of
  117. 4:42solutions. So we have seen repeated
  118. 4:45sampling before. So this is repeated
  119. 4:47sampling but at a massive scale. So you
  120. 4:50will end up with a lot of solutions and
  121. 4:52then you're going to play some tricks to
  122. 4:55figure out which set of solutions should
  123. 4:57we even run tests on. So, so far we've
  124. 5:00just been closing the loop where we take
  125. 5:03whatever set of solutions the model
  126. 5:04outputs and then running tests on them.
  127. 5:08In this particular case, you're actually
  128. 5:10going to select. So, there's a selection
  129. 5:12stage before you're going to complete
  130. 5:14and execute and evaluate.
  131. 5:17So, just to walk through things step by
  132. 5:19step and and uh so the first step is
  133. 5:23pre-training.
  134. 5:25You're going to pre-train a model. In
  135. 5:27this particular case, they're going to
  136. 5:28use mass language model loss. You can
  137. 5:30also have a decoder only model which
  138. 5:32we'll see shortly. And the model is
  139. 5:34trained on GitHub code uh about 700 GB
  140. 5:38of that trained with next token
  141. 5:40prediction.
  142. 5:42What's interesting is that when they
  143. 5:43fine-tune it, they are using some
  144. 5:46tricks. So they're using regularization
  145. 5:48so that they can assign higher
  146. 5:49probability to more meaningful patterns.
  147. 5:51This is interesting in code. And then
  148. 5:54they're doing something called as value
  149. 5:55conditioning um and prediction. Uh so
  150. 5:59the thing that I want to highlight in
  151. 6:00this slide is that what they in the
  152. 6:03regularization technique when they're
  153. 6:04doing fine-tuning they assign higher
  154. 6:06weight to higher likelihood tokens so
  155. 6:08that there are certain tokens that will
  156. 6:10have higher likelihood and then they are
  157. 6:12putting lower weight to lower likelihood
  158. 6:13tokens. So this is called as gold. So it
  159. 6:16will help improve the precision. So in
  160. 6:17the next token um next token uh
  161. 6:21prediction loss they are basically
  162. 6:23adding a waiting mechanism to take into
  163. 6:25account uh the likelihood of the tokens
  164. 6:27also uh which helps um in certain ways
  165. 6:31and and helps to uh assign higher
  166. 6:33probabilities to more meaningful
  167. 6:34patterns. So this is done in the
  168. 6:36fine-tuning phase.
  169. 6:38So once you get this model that is u
  170. 6:41able to and this was an encoder decoder
  171. 6:43model that they were initially using and
  172. 6:44then they also tried with decoder only
  173. 6:46models in alpha code 2. Once they get
  174. 6:48this model they are going to try large
  175. 6:50scale sampling.
  176. 6:52Uh they generate 1 million 1 million is
  177. 6:56a large number they generate 1 million
  178. 6:58diverse sample programs per question. So
  179. 7:00if you have a question a competent
  180. 7:02programming per question they're
  181. 7:03generating 1 million solutions half in
  182. 7:05Python half in C++. So machines can do
  183. 7:08that and they randomize the problem tags
  184. 7:12and the ratings in the prompt and they
  185. 7:13use a high sampling temperature. So it's
  186. 7:15like these solutions are going going to
  187. 7:18be diverse
  188. 7:20and once they generate these set of
  189. 7:22solutions what they're doing is they are
  190. 7:25doing some amount of filtering and
  191. 7:26clustering. So they filter the samples
  192. 7:28to only those that passed tests given in
  193. 7:31the problem statement and then they are
  194. 7:33clustering them so that they're
  195. 7:35syntactically different but semantically
  196. 7:37equivalent. So they differentiate
  197. 7:39between that. So they are basically
  198. 7:44uh using a clustering mechanism where
  199. 7:47they use a separate test input
  200. 7:48generation model train it to predict
  201. 7:50test inputs given problem descriptions
  202. 7:52and then create these new test inputs
  203. 7:54for uh unseen problems. So they're
  204. 7:56basically trying to figure out different
  205. 7:58trick uh tricks to cluster this um this
  206. 8:02test inputs the semantic equivalence
  207. 8:04being one way to do that. Now the reason
  208. 8:07this clustering is important is is it it
  209. 8:10is effectively providing a way for us to
  210. 8:12select which set of solutions are
  211. 8:15diverse enough for us to then uh
  212. 8:17evaluate to close the loop.
  213. 8:21So now what you can do is you can submit
  214. 8:24only a subset of solutions to the code
  215. 8:26forces platform which is the actual
  216. 8:28competition platform.
  217. 8:30So and that will check the program
  218. 8:33correctness. It will uh benchmark
  219. 8:35against other performers uh best
  220. 8:37performers on this task like human
  221. 8:39competitors. But the challenge here is
  222. 8:40that you cannot submit all the
  223. 8:42solutions. So 1 million solutions cannot
  224. 8:44be submitted to this uh platform. So
  225. 8:46they have done
  226. 8:48a curation phase, a filtering and
  227. 8:50clustering phase to get to this stage.
  228. 8:53Um and then there's also evaluation on
  229. 8:56code contest. Remember that code contest
  230. 8:58was used to train the model. So there's
  231. 9:00a test set that they hold out uh which
  232. 9:02will basically
  233. 9:04give them a signal. So this is the data
  234. 9:06set that is created by authors but they
  235. 9:08can also um measure signal on this
  236. 9:11particular data set to figure out if
  237. 9:13their solution is supposed to do well or
  238. 9:15not.
  239. 9:17So when they first uh did evaluation on
  240. 9:20code forc's platform um they ran like
  241. 9:24they they took their model ran it live
  242. 9:26generated samples filtered with example
  243. 9:28tests clustered to get some submissions
  244. 9:30and then submitted to the platform and
  245. 9:32they ran this with uh they submitted in
  246. 9:3510 competitions which each had 5,000
  247. 9:37participants and uh what they found was
  248. 9:41that their solutions with this alpha
  249. 9:43code actually had an average ranking of
  250. 9:4654.3 assuming 10 submissions per
  251. 9:49problem. So not not 1 million and um it
  252. 9:53was competitive with 28% of the
  253. 9:55competitors in the last 6 months. So
  254. 9:58this table is showing you that if you
  255. 10:00looked at a certain contest ID uh how
  256. 10:03was the alpha code model doing what was
  257. 10:05its percentage ranking the best ranking
  258. 10:08and the estimated ranking and the worst
  259. 10:09ranking uh relative to uh other
  260. 10:12programmers. This is more of a ranking
  261. 10:14based as to like once you submit a
  262. 10:16solution you're cap um you're ranked
  263. 10:18based on the efficiency of your solution
  264. 10:20and the correctness of your solution.
  265. 10:26Before I move further uh questions
  266. 10:35you go back to previous page.
  267. 10:37It seems like the I mean I mean the the
  268. 10:41the numbers table if you look at the
  269. 10:43performance across different data sets
  270. 10:45it seems that
  271. 10:47>> this is different contest.
  272. 10:48>> Yeah. It seems they did pretty well
  273. 10:50[clears throat]
  274. 10:50162.
  275. 10:51>> Mhm. Even the worst one is like 50 some
  276. 10:58the
  277. 11:01>> but if you somehow it's like 16
  278. 11:05>> like when is worse it's really worse
  279. 11:08like 90% just I'm just curious why like
  280. 11:12[clears throat] have a big variation of
  281. 11:14how people come
  282. 11:16>> um I'll ask you that question back what
  283. 11:19do you think
  284. 11:21I mean this is this is your pipeline
  285. 11:23right
  286. 11:28>> where where will the variance come from
  287. 11:31so different contests will have
  288. 11:33different problem inputs
  289. 11:35>> maybe it's the two contests so the two
  290. 11:38contest they perform well if the contest
  291. 11:40are similar than the test
  292. 11:45other
  293. 11:48than new algorithm or new contest then
  294. 11:51the algorithm may fail to or struggle to
  295. 11:54answer because it doesn't include
  296. 11:57>> okay
  297. 11:59but I don't know if it's true
  298. 12:00>> so the large scale I mean so what what
  299. 12:04um what's your name again
  300. 12:08>> is asking is that why do we get variance
  301. 12:10across different contest ids and it does
  302. 12:12well in one contest and does not do well
  303. 12:14in another so at the end of the day you
  304. 12:16are depending on
  305. 12:19a uh how how close are these say contest
  306. 12:22problems how in distribution they are.
  307. 12:25So that's one pos pl pos pl pos pl pos
  308. 12:26pl pos pl pos pl pos pl pos pl pos pl
  309. 12:26pos pl pos pl pos pl pos pl pos pl pos
  310. 12:26pl pos pl pos pl pos pl pos pl pos pl
  311. 12:26possible hypothesis the other plausible
  312. 12:28hypothesis is that our [snorts] ability
  313. 12:30to so in the large scale sampling that
  314. 12:33would control like is one of the
  315. 12:35solutions correct but then our ability
  316. 12:37to select the right set of candidate
  317. 12:40solutions might also be affected in
  318. 12:41different contest ids right so the
  319. 12:44selection stage can also be a bottleneck
  320. 12:46here
  321. 12:48like there can be solutions that are
  322. 12:50almost correct but not completely
  323. 12:52correct
  324. 12:55Yes. Yes.
  325. 12:57Seems like a very arbitrary. Do they
  326. 13:00have an experiment that shows how the
  327. 13:02model pass through uh scales as the
  328. 13:06number of samples?
  329. 13:08>> So I think they basically went so they
  330. 13:10do have some experiments that they did
  331. 13:12but I think uh it's sort of order of
  332. 13:15magnitude. So with this particular model
  333. 13:16size and there is some results I'll show
  334. 13:19you. uh with this particular model size
  335. 13:21they had to go for much larger number of
  336. 13:23samples. I think if you remember from
  337. 13:26earlier slides on test time compute when
  338. 13:28you have smaller models you do have to
  339. 13:30go for much larger number of samples to
  340. 13:32get um the same passet Katur
  341. 13:40>> so the saturation so let's look at the
  342. 13:42results and then come back to that
  343. 13:43comment but I think on the question
  344. 13:45around why is it different in different
  345. 13:47contests I mean the inputs are different
  346. 13:48and then the pipeline will the selection
  347. 13:51stage can be a bottleneck so both of
  348. 13:52those influence
  349. 13:54where uh it does well and where it
  350. 13:56doesn't do well.
  351. 14:01[clears throat] So there is two things
  352. 14:03worth noticing. Uh so
  353. 14:06when we when we compute uh solutions
  354. 14:08with repetitive sampling in test time
  355. 14:11compute and and this is something that
  356. 14:12you're definitely using in homework too.
  357. 14:14Uh you have this notion of passet K. So
  358. 14:16that's the percentage of problems. So if
  359. 14:18you get the model to generate case
  360. 14:20samples and you submit all of them for
  361. 14:22evaluation on the hidden test uh how
  362. 14:25many problems will actually solve the
  363. 14:29problem description that was given. It
  364. 14:31measures how good is the search aspect
  365. 14:34of the sampling process. So it's
  366. 14:35basically coverage in the lectures that
  367. 14:37we covered before.
  368. 14:39uh what this particular um
  369. 14:43benchmark measures is 10 at k uh 10
  370. 14:46being the number of submissions that
  371. 14:48you're going to go submit for
  372. 14:49evaluation. So even if you get the model
  373. 14:52to output k samples in this particular
  374. 14:54case 1 million um you don't have the
  375. 14:58ability to measure correctness on all
  376. 15:00the samples uh for the final set of
  377. 15:03solutions. So you do have to do some
  378. 15:05selection um so or scoring to decide
  379. 15:08which set of solutions I'm going to
  380. 15:09submit. So it measures also the
  381. 15:11filtering process of how well the model
  382. 15:15will behave when you have a very large
  383. 15:16number of samples. So you you're not
  384. 15:18just generating samples but you have to
  385. 15:19do some search yourself before you can
  386. 15:21submit this solutions uh for evaluation
  387. 15:24to hidden tests.
  388. 15:26Now why does this matter? So this is
  389. 15:30validation set and that's test set and
  390. 15:32they train different model sizes. So
  391. 15:34this is 9B model 90 uh 41B model. So
  392. 15:38that's a larger model and then 41B with
  393. 15:40clustering.
  394. 15:41And uh what they're presenting is
  395. 15:43validation set results for
  396. 15:4710 at 1K. So this is the question you
  397. 15:49were asking me. um they're basically
  398. 15:52going to submit 10 solutions out of 1k
  399. 15:54generated outputs and then keep
  400. 15:57increasing that to 10k 100k and 1
  401. 15:59million and then they're going to do a
  402. 16:01similar set for test set as well. Um
  403. 16:06and what you will notice is that
  404. 16:08typically the larger model size
  405. 16:10consistently will do better than the
  406. 16:12smaller model size. I think that is
  407. 16:13something we have talked about before.
  408. 16:15Um but the other thing to notice is that
  409. 16:17as you go for larger number of samples
  410. 16:20which is something we have seen as well
  411. 16:22you are able to do better. So like going
  412. 16:24from 10 at 1K to 10 at 1 million you're
  413. 16:28clearly doing better and same on the
  414. 16:29test set side and um the clustering uh
  415. 16:33so typically this we we had covered this
  416. 16:37slide with pass at um number of samples
  417. 16:40uh in this particular case even
  418. 16:42clustering uh is consistently uh so 10
  419. 16:46at 1K will definitely also improve
  420. 16:49similar to pass at 1K and then if you
  421. 16:50look at the last row here which is 41B
  422. 16:53plus clustering. Well, you see that
  423. 16:55that's consistently better. So like 9B
  424. 16:57versus 41B versus 41B plus clustering,
  425. 17:00the 41B plus clustering is definitely
  426. 17:02going to still be better than um the one
  427. 17:05before because it definitely provides an
  428. 17:07improvement.
  429. 17:09And and the reason for doing that is
  430. 17:11because if you were to measure um the
  431. 17:13set of solutions that the model has
  432. 17:14output and you wanted to measure their
  433. 17:16diversity, the clustering provides you a
  434. 17:18way to like submit only the diverse set
  435. 17:20of solutions if you can only submit 10
  436. 17:22problems. Um and since competitive
  437. 17:25coding problems are quite difficult, you
  438. 17:27don't get much benefit out of uh
  439. 17:29submitting the same set of solutions uh
  440. 17:32to the evaluation process. So if you can
  441. 17:34like choose which set of uh problems to
  442. 17:36submit uh that helps
  443. 17:42and u if we were to measure um just 10
  444. 17:47at uh k and pass at k if you had u so
  445. 17:50pass at k would be unlimited attempts
  446. 17:52and 10 at k would be 10 attempts uh on
  447. 17:54evaluating per problem. On the
  448. 17:58x-axis you have the sampling budget and
  449. 18:00on the y-axis you have uh this accuracy
  450. 18:03in terms of um how many attempts you get
  451. 18:05to solve the problem. The solve rate
  452. 18:07definitely scales log linearly with more
  453. 18:09samples. So this is very much in line
  454. 18:11with what we had seen for pass k in
  455. 18:13repetitive sampling. So even after the
  456. 18:14selection stage we definitely see the
  457. 18:17same log linear trend with more samples
  458. 18:20and uh better models have better slopes.
  459. 18:22So in this particular case you see that
  460. 18:2441B which is the blue curve has better
  461. 18:27sol uh sorry the purple curve of 41B has
  462. 18:31better slope compared to the 300 million
  463. 18:33parameter model uh at the bottom and
  464. 18:36same applies even for passet K. And then
  465. 18:39the final thing is that when only 10
  466. 18:41samples are submitted um
  467. 18:45then then you do get bottleneck in
  468. 18:47certain ways. So you have to um you can
  469. 18:50get higher accuracy. So if you compare
  470. 18:52the y-axis 10 atk versus pass at k if
  471. 18:55you have unlimited attempts per problem
  472. 18:58uh which is a syn synthetic scenario you
  473. 19:01are almost getting to something above uh
  474. 19:0340% and here you are only getting to
  475. 19:0530%. So there is definitely some
  476. 19:07bottlenecking happening in selection
  477. 19:09stage. So you are bottlenecked by how
  478. 19:11you filter and cluster in some ways when
  479. 19:14you have to choose which set of
  480. 19:15solutions um uh will pass the tests.
  481. 19:21Yes,
  482. 19:23>> I just wondering like if this trend
  483. 19:25continue you really get it to another
  484. 19:29like another six or more like that will
  485. 19:32be one trade. If you really get one
  486. 19:33trading then the score if the tren
  487. 19:35continue will be kind of double. So I'm
  488. 19:40do you really believe like if we just
  489. 19:42make it one trading we can just like
  490. 19:45double the performance. Well, we going
  491. 19:48to alpha code 2. Making the model better
  492. 19:50is a slightly easier access than scaling
  493. 19:52the number of samples that you're going
  494. 19:54after. So on alpha code 2, uh the model
  495. 19:58performance improves and that helps you
  496. 20:00reduce the number of samples to get the
  497. 20:02same performance or at 1 million you'll
  498. 20:03get a much better performance. So this
  499. 20:05is uh an older model but it's a weaker
  500. 20:08model but the trends generally hold
  501. 20:12>> and and and in some ways um there's a
  502. 20:16I mean the larger models have done
  503. 20:18better generally speaking but there's a
  504. 20:20model capability gap so if the base
  505. 20:22models are not strong enough they're
  506. 20:24going to hit limits at certain point
  507. 20:28>> if you really have no problem
  508. 20:30so you really become of the in numbers.
  509. 20:34You can just really do one one tree
  510. 20:38sample with this graph like
  511. 20:40>> if this if the log line trend continues
  512. 20:42then yes that might be a project idea
  513. 20:45worth exploring if the costs are not
  514. 20:48prohibitive.
  515. 20:54>> Yes,
  516. 20:54>> I just want to say I think that could be
  517. 20:56really useful if you think that one
  518. 20:58problem is really important. you can
  519. 20:59just pour your
  520. 21:01>> on your computer solving that problem.
  521. 21:06>> I think the challenge with that which is
  522. 21:08something that is work um also that's a
  523. 21:11good comment. So one of the challenges
  524. 21:14with um solving it that ways is that you
  525. 21:16kind of assume that if we sample more
  526. 21:18the diversity continues to increase.
  527. 21:22One of the challenges that we will see
  528. 21:23in alpha code 2 and I'll emphasize again
  529. 21:25is that you do have to ensure that as
  530. 21:28you sample more and more you are getting
  531. 21:30more diverse solutions and part of the
  532. 21:32process of clustering is that it's
  533. 21:33effectively figuring out which are the
  534. 21:36diverse set of solutions. So if you
  535. 21:38sample 10x more than what was sampled
  536. 21:40here but you don't end up with more
  537. 21:42diverse solutions then you're actually
  538. 21:43not going to improve.
  539. 21:46>> Is there a reason why we have a long
  540. 21:48linear relationship here? Why why is it
  541. 21:51not any other um modeling of wiverse
  542. 21:54text?
  543. 21:55>> So this was covered earlier I think the
  544. 21:57um passet K versus unlimited attempts
  545. 22:00this is uh theoretically derable and I
  546. 22:03think the main thing that I'm
  547. 22:05emphasizing is that even after the
  548. 22:06selection phase that log linear trend
  549. 22:08holds
  550. 22:10um the passet K versus sample budget
  551. 22:12this was covered in um I don't know the
  552. 22:14lecture number but Aalia covered this
  553. 22:16and that paper actually theoretically
  554. 22:18derives it. This is the large language
  555. 22:21monkeys paper or the one right after
  556. 22:23that. Yeah, but if you look at the
  557. 22:26derivation uh we can work through that
  558. 22:28offline.
  559. 22:33Um
  560. 22:36okay so if we look at takeaways I think
  561. 22:39the fun aspect here is that um we can
  562. 22:42get high coverage
  563. 22:45by sampling and then so this large scale
  564. 22:47sampling this filtering and the
  565. 22:48clustering approach you can get higher
  566. 22:50coverage um and um they were able to
  567. 22:55actually also make sure that the model
  568. 22:57is not just copying existing solutions
  569. 22:59it actually reasons. So they did some
  570. 23:00search over the training data and
  571. 23:02actually saw that u there was the
  572. 23:04generated code was had some novelty. So
  573. 23:07this was actually generalization out of
  574. 23:09distribution. Um the challenge with
  575. 23:11these particular set of approach that
  576. 23:13they noticed that's worth highlighting
  577. 23:14is that they were training the model on
  578. 23:16loss and loss is often a poor proxy for
  579. 23:19solve rates. So because um there are
  580. 23:22many solutions that could have solved
  581. 23:23the problem. So they did see that it
  582. 23:25this model did not do well on uh say
  583. 23:28dynamic programming or constructive
  584. 23:29algorithms uh in some ways. So it was
  585. 23:32not the strong in certain uh domains.
  586. 23:35And then the other aspect was that it
  587. 23:37was requiring a large scale set of
  588. 23:39sampling. So that was not ideal in terms
  589. 23:42of like how practical this was to be
  590. 23:44used u everywhere.
  591. 23:48Um if there was a time bound then um you
  592. 23:53can imagine uh so if you if you
  593. 23:54basically was just uh examining accuracy
  594. 23:57then you want to make unlimited attempts
  595. 23:59but if you want to do uh like time
  596. 24:02limited bound in terms of efficiency
  597. 24:04then you do want to like rank acceptable
  598. 24:06solutions as they get generated. So that
  599. 24:08becomes really important and um
  600. 24:12as I already mentioned that more
  601. 24:14difficult domains um required more
  602. 24:16experiments. So this was not like they
  603. 24:18the this solution approach actually
  604. 24:20wasn't working well on difficult
  605. 24:21problems and um in fact there it's both
  606. 24:25a matter of like you might need more
  607. 24:27steps to solve the problem. So this
  608. 24:29particular approach in one shot did not
  609. 24:31do a reasonably strong job. So
  610. 24:32multi-step um solution approaches would
  611. 24:35do better here.
  612. 24:38So this was alpha code um summary. Now
  613. 24:41let's see what can we do better. So this
  614. 24:43was like 2022. If you look at the next
  615. 24:46set of paper which is alpha code 2, they
  616. 24:49improved upon this substantially and and
  617. 24:51that was really helpful and we can also
  618. 24:54learn um what were the differences uh
  619. 24:57and that really helps us understand what
  620. 24:59pushes the frontier even further. So
  621. 25:01alpha code 2 started with a hypothesis
  622. 25:04of what if you don't uh pre-train your
  623. 25:06model you use an existing LLM. So in
  624. 25:08this particular case this work was at
  625. 25:10Google. So they decided to use Gemini
  626. 25:12Pro um instead of like using
  627. 25:16in uh training their own model and then
  628. 25:19they want to customize it to get uh
  629. 25:21better performance on this particular
  630. 25:23problem set on co uh competitive
  631. 25:25programming.
  632. 25:27So the first set of changes that were
  633. 25:28made were that instead of pre-training
  634. 25:31you basically are just going to
  635. 25:32fine-tune Gemini Pro. So it's not just
  636. 25:34prompting they are fine-tuning the
  637. 25:36model. And then um in terms of sampling
  638. 25:39and evaluation for the large scale
  639. 25:41sampling they want to ensure diversity.
  640. 25:43So for diversity they actually had
  641. 25:45multiple alpha code 2 models that allow
  642. 25:48for massive sampling. So when they did
  643. 25:50and uh go and do fine-tuning they
  644. 25:52actually had multiple variants of this
  645. 25:55model so that they get diversity in the
  646. 25:57output sampling. And then the third
  647. 25:59thing they did was that to select the
  648. 26:02subset of candidates they had a scoring
  649. 26:04model. So you can see that as a reward
  650. 26:07model um which was used for obtaining
  651. 26:10the best candidates. So it's not just
  652. 26:12based on clustering and filtering which
  653. 26:14is a heristic for saying okay this would
  654. 26:16be semantically equ u semantically
  655. 26:20equivalent but like there's diversity in
  656. 26:23in syntax. They are actually now going
  657. 26:26for a scoring function which can like
  658. 26:28learn that function. So it's a learned
  659. 26:30approximation of what should be given
  660. 26:31high score and what should be given a
  661. 26:33low score.
  662. 26:36So um the new ideas here as I
  663. 26:40highlighted was a that they are going to
  664. 26:42fine-tune a Gemini Pro model to score
  665. 26:45correctness before submitting. So that's
  666. 26:47a reward model and they also had a
  667. 26:49family of models based on different
  668. 26:51hyperparameters. So different difficulty
  669. 26:53levels, different tags. Um so they
  670. 26:56fine-tune several models with varied
  671. 26:57hyperparameters and then that maximizes
  672. 26:59the diversity of the number of samples
  673. 27:01they generate and they also improve
  674. 27:04their data sets. So the data set that
  675. 27:06they fine-tune on is a V2 version of
  676. 27:09code contest which is actually open
  677. 27:10source and then they had another high
  678. 27:12quality data set for scoring purposes.
  679. 27:16So going back to this diagram um what
  680. 27:21changes next? So let's take a more
  681. 27:23detailed look. So here if you look at um
  682. 27:27the input model on the finetuning stage
  683. 27:30you have this new data set called code
  684. 27:32contest v2 um which is going to be used
  685. 27:36to um generate now you're going to do
  686. 27:39some tagging. So there's some amount of
  687. 27:40just like take your code contest v2 data
  688. 27:43set and put uh bisect it or rather
  689. 27:46segment it into different data sets to
  690. 27:48fine-tune different versions of uh
  691. 27:51models that are going to generate
  692. 27:52samples. So that's one set of like
  693. 27:54intermediate alpha code 2 models that
  694. 27:56they will uh generate. And then they had
  695. 27:58another high quality data set they're
  696. 28:00going to use to make this even better.
  697. 28:02And this same set of model uh same set
  698. 28:05of data will also be used to generate a
  699. 28:07scoring model from from the same model.
  700. 28:10And based on that they're going to uh so
  701. 28:12this is basically a notion of like
  702. 28:15there's a the data set is segmented and
  703. 28:18used to tune multiple uh models uh based
  704. 28:21to get more diverse samples.
  705. 28:24Uh what's different about the data set
  706. 28:26is that the problems and solutions are
  707. 28:29higher quality and vetted and scored
  708. 28:32better and the scoring model is able to
  709. 28:36um estimate the correctness of the code
  710. 28:37sample between zero and one based on
  711. 28:39this higher quality data set. So they
  712. 28:41manually curated um this data set uh got
  713. 28:46uh more human annotators in place so
  714. 28:48that they could uh train the model to
  715. 28:51estimate correctness better.
  716. 28:54And then the other aspect is that they
  717. 28:56had this family of models. Uh instead of
  718. 28:58having just one model. Now on the
  719. 29:01sampling and evaluation side,
  720. 29:06they split the sampling across models.
  721. 29:08They in fact went to only C++. Earlier
  722. 29:10it was C++ and Python half samples. So
  723. 29:13they split the sampling across models
  724. 29:14but only C++. And uh when they generate
  725. 29:18the samples, they're randomizing the
  726. 29:20temperature and the metadata so that
  727. 29:22they can get diverse outputs. So this is
  728. 29:24uh this is the massive sampling
  729. 29:26pipeline. For each output, they're going
  730. 29:28to execute on test input and they are
  731. 29:30filtering out anything that's incorrect
  732. 29:32and or doesn't compile. So they remove
  733. 29:3495% of the samples. Uh at this point,
  734. 29:37they're left with about 50k samples. And
  735. 29:40then after that pro process they're
  736. 29:42going to aggregate um and keep the top
  737. 29:4510 largest clusters. There's reranking
  738. 29:48on top of that uh based on the scoring
  739. 29:50model to say like how likely is it to be
  740. 29:53correct. So they score each code sample
  741. 29:56uh and pick the best candidate per
  742. 29:57cluster and once they have that that's
  743. 30:00when they're going to submit and say
  744. 30:01that did it win or did it not win. The
  745. 30:04eval is going to be same as alpha code.
  746. 30:07So if we are to compare results now uh
  747. 30:10this is uh comparing alpha code 2 versus
  748. 30:13alpha code. So alpha code so on the
  749. 30:16x-axis you see the sampling budget. Uh
  750. 30:19alpha code we were doing 1 million
  751. 30:20samples. Uh here we're going to vary the
  752. 30:23sampling budget per problem. And on the
  753. 30:25y-axis you have solve rate.
  754. 30:28Um as you can see that once you get to
  755. 30:31100 samples you basically so alpha code
  756. 30:35was using 1 million samples for alpha
  757. 30:36code 2 once you get to uh 100 samples
  758. 30:39you are achieving the same solve rate as
  759. 30:42u alpha code and uh if you want to go
  760. 30:45beyond that you can use more samples. So
  761. 30:48the solve rate is still improving with
  762. 30:49the increase in sampling budget. And if
  763. 30:51you were to basically say how many what
  764. 30:54is the maximum performance achieved um
  765. 30:56alpha code 2 with u 1 million samples
  766. 30:59was solving 43% it was getting 43% solve
  767. 31:02rate while alpha code was only getting
  768. 31:0425%. So um in this particular case even
  769. 31:09though they're uh using the same number
  770. 31:11of samples a better base model better
  771. 31:13diverse solutions and then a better
  772. 31:15scoring is giving them so this whole
  773. 31:17system is giving them performance gains
  774. 31:19which is almost um 2x relative to where
  775. 31:23the previous system was
  776. 31:28questions.
  777. 31:32Yes.
  778. 31:3495% of um sampling wasted on not
  779. 31:38compiling or poor answer seems like a
  780. 31:42very high cost. Were there any other uh
  781. 31:44studies to see if there could be better
  782. 31:46methods of sampling more reliable
  783. 31:48answers maybe by like better prompting
  784. 31:50or I mean like it did mention randomized
  785. 31:53temperature but were there any other um
  786. 31:56approaches?
  787. 31:57So in this particular case, this paper
  788. 31:59did not.
  789. 32:00>> But if you are to refer to some of the
  790. 32:02work that we have discussed before, what
  791. 32:04would you need to do to
  792. 32:07>> to improve that?
  793. 32:09>> This is an older piece of work, right?
  794. 32:11>> Yes.
  795. 32:12I would I would um try the approaches we
  796. 32:15took in homework.
  797. 32:18uh like
  798. 32:19>> like um better prompting or uh better
  799. 32:23maybe using instead of like wasting all
  800. 32:25of the compute on 1 million um sampling
  801. 32:28maybe I would try to self iterate based
  802. 32:30on one of the sampling at least once or
  803. 32:32maybe at least try to have a better
  804. 32:34method of aggregating some of the
  805. 32:36information from the various sampling
  806. 32:38>> right so I think what you're saying uh
  807. 32:40so just to repeat the answer in homework
  808. 32:44one you had done some form of
  809. 32:45self-refinement so this is essenti
  810. 32:47potentially parallel search in some ways
  811. 32:49you've generated a lot of solutions and
  812. 32:50then you are clustering on top of that
  813. 32:53if you do a refinement process where you
  814. 32:56have generated some solutions and then
  815. 32:57you're saying okay if I can get any
  816. 32:59feedback on top then can I improve these
  817. 33:01solutions better that's one approach
  818. 33:03that would like cut down the number of
  819. 33:04samples but like increase the time that
  820. 33:06you if you can collect any feedback um
  821. 33:10the question I would ask is that how
  822. 33:11would you collect feedback like what
  823. 33:13would be feedback in this particular
  824. 33:14case that's worth knowing
  825. 33:16thinking through. I think the other
  826. 33:19comment would be that if you can get the
  827. 33:22model to do slightly better with RL. So
  828. 33:24like if it can get better at solving uh
  829. 33:26things um
  830. 33:28with the RL loop in in between when we
  831. 33:31cover train time scaling then that can
  832. 33:33help cut down how much we need to put in
  833. 33:35test time. So both those approaches can
  834. 33:38like reduce the cost on the sampling
  835. 33:40side.
  836. 33:46Let's try that one.
  837. 33:48>> So, so when it comes to practical
  838. 33:51applications, so so when we are using
  839. 33:53everyday kind of thinking models, we are
  840. 33:56still talking about couple of dozens of
  841. 33:58samples, right? I mean when it comes to
  842. 34:00time scale and and then we hear about
  843. 34:03this uh open AI 20k per month researcher
  844. 34:08those are the multi,000 multihundreds of
  845. 34:12ks of samples uh applied uh in
  846. 34:16production. So I think the nature look
  847. 34:19system is more of how you would build
  848. 34:21the system that is generating those
  849. 34:23dozen of samples right I think we have
  850. 34:26discussed this before um for us to think
  851. 34:30about these systems I think the big
  852. 34:31question you're as asking is
  853. 34:36how would you build the system to begin
  854. 34:38with that can reason well that can close
  855. 34:40the loop so I think there is a line of
  856. 34:42research which has tried to answer that
  857. 34:44question and what this is covering is
  858. 34:46that if you started with an LLM and you
  859. 34:49wanted to solve these complex problems,
  860. 34:51how would you build a system that can
  861. 34:53solve that problem? And then if you can
  862. 34:54distill all of that knowledge into a
  863. 34:56single model, then that becomes a large
  864. 34:58reasoning model.
  865. 35:00But this is a more of a
  866. 35:02um multi- uh multi- aent system in
  867. 35:05almost some ways where you're basically
  868. 35:07having one model produce outputs and
  869. 35:09then another model score it. And then
  870. 35:12here a family of models is producing
  871. 35:14outputs and then there is another family
  872. 35:15of models that's scoring it. So that
  873. 35:18gives you more tricks up your sleeve if
  874. 35:20you had to like rearchitect the system
  875. 35:22from scratch as opposed to depending on
  876. 35:25what the current generation of models
  877. 35:26can or cannot do. And the paradigm I
  878. 35:30believe because at the end of the day
  879. 35:32when we are saying in test time compute
  880. 35:34there should be a solution in the space
  881. 35:36of what model app was generated. Um the
  882. 35:39paradigm is effectively that you should
  883. 35:40be able to search that solution. So what
  884. 35:42this is roughly answering is how would
  885. 35:45you search for a solution
  886. 35:47in the output space of what models
  887. 35:50output?
  888. 35:55>> Still a question. Yes.
  889. 35:57So why the screen model? Yeah.
  890. 36:03>> Say that again.
  891. 36:04>> Why is the screen model?
  892. 36:10Why is it like why the scoring model
  893. 36:12only desire?
  894. 36:15>> So I think the way to recall it is that
  895. 36:17why is the scoring model not using code
  896. 36:19contest v2? I mean you can train your so
  897. 36:22the code conscious B2 there would be
  898. 36:24contamination right the scoring model
  899. 36:27should not see exactly the same data but
  900. 36:29it does need to see some data in the
  901. 36:30distribution right
  902. 36:33it's it's basically a matter of you're
  903. 36:35training the scoring model not
  904. 36:37necessarily on the same problems but you
  905. 36:38want to if if you're designing that
  906. 36:41system from scratch how would you train
  907. 36:42a reward model what you want to show it
  908. 36:44is that for this kind of problems if you
  909. 36:46had these two solutions which solution
  910. 36:47should you prefer
  911. 36:50That's what you're teaching the scoring
  912. 36:52model or how what ranking should you
  913. 36:54apply to that
  914. 36:57you post train by the first design.
  915. 37:02>> Mhm.
  916. 37:03>> It's the same
  917. 37:05data set.
  918. 37:09>> Um
  919. 37:11I mean you could have mixed those data
  920. 37:13sets and then then done the same thing.
  921. 37:15Yes. But that that is a doable exercise.
  922. 37:18It's just multi-stage.
  923. 37:21The it's not the same in the sense that
  924. 37:24um uh when you do any kind of fine
  925. 37:26tuning, if you're changing the quality,
  926. 37:28then the model and if you're not mixing
  927. 37:30the previous version, then the model is
  928. 37:32forgetting some of the previous
  929. 37:34information when it's tuning the in the
  930. 37:36last stage.
  931. 37:39Okay.
  932. 37:46So if you were to look at the aggregate
  933. 37:48results of alpha code 2 in terms of the
  934. 37:51normalized score versus the um how it
  935. 37:55would compare to human contestants
  936. 37:58there. Uh and the way you would do that
  937. 38:00is you would basically compare the
  938. 38:02percentile of contestants who score um
  939. 38:04at a certain level. Um what alpha code 2
  940. 38:07was uh achieving is 85th percentile
  941. 38:10between the expert and the candidate um
  942. 38:13the master candidate solutions while the
  943. 38:15human u and and it was outper like while
  944. 38:18alpha code was outperforming 46% alpha
  945. 38:21code 2 if you took two top two
  946. 38:24performance on the like if you took two
  947. 38:26top two solutions then it was actually
  948. 38:27outperforming 99.5%
  949. 38:30but overall it was basically scoring
  950. 38:32closer to 85th percentile across human
  951. 38:35contestants. So that was a big deal. It
  952. 38:36was like okay in this particular code
  953. 38:38contest problems in this competitive
  954. 38:40programming it's doing very well in some
  955. 38:43way. So that was a big accomplishment in
  956. 38:45in one single year uh just uh with an
  957. 38:48improved system
  958. 38:51and I think uh for us what's worth
  959. 38:54learning here is that we are increasing
  960. 38:56the performance with less number of
  961. 38:58samples. So we didn't have to like
  962. 38:59necessarily scale the number of samples
  963. 39:02but we had like better foundation model
  964. 39:04and then the scoring model that is
  965. 39:06selecting the best candidate is also
  966. 39:08helping uh the solution. The
  967. 39:10experimentation is still quite costly
  968. 39:12and then as uh one of our uh classmates
  969. 39:15pointed out this is very specific to
  970. 39:17code and then a lot of the computers
  971. 39:19wasted and generating samples that might
  972. 39:21have bad syntax and so on that you have
  973. 39:24to go and filter out. So one set of
  974. 39:27questions that I have for the class at
  975. 39:29this point in time is that
  976. 39:33how would you uh change these methods
  977. 39:35based on task complexity for example.
  978. 39:39So actually I will pose that question
  979. 39:41and then the other question I will pose
  980. 39:44is um how can we embed reasoning
  981. 39:46directly into these models?
  982. 39:48take a minute to like talk to folks next
  983. 39:51to you or
  984. 39:53somewhere in the vicinity and then uh
  985. 39:55let's come back and discuss those two
  986. 39:57questions.
  987. 40:01>> Let's tackle the second question. So um
  988. 40:04how can we change these methods based on
  989. 40:05task complexity? So if I easy problems
  990. 40:08versus hard problems,
  991. 40:10any takers for that?
  992. 40:20Okay.
  993. 40:21>> What you could do is uh you have like a
  994. 40:22separate model that actually kind of
  995. 40:25like judge each question based off it
  996. 40:27being like easy, medium or hard. You
  997. 40:30create like your data set where you're
  998. 40:31sampling from also has those labels and
  999. 40:34you just if you declare a question easy,
  1000. 40:35you sample more from the easy bank. So
  1001. 40:38it's like it's a better sample.
  1002. 40:41>> Okay. So is it more on the training side
  1003. 40:43you will change or is it more on the
  1004. 40:45sampling side that you will make this
  1005. 40:46change more?
  1006. 40:52>> Okay. So you're saying that um if you
  1007. 40:56have a simpler problem then you will uh
  1008. 40:59sample more from um
  1009. 41:02>> simple problems.
  1010. 41:03>> Okay. So you in alpha code 2 basically
  1011. 41:07you will use the model that's trained on
  1012. 41:09perhaps simpler problems. Is that the
  1013. 41:10suggestion? Okay.
  1014. 41:13>> Um other ideas
  1015. 41:19the sol did improve with model size
  1016. 41:22that's
  1017. 41:30or if you if you can identify simpler
  1018. 41:33problem maybe we can you can you can run
  1019. 41:35with less samples.
  1020. 41:37>> Yes. Exactly. Right. Oberve the model.
  1021. 41:42So this is something that was probably
  1022. 41:43seen in the repetitive sampling and the
  1023. 41:45test time compute as well as to like if
  1024. 41:46you have simpler problems then it's
  1025. 41:48likely that you can get coverage with
  1026. 41:50fewer number of samples. So you don't
  1027. 41:52have to go to 1 million samples every
  1028. 41:54single time. It's almost like saying the
  1029. 41:56model does is more likely to generate
  1030. 41:59the solution in the search space of what
  1031. 42:00it outputs.
  1032. 42:03So it should be easier to like sample
  1033. 42:06uh or or it's initial set of solutions
  1034. 42:10with some iteration with some iterative
  1035. 42:13refinement should be easier to correct
  1036. 42:15as opposed to like having to generate a
  1037. 42:17lot of different solutions. One of the
  1038. 42:19gains that you get if you generate a a
  1039. 42:21lot of parallel solutions is that you're
  1040. 42:24trying to get the model to provide
  1041. 42:26diversity in the approaches and you're
  1042. 42:29not trying to get it to like fix what it
  1043. 42:31already output.
  1044. 42:35What about the question four? How can we
  1045. 42:37embed reasoning directly into the model?
  1046. 42:44>> Okay, let's try out.
  1047. 42:45>> I think one way is that maybe you can do
  1048. 42:47more on the train set like in the train
  1049. 42:49set you can take all take all the
  1050. 42:52comment of you enough problems. So you
  1051. 42:55know in the step one like how it feels
  1052. 42:58like the framework of the solution like
  1053. 43:00in step one we know is a program the
  1054. 43:03problem so we
  1055. 43:06step okay slightly different than the
  1056. 43:08standard program so we need to change a
  1057. 43:12little bit so we have the final solution
  1058. 43:15the final solution
  1059. 43:16>> okay
  1060. 43:17>> so if we don't have enough common data
  1061. 43:19then we use llm to kind of pass the code
  1062. 43:23like to See the first section is about
  1063. 43:26what is the second section
  1064. 43:28for so it's the training they have is so
  1065. 43:31that part of the training but they have
  1066. 43:33is only the three like the second one
  1067. 43:35that
  1068. 43:37repeat
  1069. 43:39that's basically
  1070. 43:41>> okay uh so what he's roughly saying is
  1071. 43:43that you add hints in your training data
  1072. 43:46set around the solution of like what
  1073. 43:48kind of algorithm is being used to solve
  1074. 43:49the problem what's a more generic
  1075. 43:51version of that what have we covered in
  1076. 43:54that line of work.
  1077. 43:59As programmers, you think before you
  1078. 44:02write the answer. What if that thinking
  1079. 44:04could be captured?
  1080. 44:08If you added those chain of thought as
  1081. 44:10part of your training set or if you
  1082. 44:13remember the star approach where you're
  1083. 44:15getting the model to generate the
  1084. 44:17solution and then like give the hint as
  1085. 44:19the answer and then ask it to come up
  1086. 44:21with that reasoning then that that can
  1087. 44:23also be part of like how the model
  1088. 44:25embeds it. Right.
  1089. 44:31Any other ideas?
  1090. 44:35I think the other interesting thing that
  1091. 44:37was mentioned which is probably worth
  1092. 44:39highlighting is that if you have a more
  1093. 44:41complex problem then you might want to
  1094. 44:43decompose the problem into subp parts
  1095. 44:46and add hints for subp parts as opposed
  1096. 44:49to trying to solve the problem in one go
  1097. 44:52because these are hard problems.
  1098. 44:57>> Yes.
  1099. 44:58you tackle that for products that are
  1100. 45:00not like that sequential like maybe you
  1101. 45:02get like a you succeed on the first
  1102. 45:04intermediate output
  1103. 45:07>> has something flawed that is never going
  1104. 45:08to make the second part work.
  1105. 45:10>> So how does that sequential or like how
  1106. 45:13do you compose that work?
  1107. 45:15So I think the I think all of these are
  1108. 45:18hinting at like we do need to close the
  1109. 45:20loop at some point in a multi-step
  1110. 45:22fashion and almost want like a tree
  1111. 45:24search style of solution where you
  1112. 45:26basically want did I
  1113. 45:29I basically sample for say the first
  1114. 45:31step and is that roughly correct and you
  1115. 45:33want to sample for the second step and
  1116. 45:34then you want to be able to backtrack.
  1117. 45:36So it's roughly heading in that
  1118. 45:38direction but it's kind of um
  1119. 45:42early work that gives you hints. So it
  1120. 45:44it's basically gotten your thinking and
  1121. 45:46then perhaps that's your project right
  1122. 45:48but but your question is very relevant
  1123. 45:50as to like what happens if your answer
  1124. 45:54is correct in the first step but then
  1125. 45:55the next step is not correct
  1126. 45:59and um the task decomposition is often
  1127. 46:02relevant in that most problems have a
  1128. 46:05certain way of solving. So if there's
  1129. 46:07common abstracted patterns then that's
  1130. 46:08doable. But if you do expect patterns
  1131. 46:10that are out of distribution then maybe
  1132. 46:14uh you do need human in the loop
  1133. 46:18that's like AI scientist style of work
  1134. 46:20that folks covered last lecture.
  1135. 46:31Okay.
  1136. 46:32Okay. Let's come to the last part. Uh so
  1137. 46:35we spent a lot of time on just um code
  1138. 46:38uh and how to how to select uh set of
  1139. 46:42code samples that you can um that can
  1140. 46:45pass and and and um solve competitive
  1141. 46:48coding problems. Now let's look at how
  1142. 46:51would you do something like building a
  1143. 46:53deep research agent. Uh so search is
  1144. 46:56basically going to use large reasoning
  1145. 46:58models as the base and then try to build
  1146. 47:01uh deep research agents on top of that.
  1147. 47:03And um it's worth paying attention
  1148. 47:05because you will use this in homework 3.
  1149. 47:08So the key idea here is that you want to
  1150. 47:11use large reasoning models to retrieve
  1151. 47:13based on a query that you want to give
  1152. 47:15the model. So large reasoning models uh
  1153. 47:19have impressive reasoning but as you
  1154. 47:21know that most of these models are
  1155. 47:22trained on with some knowledge cut off
  1156. 47:24dates. So they typically will not have
  1157. 47:27the freshest knowledge. If something
  1158. 47:28happened yesterday, the model will need
  1159. 47:31to go look up that data. it's not going
  1160. 47:32to be there in the model.
  1161. 47:36The other challenge when you work with
  1162. 47:38reasoning models per se uh is that uh
  1163. 47:41they will go and output a lot of tokens
  1164. 47:43in long form reasoning but when they
  1165. 47:44have knowledge gaps they will be um
  1166. 47:47using terms that are um expressing
  1167. 47:50uncertainty. So one example is that if
  1168. 47:52you go use G u benchmark on GPQA data
  1169. 47:56set you will see uh the term perhaps in
  1170. 47:59the reasoning chains a lot or you will
  1171. 48:01see the term alternatively or wait or
  1172. 48:06so they're basically expressing that the
  1173. 48:08knowledge gaps will show up as
  1174. 48:10uncertaintity in the way the model is
  1175. 48:12thinking. So you want to bootstrap that
  1176. 48:15u in some way because otherwise those
  1177. 48:17knowledge gaps will continue to
  1178. 48:18propagate through the entire reasoning
  1179. 48:20chain.
  1180. 48:21Now one simple solution based on
  1181. 48:23learning from feedback or learning from
  1182. 48:25tool calls is that why don't we just
  1183. 48:27like take this query and get a relevant
  1184. 48:31document. Um so you take this query pass
  1185. 48:34it to a search tool and get the relevant
  1186. 48:36document. Um and then put that document
  1187. 48:38in the prompt and then out get the model
  1188. 48:41to output based on that. Why is that not
  1189. 48:43enough? So that would be more like
  1190. 48:45retrieval augmented generation. So
  1191. 48:48whatever is your question, you generate
  1192. 48:51a query and you get a document and you
  1193. 48:53put it in the prompt and then that's
  1194. 48:55what you use to uh retrieve the answer.
  1195. 48:58Now the challenge with uh that sort of
  1196. 49:00simple approach is that you retrieve
  1197. 49:03once at the beginning. So you don't have
  1198. 49:05the ability to like tweak things and
  1199. 49:07it's possible that if your search
  1200. 49:09problem is complex enough then each
  1201. 49:12reasoning step will need different piece
  1202. 49:14of information. So if you have a problem
  1203. 49:17which is asking just the weather then
  1204. 49:19maybe a single search call is enough.
  1205. 49:21But if you're asking to solve a complex
  1206. 49:23problem which has multiple parts uh to
  1207. 49:25solving it then after it gets through a
  1208. 49:27certain amount of reasoning it needs to
  1209. 49:29go look up additional information. So
  1210. 49:31for complex reasoning it's extremely
  1211. 49:33hard to get it right and same for
  1212. 49:34multi-step reasoning. So typically uh
  1213. 49:37retrieval augmented generation will uh
  1214. 49:40will improve uh will show improvement
  1215. 49:42over direct reasoning but in multi-step
  1216. 49:44reasoning it definitely suffers.
  1217. 49:46So the solution that search and proposes
  1218. 49:49is that the model generates the queries
  1219. 49:53um on the go. Uh so whenever it sees
  1220. 49:56these knowledge gaps it will trigger a
  1221. 49:58query. It will generate a search query
  1222. 50:00of uh what what tool calls to uh
  1223. 50:04generate and go search things over and
  1224. 50:07there will be multiple iterations in a
  1225. 50:09single reasoning session of like
  1226. 50:11fetching these documents. And the second
  1227. 50:13thing it will do differently and I will
  1228. 50:15show examples of that is that it will
  1229. 50:17analyze the retrieved documents. So
  1230. 50:19instead of just dumping what it
  1231. 50:21retrieved as the document, it will
  1232. 50:23analyze the retrieved document and
  1233. 50:24extract relevant chunks of information
  1234. 50:26from there.
  1235. 50:28and um it will only put these relevant
  1236. 50:32information into the prompt so that it
  1237. 50:35integrates well into the reasoning
  1238. 50:38chain.
  1239. 50:40So uh just to reiterate how this works.
  1240. 50:44So this is an original question which is
  1241. 50:46a chemistry question which is talking
  1242. 50:47about uh it wants to get the carbon
  1243. 50:50atoms count of product three which is
  1244. 50:53output of a bunch of different chemical
  1245. 50:55reactions. So if you were to use a large
  1246. 50:58reasoning model um you will ask the
  1247. 51:00model to start thinking it looks at this
  1248. 51:02term which I don't understand and
  1249. 51:04perhaps the model doesn't understand. So
  1250. 51:06it will go ask a look up what does it
  1251. 51:09mean? Now one trick is that it doesn't
  1252. 51:12go look up. So it makes a guess and
  1253. 51:14comes up with whatever is in its
  1254. 51:15knowledge base in the store weights and
  1255. 51:18provides a final answer based on what it
  1256. 51:20guessed. But if there is a guess here
  1257. 51:23and it got the answer wrong then those
  1258. 51:25things will cascade as errors into
  1259. 51:27whatever is the final answer. So all the
  1260. 51:29perhaps or all the uncertainty will
  1261. 51:31basically cascade into the final answer.
  1262. 51:33So your certainty for the final answer
  1263. 51:34is low.
  1264. 51:37Now one possibility is that you
  1265. 51:38basically whenever you encounter
  1266. 51:40unfamiliar knowledge you can now do web
  1267. 51:42searches. So that would be a simple uh
  1268. 51:44scenario of like okay unfamiliar term
  1269. 51:47basically go and do a tool call for
  1270. 51:49search return the document uh that
  1271. 51:52basically has that search tool for
  1272. 51:55perhaps there's a Wikipedia page or
  1273. 51:56there's a web page that has that
  1274. 51:58information and put that in the
  1275. 52:00reasoning chain and now like do the put
  1276. 52:03that in the prompt and then do the call
  1277. 52:04again and then provide the final answer
  1278. 52:07based on that. The only challenge with
  1279. 52:09this is that as you basically increase
  1280. 52:12your uh amount of content you're putting
  1281. 52:14there, there might be not as much
  1282. 52:16relevant content and these documents
  1283. 52:18like if you went and fetched like 10
  1284. 52:21documents that were related to the
  1285. 52:22information. Uh there's too much
  1286. 52:24information for the model to process. So
  1287. 52:26it might actually not still give the
  1288. 52:28correct answer. So in this particular
  1289. 52:29case, it was like 10 carbon atoms and
  1290. 52:32product three. Here's like 14 carbon
  1291. 52:34atoms. I still got it wrong.
  1292. 52:38What search oven is proposing is that
  1293. 52:40now you have uh whenever you get the
  1294. 52:42unfamiliar knowledge it will uh go and
  1295. 52:46search for helpful information. So
  1296. 52:47that's still a tool call to your search
  1297. 52:50but then um it will reason within the
  1298. 52:53documents. So it will try to look at
  1299. 52:55these documents and see if this is
  1300. 52:57helpful information or not. extract the
  1301. 52:59relevant content and then put it back in
  1302. 53:02the reason um in the next prompt like
  1303. 53:04what is the relevant chunk of
  1304. 53:05information to put and that will allow
  1305. 53:08the model to continue coherent reasoning
  1306. 53:10and provide the final answer here. So in
  1307. 53:12this particular case basically the the
  1308. 53:14ability to do this summarization of
  1309. 53:17information or reason within the
  1310. 53:18document uh really improves the quality
  1311. 53:21of like how it gets to the final answer
  1312. 53:23instead of like clustering the [snorts]
  1313. 53:24prompt with like 10 documents or 20
  1314. 53:27documents.
  1315. 53:29Um questions on uh what's the difference
  1316. 53:31between the three approaches?
  1317. 53:37>> Yes. Why does it say in the first one it
  1318. 53:40says oh perhaps gas why this little one
  1319. 53:44doesn't say anything because it's being
  1320. 53:47given the information right so the
  1321. 53:48uncertainity has reduced it is actually
  1322. 53:51being it's not even saying that in the
  1323. 53:53middle one which because it's being
  1324. 53:55given the right information in the
  1325. 53:56prompt
  1326. 53:59I think the harder part is how does it
  1327. 54:01know what to search for
  1328. 54:05it needs to know which keywords it does
  1329. 54:07not No,
  1330. 54:12like that that's the question I would
  1331. 54:13ask.
  1332. 54:15>> Yeah, it's a miser.
  1333. 54:17>> The answer is I think you basically need
  1334. 54:19to uh break down what are the key. So
  1335. 54:22there is different ways to tackle that
  1336. 54:24question, right? um if you're building a
  1337. 54:27real application, you want to identify
  1338. 54:29which parts um
  1339. 54:32you don't want to rely on the knowledge
  1340. 54:33base of the LM and you actually do want
  1341. 54:35to do a tool call because that
  1342. 54:37information is likely not what you want
  1343. 54:39to trust the weights of the LM for.
  1344. 54:43It's almost like you're finding the key
  1345. 54:45entities in your um question and
  1346. 54:49fetching information on those.
  1347. 54:59Okay. So there were two things that we
  1348. 55:02are covering here. So one is the agentic
  1349. 55:03rag and one is search. So I'll cover
  1350. 55:06both uh here. Uh let's first understand
  1351. 55:08agentic rack because then we build on
  1352. 55:10top of that in the the search forward
  1353. 55:12process. In agentic rack what you're
  1354. 55:14doing is you're basically every time you
  1355. 55:17are hitting um entities that uh you care
  1356. 55:20about you're basically going to insert
  1357. 55:23special tokens where you are going to
  1358. 55:24trigger a search and then when you get
  1359. 55:26that document you're going to insert
  1360. 55:28those results. So uh model is generating
  1361. 55:31some output tokens. when it's seeing
  1362. 55:33certain amount of uncertainty in its
  1363. 55:35output tokens, it's generating these
  1364. 55:36search queries between the special
  1365. 55:38tokens and based on that it goes and
  1366. 55:40does the tool call and the uh retrieval
  1367. 55:43tool will essentially return those
  1368. 55:45documents which will then be inserted
  1369. 55:46into the reasoning chain. So this is
  1370. 55:48happening in large reasoning models as
  1371. 55:50part of the whole reasoning process of
  1372. 55:52like it's also calling tools as part of
  1373. 55:54the reasoning process. Um so
  1374. 55:58that's one way to solve it. Um, but the
  1375. 56:02documents can be lengthy and they can
  1376. 56:04contain noise and oftentimes depending
  1377. 56:06on how good the long context
  1378. 56:08understanding and reasoning of the model
  1379. 56:09is, they might actually like if you put
  1380. 56:1110 or 20 documents, it might actually
  1381. 56:13not be able to do a good job at
  1382. 56:15reasoning over them. So uh the reason in
  1383. 56:18documents module of search 01 will allow
  1384. 56:20you to do analysis of each of the
  1385. 56:22documents of like how relevant the
  1386. 56:24content is and then it considers the
  1387. 56:26current query what it was reasoning
  1388. 56:29previously plus like this chunk of
  1389. 56:31information that it extracted and um
  1390. 56:34appends that to the prompt to allow the
  1391. 56:37model to continue reasoning based on
  1392. 56:38that. So it's essentially a multi-step
  1393. 56:41process within that retrieval tool
  1394. 56:44function itself because it's basically
  1395. 56:46getting that document information but
  1396. 56:47then also doing an extraction process on
  1397. 56:49top of that. It's it's almost like as
  1398. 56:52humans you don't want to just like go
  1399. 56:53and curate all the possible references.
  1400. 56:56You also want to take notes on those
  1401. 56:57references so that you have some way of
  1402. 56:59like um doing a better job understanding
  1403. 57:02and synthesizing that information. And
  1404. 57:04this allows the model to do um better
  1405. 57:07job at reasoning when we are adding
  1406. 57:09external knowledge and especially for
  1407. 57:11complex queries this becomes quite
  1408. 57:13important. Yes.
  1409. 57:15>> How does it previous reasoning and if
  1410. 57:18there's any corrections needed for the
  1411. 57:20previous reasoning how does it handle
  1412. 57:22corrections? So there is an assumption
  1413. 57:25that there is a state or there's a
  1414. 57:27memory buffer that's keeping that
  1415. 57:31uh it's not obvious in the way this is
  1416. 57:33structured but there's a basically some
  1417. 57:34form of like notion of like this is the
  1418. 57:37search query I'm trying to answer this
  1419. 57:39is and some buffer of like where is the
  1420. 57:42previous reasoning and so on.
  1421. 57:44>> Yeah.
  1422. 57:46Yes,
  1423. 57:48>> just add new in the engine direct module
  1424. 57:53on top of that you just like ask the
  1425. 57:55model to do some summation and then
  1426. 57:58continue reasoning. So does that like um
  1427. 58:02directly um transfer to the second style
  1428. 58:07like u
  1429. 58:09I mean like does this directly mix
  1430. 58:13method to be the be the new method
  1431. 58:15proposing
  1432. 58:17>> say that again you can just pick up
  1433. 58:21>> um I mean like if you just like modify
  1434. 58:23the prompt in the agent take module like
  1435. 58:27you ask the model to do some summation
  1436. 58:29and then and then continue the reasoning
  1437. 58:32does that produce the same um results of
  1438. 58:36wasting results.
  1439. 58:38>> So I think that's a great question and I
  1440. 58:40would encourage you folks to actually
  1441. 58:41try that out in homework three. I think
  1442. 58:43the assumption there is that if you were
  1443. 58:45to issue that prompt um you are assuming
  1444. 58:49that the the context length of the model
  1445. 58:51and the reasoning over that context
  1446. 58:53length is working really well. This is
  1447. 58:56basically agentic context engineering
  1448. 58:58style paper. So it's basically there's a
  1449. 59:00recent paper called agentic context
  1450. 59:02engineering. So essentially the
  1451. 59:04limitation here is coming from what can
  1452. 59:06you put in context length that the model
  1453. 59:08is going to do a really good job at.
  1454. 59:13In ideal world we will want that.
  1455. 59:16That's that's where we want to shoot and
  1456. 59:18hopefully by the end of the year that's
  1457. 59:19where we will be.
  1458. 59:22Okay. So let's to look at uh let's look
  1459. 59:24at the examples. So we were covering
  1460. 59:26this example of like carbon atom count
  1461. 59:28in product three based on a bunch of
  1462. 59:29different chemical reactions. In vanilla
  1463. 59:32reasoning the challenge was that it was
  1464. 59:34guessing the structure. So it definitely
  1465. 59:36got wrong answer in agentic rag because
  1466. 59:38you were um just retrieving the
  1467. 59:40documents they ended up being too
  1468. 59:41lengthy. So it did disrupt the
  1469. 59:43reasoning. uh in search process it did
  1470. 59:47uh search for this particular um formula
  1471. 59:50and then it refined it to a certain
  1472. 59:52structure and then that integrated
  1473. 59:54cleanly into reasoning. So essentially
  1474. 59:56the notion of like um extracting the
  1475. 59:59right information from the documents
  1476. 1:00:00really helps um search over and get to
  1477. 1:00:03the correct answer in this particular
  1478. 1:00:04case.
  1479. 1:00:07Now if you were to like go beyond the
  1480. 1:00:08example to results what we're plotting
  1481. 1:00:10is different domains physics chemistry
  1482. 1:00:12biology and overall um and you're
  1483. 1:00:15plotting pass at one on um
  1484. 1:00:19y-axis and then you're plotting the
  1485. 1:00:22number of documents that you get on
  1486. 1:00:24x-axis. So typically as you increase the
  1487. 1:00:26number of documents um for direct
  1488. 1:00:30reasoning and for rag the accuracy does
  1489. 1:00:32not go up but in this particular case as
  1490. 1:00:35you increase the number of documents you
  1491. 1:00:36are actually able to do better because
  1492. 1:00:38you can u summarize what is relevant
  1493. 1:00:41information or not in this particular
  1494. 1:00:42case assuming that the documents more
  1495. 1:00:44fetching more documents gives you more
  1496. 1:00:46relevant information related to the the
  1497. 1:00:48problem that you're solving.
  1498. 1:00:51So this is basically another axis of
  1499. 1:00:54like instead of doing iterative
  1500. 1:00:55refinement you can do parallel
  1501. 1:00:56refinement because you can basically go
  1502. 1:00:58fetch more information and then chunk it
  1503. 1:01:00down to put it in the model context.
  1504. 1:01:05Now if you were to um compare the
  1505. 1:01:08performance of um on GPQA data set um so
  1506. 1:01:14if you just compared GPQA data set in
  1507. 1:01:17physics chemistry and biology I was
  1508. 1:01:18showing you a plot in the last uh slide
  1509. 1:01:21human experts in physics chemistry and
  1510. 1:01:23biology on GPQA would score this much.
  1511. 1:01:26If you look at the reasoning models and
  1512. 1:01:27you build search oven on top of them,
  1513. 1:01:30what you notice is that um for example
  1514. 1:01:33in physics and chemistry um
  1515. 1:01:37search oven actually is quite
  1516. 1:01:39competitive sometimes even better than
  1517. 1:01:41what human experts would do. These are
  1518. 1:01:42hard problems by the way. So um and uh
  1519. 1:01:46in biology it's uh almost competitive to
  1520. 1:01:49uh say the biologist solving the
  1521. 1:01:51problem. uh one comment I want to make
  1522. 1:01:53is that you want to focus on physics
  1523. 1:01:55physicists solving physics problems. So
  1524. 1:01:57you want to focus on the diagonal here.
  1525. 1:01:59It's uh maybe not obvious like if you
  1526. 1:02:01change the domain then that's the number
  1527. 1:02:04you're comparing to. So the search oven
  1528. 1:02:07is doing pretty well in physics here and
  1529. 1:02:10in uh biology here and uh in chemistry
  1530. 1:02:13not so much
  1531. 1:02:22physicists.
  1532. 1:02:24So what's the level of this physicist?
  1533. 1:02:28>> Uh maybe they didn't do a good job
  1534. 1:02:30sourcing the physicists.
  1535. 1:02:33I think you're definitely getting to a
  1536. 1:02:35point where the models are able to do
  1537. 1:02:37well in certain domains more than the
  1538. 1:02:40[snorts] but uh this is not to say that
  1539. 1:02:42you're outperforming human experts. It's
  1540. 1:02:44more to say that you're competitive with
  1541. 1:02:46the human experts for this class of
  1542. 1:02:48problems. Yeah.
  1543. 1:02:51>> So there's still a lot of headroom in
  1544. 1:02:53chemistry.
  1545. 1:02:55[laughter]
  1546. 1:02:56>> Yes.
  1547. 1:02:57>> I have a question for the chemistry.
  1548. 1:02:59>> Yeah. you seen about even how this
  1549. 1:03:00chemistry like the you show the
  1550. 1:03:03chemistry formula can be more
  1551. 1:03:06>> I'm just wondering whether it it perform
  1552. 1:03:08worse in the chemistry just becomes the
  1553. 1:03:10chemistry part how to tokenize it can be
  1554. 1:03:14complicated you want to preserve the
  1555. 1:03:16meaning of sub combination but you but
  1556. 1:03:19if you just change one thing
  1557. 1:03:22>> the total chemistry like the behavior
  1558. 1:03:26may change dramatically so
  1559. 1:03:28>> I'm just wondering Whether just because
  1560. 1:03:30how do you better preserve like part of
  1561. 1:03:32the
  1562. 1:03:34like how to cocon?
  1563. 1:03:38It might be. I will let you actually go
  1564. 1:03:41try to evaluate on GPQA and see if the
  1565. 1:03:43chemistry segment if that hypothesis
  1566. 1:03:46applies. It is possible.
  1567. 1:03:51[clears throat]
  1568. 1:03:51I mean in every subject when you go and
  1569. 1:03:53prom these models the level of expertise
  1570. 1:03:55kind of varies for different reasons,
  1571. 1:03:57right? It's also possible the train data
  1572. 1:03:59set was not that strong.
  1573. 1:04:02So it's out of distribution.
  1574. 1:04:05And the other comment that I was uh
  1575. 1:04:07making earlier if you basically as you
  1576. 1:04:09increase the number of documents uh this
  1577. 1:04:12particular technique is able to leverage
  1578. 1:04:14the fact that as you increase the number
  1579. 1:04:15of documents you can uh improve the
  1580. 1:04:18performance just because you're not just
  1581. 1:04:21making the context longer. You're
  1582. 1:04:22actually um providing relevant context
  1583. 1:04:25from each of those documents.
  1584. 1:04:28Uh the other big thing that I want to
  1585. 1:04:30highlight is that in multihop question
  1586. 1:04:32answering this is particularly relevant
  1587. 1:04:34because in multihop question answering
  1588. 1:04:36you do tend to hit uh some amount of um
  1589. 1:04:40uh uh saturation in terms of performance
  1590. 1:04:43uh with standard rag. So and even with
  1591. 1:04:45agentic uh rag you do tend to hit some
  1592. 1:04:47amount of uh saturation. So in like
  1593. 1:04:49hotpot QA in two wiki music or bamboo
  1594. 1:04:53for example uh if you just did rag for
  1595. 1:04:55example you would not uh hit the
  1596. 1:04:58state-of-the-art numbers but with search
  1597. 1:05:0001 in um in a lot of these cases you are
  1598. 1:05:03hitting the the highest numbers the
  1599. 1:05:05bolded numbers um across that particular
  1600. 1:05:08line are coming from uh search1 as a
  1601. 1:05:11process so it is u providing a lot of
  1602. 1:05:14value even like in the multihop question
  1603. 1:05:16answering across multiple documents.
  1604. 1:05:18Yes,
  1605. 1:05:22>> what are the precision recall system?
  1606. 1:05:26>> That's a great question.
  1607. 1:05:31>> Like the retrieval itself is the
  1608. 1:05:32following, not the model,
  1609. 1:05:34>> right? So I think there's an assumption
  1610. 1:05:36here that you did at least for the way I
  1611. 1:05:39am explaining I mean it's possible that
  1612. 1:05:41you didn't retrieve the right documents
  1613. 1:05:43but if you look at the set of questions
  1614. 1:05:45I think the main claim that this paper
  1615. 1:05:46is making is that if you find multiple
  1616. 1:05:48relevant documents that are loosely
  1617. 1:05:50correlated to what you're quering about
  1618. 1:05:53even then like once you put all of those
  1619. 1:05:54documents in the context lump then
  1620. 1:05:56that's you're asking the model to do a
  1621. 1:05:59lot in terms of reasoning over that many
  1622. 1:06:01documents. So that's the claim that this
  1623. 1:06:02particular paper is making.
  1624. 1:06:09So in terms of like if you were to look
  1625. 1:06:11at the takeaways here um the gains are
  1626. 1:06:14definitely coming from the fact that
  1627. 1:06:16it's able to reduce the uncertainty and
  1628. 1:06:19um
  1629. 1:06:21the the document quality uh or like what
  1630. 1:06:23you basically refine knowledge both of
  1631. 1:06:25those improve and in the multi-turn
  1632. 1:06:27scenario um once you can figure out like
  1633. 1:06:31what you don't know um it's able to like
  1634. 1:06:34even after like refining across
  1635. 1:06:36documents it can do this iterative loop
  1636. 1:06:38of improving upon that so it can like
  1637. 1:06:40construct better searches over
  1638. 1:06:42multi-tonon scenarios. So in in this
  1639. 1:06:44particular case uh the reasoning quality
  1640. 1:06:47uh improves substantially because you're
  1641. 1:06:49providing more relevant documents and
  1642. 1:06:51then you're also figuring out where the
  1643. 1:06:53uncertainty is over multiple steps. So
  1644. 1:06:57effectively you have the right documents
  1645. 1:06:59and then you can correct yourself
  1646. 1:07:00because when you put the documents in
  1647. 1:07:02there if you're still seeing uncertainty
  1648. 1:07:04then you have additional searches to go
  1649. 1:07:06for. So there were some numbers that the
  1650. 1:07:09paper gives of like the number of
  1651. 1:07:10perhaps or or weight or likely basically
  1652. 1:07:14anything that quantifies uncertainty in
  1653. 1:07:16the reasoning chains goes down
  1654. 1:07:17substantially in this particular
  1655. 1:07:19approach. So they're basically analyzing
  1656. 1:07:21the reasoning chains of the model.
  1657. 1:07:24So um just to summarize what we covered
  1658. 1:07:28here is that
  1659. 1:07:30when we are building um deep research
  1660. 1:07:32sort of agents on top of uh say the
  1661. 1:07:35large reasoning models um that's a very
  1662. 1:07:37effective way to like uh bridge the
  1663. 1:07:39knowledge gaps that exist in large
  1664. 1:07:41language models. But just doing simple
  1665. 1:07:43uh retrieval augmented generation is
  1666. 1:07:45often not enough and even with um just
  1667. 1:07:48fetching the documents using tool calls
  1668. 1:07:50is not enough. you need to be able to do
  1669. 1:07:52that effectively over multiple turns and
  1670. 1:07:54then identify the relevant information
  1671. 1:07:57to refine which set of documents to
  1672. 1:07:59keep. So um the large reasoning models
  1673. 1:08:02by themselves often don't do a good job
  1674. 1:08:04in um scaling well if you put a lot of
  1675. 1:08:07documents in there. So this particular
  1676. 1:08:09approach allows you to improve on that
  1677. 1:08:12and uh larger models often do better.
  1678. 1:08:15And then um okay there's another paper
  1679. 1:08:18that I wanted to cover but like didn't
  1680. 1:08:20end up covering. So the search R1 stuff
  1681. 1:08:23um effectively varies from search 01 in
  1682. 1:08:26that it teaches the model how to go
  1683. 1:08:28search in an automatic way. So
  1684. 1:08:31uh what I wanted to say here was that
  1685. 1:08:33search R1 versus search O1. Search O1 is
  1686. 1:08:35closing the loop with a prompting based
  1687. 1:08:37approach. Search R1 can actually teach
  1688. 1:08:40the model to do this with an
  1689. 1:08:41reinforcement learning based loop.
  1690. 1:08:45We will not cover this paper um today
  1691. 1:08:48because we are basically at the end. But
  1692. 1:08:50it's worth going and taking a look at
  1693. 1:08:51that paper.
  1694. 1:08:55>> Um questions.
  1695. 1:08:58>> Yes,
  1696. 1:08:59>> I was just wondering considering the the
  1697. 1:09:02definition of a language model. So when
  1698. 1:09:04we generated an answer,
  1699. 1:09:07uh we supposed to have the ability to
  1700. 1:09:09put a probability of that answer, right?
  1701. 1:09:12>> Mhm. And I'm just wondering that when we
  1702. 1:09:14have this let's say 1,000
  1703. 1:09:18uh generations
  1704. 1:09:20>> each generation have a kind of different
  1705. 1:09:23probability or at least in some extent
  1706. 1:09:26and and has there been some correlation
  1707. 1:09:29between the right answers and the
  1708. 1:09:31probabilities or they are by by
  1709. 1:09:35definition they are absolutely
  1710. 1:09:36uncorrelated and and also same question
  1711. 1:09:40to to RA that when we have a have a rag
  1712. 1:09:45augmented
  1713. 1:09:47>> uh generation.
  1714. 1:09:48>> Mhm.
  1715. 1:09:49>> I I I can imagine that you know some of
  1716. 1:09:51the maybe it messes up some of the
  1717. 1:09:53definitions but is there any difference
  1718. 1:09:55in the in the uh in the in the
  1719. 1:09:59probability of the answer.
  1720. 1:10:01>> I mean that's a great experiment to go
  1721. 1:10:03do right. So let me answer the first
  1722. 1:10:05question and the second question you
  1723. 1:10:06will have to go experiment yourself. Uh
  1724. 1:10:09so in the first question typically so
  1725. 1:10:12there's a lot of studies but if you were
  1726. 1:10:14to just like take the output generation
  1727. 1:10:16and compute the log probabilities of the
  1728. 1:10:18output tokens and aggregate them in some
  1729. 1:10:21uh meaningful way like not just sum them
  1730. 1:10:23you'll have to do some averaging or some
  1731. 1:10:24geometric product or something. What
  1732. 1:10:26you'll find is that um the models tend
  1733. 1:10:29to be overconfident
  1734. 1:10:31about what they like overconfident. So
  1735. 1:10:34if you were to calibrate that to the
  1736. 1:10:35right answer, often you find that the um
  1737. 1:10:39the correctness is um like if it's 50%
  1738. 1:10:43correct, it will still be overconfident.
  1739. 1:10:44It will be like 80% very confident that
  1740. 1:10:46this is correct. And this kind of shows
  1741. 1:10:48up in the ways in which um if you try to
  1742. 1:10:51correct the model outputs, it will
  1743. 1:10:52sometimes be pretty [snorts] strong and
  1744. 1:10:54like no this is the right answer and
  1745. 1:10:56will not change its mind. Right? So in
  1746. 1:10:59some ways uh the model outputs do tend
  1747. 1:11:02have exhibited uh not high calibration
  1748. 1:11:06and like more are more on the
  1749. 1:11:08overconfident side. And there have been
  1750. 1:11:10research to try to get the model to
  1751. 1:11:12estimate the confidence say in a second
  1752. 1:11:14pass or or in a and try to like do RL or
  1753. 1:11:20like RLHF on top of that to get the
  1754. 1:11:22model to calibrate and and do things so
  1755. 1:11:24that it doesn't actually uh emit answers
  1756. 1:11:27that it has low confidence over. Right?
  1757. 1:11:30So there has definitely been efforts in
  1758. 1:11:31that direction. U different models
  1759. 1:11:34exhibit different behaviors. We don't
  1760. 1:11:35know which lab did what. Um so we just
  1761. 1:11:39get these notions of like oh the model
  1762. 1:11:41is hallucinated and
  1763. 1:11:43>> there is no correlation between the
  1764. 1:11:45actual right answer out from the 1,00
  1765. 1:11:48and the and
  1766. 1:11:49>> I think there is a correlation in that
  1767. 1:11:51uh if the answer is uh correct then the
  1768. 1:11:54model will likely get it correct but if
  1769. 1:11:56the answer is incorrect the model might
  1770. 1:11:58be overconfident in feeling that it
  1771. 1:12:00knows the answer that that's been the
  1772. 1:12:03the observed pattern but I think this is
  1773. 1:12:05what like this is worth studying this
  1774. 1:12:07there's The hallucinations in just the
  1775. 1:12:09ability of the model to know what they
  1776. 1:12:11know is an active area of research
  1777. 1:12:16and it's actually a a great set of uh
  1778. 1:12:18research projects if someone wants to
  1779. 1:12:20pursue it.

About this transcript

This page contains the full transcript of YouTube transcript (Uni9dqyuuDM) , generated from the public captions YouTube serves with the video. The transcript has 11,925 words across 1,779 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.