1
00:00:00,589 --> 00:00:02,526
Here's a model's config file.

2
00:00:02,526 --> 00:00:05,041
Thirty-odd lines of the usual stuff.

3
00:00:05,041 --> 00:00:08,505
Twenty-two layers. Forty-eight attention heads.

4
00:00:08,505 --> 00:00:11,370
And then this one. num_loops: 2

5
00:00:12,193 --> 00:00:15,319
It means that when a token reaches the top of the network,

6
00:00:15,319 --> 00:00:18,130
it goes back to the bottom, and runs through the whole

7
00:00:18,130 --> 00:00:20,262
thing again. Same weights.

8
00:00:20,262 --> 00:00:22,580
Not one new parameter.

9
00:00:22,580 --> 00:00:25,808
This model has three billion core parameters.

10
00:00:25,808 --> 00:00:29,186
Give it real bugs from real GitHub repositories,

11
00:00:29,186 --> 00:00:31,700
and it scores 63.6.

12
00:00:31,700 --> 00:00:34,580
A rival with more than three times the parameters scores

13
00:00:34,580 --> 00:00:35,730
44.2.

14
00:00:36,070 --> 00:00:39,510
Those are its makers' numbers, and one line of config

15
00:00:39,510 --> 00:00:40,848
didn't do all of that.

16
00:00:40,848 --> 00:00:42,723
We'll take that claim apart.

17
00:00:42,723 --> 00:00:45,905
But that line opens a door to a stranger idea:

18
00:00:45,905 --> 00:00:49,222
that how big a model is, and how much it thinks,

19
00:00:49,222 --> 00:00:50,980
are two different things.

20
00:00:51,886 --> 00:00:55,280
You'll see why re-reading a book beats reading each page

21
00:00:55,280 --> 00:00:59,360
three times. Why a model spends three rounds of thought on

22
00:00:59,360 --> 00:01:01,837
some words, and one on others.

23
00:01:01,837 --> 00:01:05,040
How teaching a model to stop rambling in ordinary chat

24
00:01:05,040 --> 00:01:07,118
raised its coding scores.

25
00:01:07,118 --> 00:01:10,240
And why a small agent's final training went better on

26
00:01:10,240 --> 00:01:11,790
easier problems.

27
00:01:12,071 --> 00:01:15,490
It all comes from two papers, a year apart.

28
00:01:15,490 --> 00:01:18,690
Mixture-of-Recursions asked how far the loop could go.

29
00:01:18,690 --> 00:01:21,673
Nanbeige 4.2 shipped one.

30
00:01:21,673 --> 00:01:25,087
Every chart is rebuilt from their tables and figures,

31
00:01:25,087 --> 00:01:27,760
and where these ideas lose, you'll see it.

32
00:01:31,720 --> 00:01:35,240
A language model turns each token into a long list of

33
00:01:35,240 --> 00:01:38,759
numbers, and pushes it up a tower of layers.

34
00:01:38,759 --> 00:01:41,074
In each layer, two things happen.

35
00:01:41,074 --> 00:01:44,920
Attention: the token looks back at everything before it.

36
00:01:44,920 --> 00:01:46,679
Then the feed-forward step:

37
00:01:46,679 --> 00:01:48,668
it works on what it saw.

38
00:01:48,668 --> 00:01:51,878
At the top, out comes a guess at the next token.

39
00:01:51,878 --> 00:01:55,321
More layers, more chances to refine that guess.

40
00:01:55,321 --> 00:01:57,990
And every layer has its own weights.

41
00:01:58,674 --> 00:02:02,010
Scaling that tower is what unlocked modern language

42
00:02:02,010 --> 00:02:05,363
models. But it runs up three separate bills.

43
00:02:05,363 --> 00:02:07,849
Parameters: what you have to store.

44
00:02:07,849 --> 00:02:11,770
Compute: the operations you run, counted in flops.

45
00:02:11,770 --> 00:02:13,049
And memory traffic:

46
00:02:13,049 --> 00:02:15,849
the data you haul around while the model talks.

47
00:02:15,849 --> 00:02:19,290
Outside a giant data center, those bills are the whole

48
00:02:19,290 --> 00:02:20,459
problem.

49
00:02:20,459 --> 00:02:22,778
Researchers attack them two ways:

50
00:02:22,778 --> 00:02:25,820
share the weights, or spend compute only where it's

51
00:02:25,820 --> 00:02:28,772
needed. But in a normal transformer,

52
00:02:28,772 --> 00:02:30,754
the bills are welded together.

53
00:02:30,754 --> 00:02:32,970
Add a layer, pay all three.

54
00:02:33,310 --> 00:02:35,361
Are they really one thing?

55
00:02:35,361 --> 00:02:37,149
Think about a computer program.

56
00:02:37,149 --> 00:02:39,064
File size is one number.

57
00:02:39,064 --> 00:02:40,749
Run time is another.

58
00:02:40,749 --> 00:02:44,109
A ten-line program with a loop can run for a week.

59
00:02:44,109 --> 00:02:47,141
A stack of layers is a program with no loops in it,

60
00:02:47,141 --> 00:02:49,068
every step spelled out.

61
00:02:49,068 --> 00:02:51,260
So what happens if you add one?

62
00:02:55,319 --> 00:02:57,127
Here's a nine-layer tower.

63
00:02:57,127 --> 00:02:58,600
Nine sets of weights.

64
00:02:58,600 --> 00:03:01,802
Make layers four to six copies of one to three,

65
00:03:01,802 --> 00:03:04,120
and seven to nine copies too.

66
00:03:04,120 --> 00:03:06,360
Now there are three sets of weights,

67
00:03:06,360 --> 00:03:09,110
used three times. So you can fold it.

68
00:03:09,453 --> 00:03:12,090
The token still climbs nine floors.

69
00:03:12,090 --> 00:03:13,769
Compute: unchanged.

70
00:03:13,769 --> 00:03:16,090
Storage: down to a third.

71
00:03:16,090 --> 00:03:19,880
That's a looped transformer, also called a recursive one.

72
00:03:20,606 --> 00:03:24,940
It's an old idea. In 2018, the Universal Transformer

73
00:03:24,940 --> 00:03:28,220
showed that repeating one block could match the power of a

74
00:03:28,220 --> 00:03:30,860
deep stack of distinct ones.

75
00:03:30,860 --> 00:03:34,060
Later work showed looped transformers can act as

76
00:03:34,060 --> 00:03:37,820
programmable computers, learn iterative algorithms,

77
00:03:37,820 --> 00:03:41,740
generalize to much longer inputs, and mimic multi-step

78
00:03:41,740 --> 00:03:44,777
optimizers. Which makes a kind of sense.

79
00:03:44,777 --> 00:03:47,271
A lot of good algorithms are one step,

80
00:03:47,271 --> 00:03:48,330
repeated.

81
00:03:48,934 --> 00:03:51,197
Here's the cleanest test I can show you.

82
00:03:51,197 --> 00:03:54,510
Lock a model at 118 million parameters,

83
00:03:54,510 --> 00:03:57,230
and train it on ten billion tokens.

84
00:03:57,230 --> 00:04:00,750
Validation loss measures how surprised it is by text it

85
00:04:00,750 --> 00:04:02,920
hasn't seen. One pass:

86
00:04:02,920 --> 00:04:06,990
2.97. Up to two: 2.92.

87
00:04:06,990 --> 00:04:11,467
Up to three: 2.91. Accuracy creeps up too.

88
00:04:11,467 --> 00:04:13,580
And not one new parameter.

89
00:04:14,306 --> 00:04:18,240
There's a catch. Take plain loops, every token going round

90
00:04:18,240 --> 00:04:21,520
every time, and compare them with the full-size model

91
00:04:21,520 --> 00:04:24,319
whose depth you copied, at equal compute.

92
00:04:24,319 --> 00:04:27,440
Two loops, three loops, four loops:

93
00:04:27,440 --> 00:04:31,200
fewer parameters each time, and the loss keeps climbing.

94
00:04:31,200 --> 00:04:35,118
Accuracy roughly holds, but something's being paid.

95
00:04:35,118 --> 00:04:36,990
Tying weights isn't free.

96
00:04:37,703 --> 00:04:39,648
There's more than one way to fold.

97
00:04:39,648 --> 00:04:42,337
Sequence repeats each layer in place.

98
00:04:42,337 --> 00:04:46,450
Zero zero zero, one one one, two two two.

99
00:04:46,450 --> 00:04:49,403
Cycle runs the whole stack, then again.

100
00:04:49,403 --> 00:04:53,724
Zero one two, zero one two, zero one two.

101
00:04:53,724 --> 00:04:56,080
Same weights, same depth.

102
00:04:56,418 --> 00:04:59,780
It's the difference between reading each page three times

103
00:04:59,780 --> 00:05:02,420
before you turn it, and reading the whole book three

104
00:05:02,420 --> 00:05:06,819
times. Trained from scratch, the whole-book reader wins.

105
00:05:06,819 --> 00:05:10,690
Sequence had the worst loss in every setting they tried.

106
00:05:11,330 --> 00:05:15,170
Then a refinement. Give the first and last layers their

107
00:05:15,170 --> 00:05:18,213
own private weights, and loop only the middle.

108
00:05:18,213 --> 00:05:21,250
Entry and exit are different jobs from thinking.

109
00:05:21,250 --> 00:05:24,530
That's Middle-Cycle, and in three of four settings it has

110
00:05:24,530 --> 00:05:27,890
the lowest loss, landing between a plain model of about

111
00:05:27,890 --> 00:05:30,649
its size and the full-size one it copied.

112
00:05:30,649 --> 00:05:33,890
Pit it against plain Cycle with exactly the same unique

113
00:05:33,890 --> 00:05:37,346
parameters, and it edges it with fewer effective layers,

114
00:05:37,346 --> 00:05:39,280
in the one test they ran.

115
00:05:40,016 --> 00:05:41,659
When should the loop arrive?

116
00:05:41,659 --> 00:05:44,899
You could finish a normal model and loop it afterwards.

117
00:05:44,899 --> 00:05:48,420
The Nanbeige team tried both, and training with the loop

118
00:05:48,420 --> 00:05:51,733
from the very first step was significantly better.

119
00:05:51,733 --> 00:05:55,277
The layers seem to need to grow up expecting to be reused.

120
00:05:55,277 --> 00:05:56,927
There's a hardware bonus too:

121
00:05:56,927 --> 00:05:59,380
gather the weights across your cluster once,

122
00:05:59,380 --> 00:06:01,490
and every pass can use them.

123
00:06:05,149 --> 00:06:07,451
Draw the compute bill as a picture.

124
00:06:07,451 --> 00:06:09,136
Each column is a token.

125
00:06:09,136 --> 00:06:11,789
Each row is a pass through the stack.

126
00:06:11,789 --> 00:06:15,310
Every cell costs money, and a looped model pays for the

127
00:06:15,310 --> 00:06:18,986
whole rectangle. But look at what those columns are.

128
00:06:18,986 --> 00:06:21,289
If you could only hand out so many passes,

129
00:06:21,289 --> 00:06:22,780
where would you spend them?

130
00:06:24,664 --> 00:06:27,067
Here's what a trained model decided.

131
00:06:27,067 --> 00:06:29,276
Purple tokens get one pass.

132
00:06:29,276 --> 00:06:32,402
Blue, two. Red, three.

133
00:06:32,402 --> 00:06:34,441
"People", at the start of a sentence:

134
00:06:34,441 --> 00:06:38,432
three. Then "who feel comfortable defending their views":

135
00:06:38,432 --> 00:06:42,719
one, one, one, one, one, one.

136
00:06:42,719 --> 00:06:44,670
And "def": one.

137
00:06:45,001 --> 00:06:48,369
Because the color doesn't say how hard this word is.

138
00:06:48,369 --> 00:06:51,489
It says how hard the next one is to predict.

139
00:06:51,489 --> 00:06:53,970
The rectangle turns into a staircase,

140
00:06:53,970 --> 00:06:56,160
and a third of the cells are gone.

141
00:06:56,527 --> 00:06:58,986
We counted the paper's ten samples,

142
00:06:58,986 --> 00:07:00,978
about a thousand tokens.

143
00:07:00,978 --> 00:07:03,721
The word "Unix" shows up five times,

144
00:07:03,721 --> 00:07:06,589
and gets all three passes every time.

145
00:07:06,589 --> 00:07:08,340
Lots of things could follow it.

146
00:07:08,340 --> 00:07:12,260
A lone space shows up 48 times, and nearly always gets

147
00:07:12,260 --> 00:07:15,703
one. The authors call this latent reasoning:

148
00:07:15,703 --> 00:07:19,090
thinking without words, one token at a time.

149
00:07:19,669 --> 00:07:22,703
Spending less on easy tokens isn't new.

150
00:07:22,703 --> 00:07:26,017
Early exiting stops climbing once the model's sure.

151
00:07:26,017 --> 00:07:28,688
But it often gets bolted on after training,

152
00:07:28,688 --> 00:07:30,707
and that can cost performance.

153
00:07:30,707 --> 00:07:33,430
Mixture of Depths made it a routing problem:

154
00:07:33,430 --> 00:07:37,010
a tiny router at each layer picks who gets computed.

155
00:07:37,010 --> 00:07:40,230
Mixture of Recursions moves that router into the loop,

156
00:07:40,230 --> 00:07:42,420
and trains it from the first step.

157
00:07:42,709 --> 00:07:44,839
The router is almost nothing:

158
00:07:44,839 --> 00:07:46,589
one score per token.

159
00:07:46,589 --> 00:07:50,040
Chosen tokens go round again, and whatever they compute is

160
00:07:50,040 --> 00:07:52,506
scaled by that score and added on.

161
00:07:52,506 --> 00:07:55,110
Everyone else passes through untouched.

162
00:07:55,665 --> 00:07:57,759
There are two ways to run the door.

163
00:07:57,759 --> 00:08:01,370
Expert-choice: every pass is a bouncer with a fixed number

164
00:08:01,370 --> 00:08:04,570
of slots. With three passes, everyone gets through the

165
00:08:04,570 --> 00:08:08,418
first, two thirds the second, one third the third.

166
00:08:08,418 --> 00:08:11,720
And you can only make pass three if you made pass two.

167
00:08:12,069 --> 00:08:15,401
Token-choice: every token buys a ticket up front,

168
00:08:15,401 --> 00:08:18,300
for one, two or three passes.

169
00:08:18,300 --> 00:08:20,300
The bouncer guarantees your budget.

170
00:08:20,300 --> 00:08:21,899
Tickets guarantee nothing:

171
00:08:21,899 --> 00:08:23,770
everyone might want three.

172
00:08:24,445 --> 00:08:26,385
But the bouncer has a problem.

173
00:08:26,385 --> 00:08:30,173
To pick the top third, it has to compare all the tokens.

174
00:08:30,173 --> 00:08:32,749
Including tokens later in the sentence.

175
00:08:32,749 --> 00:08:35,630
In training, the whole sentence is sitting there.

176
00:08:35,630 --> 00:08:38,430
In real use, the future doesn't exist yet.

177
00:08:38,430 --> 00:08:40,479
It's a causality violation:

178
00:08:40,479 --> 00:08:43,606
information leaking backward in time.

179
00:08:43,606 --> 00:08:45,118
There are two fixes.

180
00:08:45,118 --> 00:08:48,160
Train a little shadow router to imitate its picks.

181
00:08:48,160 --> 00:08:52,320
Or add a loss that pushes chosen tokens toward one,

182
00:08:52,320 --> 00:08:54,319
and everyone else toward zero.

183
00:08:54,319 --> 00:08:57,280
That second one works almost absurdly well.

184
00:08:57,280 --> 00:09:00,400
Two clean spikes, and nothing in between.

185
00:09:00,400 --> 00:09:03,150
The router learns to know the answer without looking.

186
00:09:03,519 --> 00:09:04,930
Which is also a trap.

187
00:09:04,930 --> 00:09:07,970
Those scores are so binary that it's hard to turn the

188
00:09:07,970 --> 00:09:10,454
capacity up or down afterward.

189
00:09:10,454 --> 00:09:13,040
The authors list that as an open problem.

190
00:09:13,715 --> 00:09:17,006
Getting here took a graveyard of failed routers.

191
00:09:17,006 --> 00:09:19,860
Remove the squashing function, and the loss goes to

192
00:09:19,860 --> 00:09:24,260
not-a-number. In several variants, two thirds of positions

193
00:09:24,260 --> 00:09:27,700
were dead: the router just picked the same spots in every

194
00:09:27,700 --> 00:09:31,458
sentence. The winner was the simplest thing on the list:

195
00:09:31,458 --> 00:09:34,450
a sigmoid, and a single linear layer.

196
00:09:34,790 --> 00:09:37,076
Then the humbling control.

197
00:09:37,076 --> 00:09:38,841
A router that picks at random.

198
00:09:38,841 --> 00:09:42,644
It reaches 39.1. The best learned router:

199
00:09:42,644 --> 00:09:46,637
40.1. So learning is buying the last point,

200
00:09:46,637 --> 00:09:48,262
not the whole idea.

201
00:09:48,262 --> 00:09:50,130
Token-choice had it worse.

202
00:09:50,130 --> 00:09:53,121
It struggled to balance its loads for much of training,

203
00:09:53,121 --> 00:09:55,750
and on the full compute budget it scored forty,

204
00:09:55,750 --> 00:09:58,740
against 42.6 for the bouncer.

205
00:10:02,449 --> 00:10:04,799
Routing saves more than it looks like.

206
00:10:04,799 --> 00:10:07,804
Attention compares every token with every other,

207
00:10:07,804 --> 00:10:09,280
and that's a square.

208
00:10:09,280 --> 00:10:12,720
Keep a third of the tokens, and that pass pays for a ninth

209
00:10:12,720 --> 00:10:15,424
of the square. That's true in training too,

210
00:10:15,424 --> 00:10:18,240
which is how these models read more text for the same

211
00:10:18,240 --> 00:10:19,150
compute.

212
00:10:19,809 --> 00:10:21,543
Now the third bill.

213
00:10:21,543 --> 00:10:24,770
When a model generates text, it can't redo all that

214
00:10:24,770 --> 00:10:26,930
attention for each new token.

215
00:10:26,930 --> 00:10:30,610
So every token leaves a key and a value behind,

216
00:10:30,610 --> 00:10:33,970
in every layer. That's the K V cache,

217
00:10:33,970 --> 00:10:35,966
and it eats memory fast.

218
00:10:35,966 --> 00:10:37,417
Folding doesn't help.

219
00:10:37,417 --> 00:10:41,490
The weights are tied, but each depth keeps its own cache.

220
00:10:41,490 --> 00:10:43,804
And early exit makes it worse:

221
00:10:43,804 --> 00:10:47,329
a token that left early has no keys at the deeper levels,

222
00:10:47,329 --> 00:10:50,560
so it leaves holes for later tokens to fall into.

223
00:10:51,220 --> 00:10:54,218
Two designs. Recursion-wise caching:

224
00:10:54,218 --> 00:10:57,697
a depth stores only the tokens that actually ran there,

225
00:10:57,697 --> 00:10:59,700
and they attend only to each other.

226
00:10:59,700 --> 00:11:02,024
The holes vanish by definition.

227
00:11:02,024 --> 00:11:06,130
With three passes, memory and traffic drop to two thirds.

228
00:11:06,468 --> 00:11:10,159
Recursive sharing: every token goes through pass one,

229
00:11:10,159 --> 00:11:13,833
so cache only that, and reuse it at every depth.

230
00:11:13,833 --> 00:11:15,672
Memory falls to a third.

231
00:11:15,672 --> 00:11:18,891
But you still haul the whole thing around on every pass,

232
00:11:18,891 --> 00:11:20,980
so the traffic doesn't drop at all.

233
00:11:21,719 --> 00:11:24,840
Reusing keys from a different depth sounds like it should

234
00:11:24,840 --> 00:11:28,040
wreck things. In an ordinary transformer,

235
00:11:28,040 --> 00:11:29,229
it actually helped.

236
00:11:29,229 --> 00:11:32,790
Loss went down. It acts like regularization.

237
00:11:33,089 --> 00:11:34,948
Here's why it can work in a loop.

238
00:11:34,948 --> 00:11:38,169
Plot the keys by layer, and the pattern repeats.

239
00:11:38,169 --> 00:11:40,410
Compare every layer with every other,

240
00:11:40,410 --> 00:11:41,756
and stripes appear:

241
00:11:41,756 --> 00:11:45,550
same layer, one loop later, nearly the same keys,

242
00:11:45,550 --> 00:11:47,960
and somewhat similar values.

243
00:11:48,300 --> 00:11:50,773
In Mixture of Recursions it splits.

244
00:11:50,773 --> 00:11:53,900
Sharing hurts the bouncer, where attending only among the

245
00:11:53,900 --> 00:11:55,899
chosen seems to matter.

246
00:11:55,899 --> 00:11:58,403
For the ticket booth, loss improves,

247
00:11:58,403 --> 00:12:01,340
perhaps because the extra context patches its sloppy

248
00:12:01,340 --> 00:12:03,947
routing, but accuracy slips.

249
00:12:03,947 --> 00:12:07,740
A year later, Nanbeige tried it on three billion

250
00:12:07,740 --> 00:12:11,340
parameters. It halved the cache, and the gains came in

251
00:12:11,340 --> 00:12:12,979
consistently lower.

252
00:12:12,979 --> 00:12:15,980
They kept the full cache, and paid the memory bill on

253
00:12:15,980 --> 00:12:16,970
purpose.

254
00:12:17,630 --> 00:12:19,450
One more gift of folding.

255
00:12:19,450 --> 00:12:22,510
In a normal model, tokens at different layers need

256
00:12:22,510 --> 00:12:25,950
different weights, so a batch waits around for its slowest

257
00:12:25,950 --> 00:12:30,627
passenger. In a loop, every depth uses the same weights,

258
00:12:30,627 --> 00:12:32,274
so they can all ride together.

259
00:12:32,274 --> 00:12:36,189
When a token gets off early, its seat fills immediately.

260
00:12:36,189 --> 00:12:38,460
It's a bus that never waits.

261
00:12:38,800 --> 00:12:43,040
Against a plain model, that's up to 1.42 times the

262
00:12:43,040 --> 00:12:45,298
throughput at the same batch size.

263
00:12:45,298 --> 00:12:48,400
And since fewer weights and smaller caches let you fit a

264
00:12:48,400 --> 00:12:51,760
bigger bus, up to 2.06 times.

265
00:12:51,760 --> 00:12:54,475
Two loops is both faster and better.

266
00:12:54,475 --> 00:12:57,679
Four loops, on the bigger bus, doubles the speed,

267
00:12:57,679 --> 00:12:59,550
and gives some quality back.

268
00:12:59,899 --> 00:13:03,160
The fine print: those timings leave out the time spent

269
00:13:03,160 --> 00:13:04,800
updating the cache.

270
00:13:04,800 --> 00:13:08,640
The authors say a more precise comparison is future work.

271
00:13:12,291 --> 00:13:15,660
How do you compare a model that's half the size and skips

272
00:13:15,660 --> 00:13:19,020
some of its work? Give everyone the same compute bill,

273
00:13:19,020 --> 00:13:21,091
and let them spend it however they like.

274
00:13:21,091 --> 00:13:25,260
At 16.5 exa-flops, the plain model reaches an accuracy of

275
00:13:25,260 --> 00:13:29,434
42.3. Mixture of Recursions, two loops:

276
00:13:29,434 --> 00:13:32,293
43.1. With lower loss.

277
00:13:32,293 --> 00:13:34,330
And nearly half the parameters.

278
00:13:34,670 --> 00:13:37,548
A big part of why: it's cheaper per token,

279
00:13:37,548 --> 00:13:41,465
so on the same bill it read twenty-seven billion tokens,

280
00:13:41,465 --> 00:13:44,835
not twenty. Give both exactly twenty billion:

281
00:13:44,835 --> 00:13:48,190
a quarter less compute, a fifth less training time,

282
00:13:48,190 --> 00:13:51,660
a quarter less memory, and it still comes out ahead.

283
00:13:52,320 --> 00:13:55,676
Then four sizes, across three budgets.

284
00:13:55,676 --> 00:13:59,790
At 135 million, the plain model wins everything.

285
00:14:00,082 --> 00:14:02,880
Probably there just isn't enough room to share.

286
00:14:02,880 --> 00:14:07,360
From 360 million up, Mixture of Recursions takes all nine

287
00:14:07,360 --> 00:14:11,120
on accuracy and seven on loss, with well under half the

288
00:14:11,120 --> 00:14:12,270
parameters.

289
00:14:12,610 --> 00:14:14,311
But the authors kept going.

290
00:14:14,311 --> 00:14:18,210
At 1.7 billion, with four times the compute,

291
00:14:18,210 --> 00:14:20,607
the plain model wins back the lead:

292
00:14:20,607 --> 00:14:27,250
48.9, against 48.4 with two loops and 46.7 with three.

293
00:14:27,250 --> 00:14:28,612
And they don't hide from it.

294
00:14:28,612 --> 00:14:31,170
It could be token counts, they write,

295
00:14:31,170 --> 00:14:34,511
or it might signal the design isn't suited for scaling.

296
00:14:34,511 --> 00:14:37,970
What they do find is that routed loops want to be bigger

297
00:14:37,970 --> 00:14:41,360
and train for less, so they're less hungry for data.

298
00:14:41,998 --> 00:14:44,907
Now the result I find most striking.

299
00:14:44,907 --> 00:14:47,779
Take a trained model, and at test time,

300
00:14:47,779 --> 00:14:50,663
cap how many passes a token can have.

301
00:14:50,663 --> 00:14:54,419
The two-pass model improves a lot on its second pass.

302
00:14:54,419 --> 00:14:56,505
Now the four-pass model.

303
00:14:56,505 --> 00:14:58,578
Pass one, pass two:

304
00:14:58,578 --> 00:15:01,300
a huge jump. Pass three:

305
00:15:01,300 --> 00:15:03,219
a little. Pass four:

306
00:15:03,219 --> 00:15:06,770
three thousandths. You need a magnifying glass.

307
00:15:07,110 --> 00:15:10,950
A year later, Nanbeige asked the question on a real

308
00:15:10,950 --> 00:15:13,194
three-billion-parameter model.

309
00:15:13,194 --> 00:15:15,726
Two passes gave the best trade-off.

310
00:15:15,726 --> 00:15:18,870
More gave marginal gains, trained slower,

311
00:15:18,870 --> 00:15:20,500
and got less stable.

312
00:15:20,869 --> 00:15:24,200
Two very different experiments, a year apart,

313
00:15:24,200 --> 00:15:25,642
and the same shape.

314
00:15:25,642 --> 00:15:27,855
The second look does most of the work.

315
00:15:27,855 --> 00:15:29,110
Think twice.

316
00:15:32,822 --> 00:15:35,027
So what did they actually ship?

317
00:15:35,027 --> 00:15:37,489
Twenty-two layers, two passes.

318
00:15:37,489 --> 00:15:40,289
Forty-four deep. A loop, yes.

319
00:15:40,289 --> 00:15:43,809
A router? No: every token gets both passes.

320
00:15:43,809 --> 00:15:45,863
A shared cache? No.

321
00:15:45,863 --> 00:15:47,487
A private entrance and exit?

322
00:15:47,487 --> 00:15:50,800
No. It took the loop, and left the rest.

323
00:15:51,145 --> 00:15:54,180
Although its code has a switch that keeps the outer layers

324
00:15:54,180 --> 00:15:57,620
unlooped, and they say it's headed for their next model.

325
00:15:57,620 --> 00:16:01,140
Meanwhile, the Mixture of Recursions paper named scaling

326
00:16:01,140 --> 00:16:04,974
past three billion parameters as its next step.

327
00:16:04,974 --> 00:16:08,260
In these two papers, per-token routing at that scale is

328
00:16:08,260 --> 00:16:10,130
still an empty square.

329
00:16:10,790 --> 00:16:14,786
They pretrained it from scratch on 28 trillion tokens,

330
00:16:14,786 --> 00:16:18,550
weighted toward math, code and synthetic questions.

331
00:16:18,550 --> 00:16:22,540
And on all six tests, it beat base models of its size.

332
00:16:22,540 --> 00:16:24,631
That's the loop and the data together;

333
00:16:24,631 --> 00:16:26,469
the paper can't separate them.

334
00:16:26,469 --> 00:16:29,589
But a base model is just a very good autocomplete.

335
00:16:29,589 --> 00:16:31,265
It can't do anything yet.

336
00:16:31,265 --> 00:16:33,300
That's the other half of this story.

337
00:16:37,380 --> 00:16:39,210
An agent is a loop too.

338
00:16:39,210 --> 00:16:43,332
Think, act, read what comes back, think again.

339
00:16:43,332 --> 00:16:46,415
One full run of that is called a trajectory.

340
00:16:46,415 --> 00:16:48,740
Small agents usually specialize:

341
00:16:48,740 --> 00:16:51,380
they code, or they do office work.

342
00:16:51,380 --> 00:16:54,740
This team wanted one small model to do it all.

343
00:16:54,740 --> 00:16:57,779
To teach that, you need examples of it going right,

344
00:16:57,779 --> 00:17:00,930
at huge scale. So you build worlds.

345
00:17:01,590 --> 00:17:04,063
Start with real GitHub history.

346
00:17:04,063 --> 00:17:05,994
Find a patch that fixed something.

347
00:17:05,994 --> 00:17:08,149
Rewind to the commit before it.

348
00:17:08,149 --> 00:17:10,450
Rebuild that world in a container.

349
00:17:10,450 --> 00:17:14,180
Then hide the patch, and hide the tests that check it.

350
00:17:14,514 --> 00:17:16,970
Now you have an exam with an answer key.

351
00:17:16,970 --> 00:17:19,720
Target tests must fail before the patch,

352
00:17:19,720 --> 00:17:23,561
and pass after. Everything else must pass both times.

353
00:17:23,561 --> 00:17:26,790
Anything flaky or ambiguous gets thrown out.

354
00:17:27,190 --> 00:17:29,690
Then several different agent harnesses attack it

355
00:17:29,690 --> 00:17:32,730
independently, so the model learns the reasoning,

356
00:17:32,730 --> 00:17:34,967
and not one tool's habits.

357
00:17:34,967 --> 00:17:37,130
Keep only the runs that pass.

358
00:17:37,130 --> 00:17:39,598
Then go through those turn by turn,

359
00:17:39,598 --> 00:17:42,796
and cut the wrong calls and the going in circles.

360
00:17:42,796 --> 00:17:44,258
And here's the part I like:

361
00:17:44,258 --> 00:17:47,290
the model's own recurring failures steer which

362
00:17:47,290 --> 00:17:49,720
repositories get mined next.

363
00:17:50,395 --> 00:17:54,540
For tools, they collected thousands of real tool specs,

364
00:17:54,540 --> 00:17:57,980
kept the ones that combine well, and had an agent build

365
00:17:57,980 --> 00:18:01,900
each world: pull in real data, and rebuild the tools as

366
00:18:01,900 --> 00:18:05,173
Python functions. Some tools stay live,

367
00:18:05,173 --> 00:18:08,940
some are local, and some are simulated by another model.

368
00:18:08,940 --> 00:18:12,540
Then a solver tries each task over and over.

369
00:18:12,540 --> 00:18:16,090
If it reliably succeeds, the task gets harder.

370
00:18:16,750 --> 00:18:19,017
Office work starts from documents:

371
00:18:19,017 --> 00:18:23,150
reports, decks, spreadsheets, across finance,

372
00:18:23,150 --> 00:18:24,855
law and healthcare.

373
00:18:24,855 --> 00:18:28,669
Cluster them, and sample bundles that belong together.

374
00:18:28,669 --> 00:18:32,430
An agent explores a bundle and writes a task and a rubric.

375
00:18:32,430 --> 00:18:35,630
Models attempt it, and an independent judge scores the

376
00:18:35,630 --> 00:18:38,670
result. And the good results go back in as source

377
00:18:38,670 --> 00:18:41,303
material. Outputs become inputs.

378
00:18:41,303 --> 00:18:42,700
It's another loop.

379
00:18:43,360 --> 00:18:46,166
Supervised training runs in three stages,

380
00:18:46,166 --> 00:18:49,594
as the context window doubles and doubles again.

381
00:18:49,594 --> 00:18:51,518
First, mostly reasoning:

382
00:18:51,518 --> 00:18:55,118
82.7 percent, and barely any agent work.

383
00:18:55,118 --> 00:18:58,707
Then a mix. Finally 68.9 percent agents.

384
00:18:58,707 --> 00:19:01,310
Reasoning first, then agency.

385
00:19:01,717 --> 00:19:04,128
And there's one beautiful trick.

386
00:19:04,128 --> 00:19:07,333
A winning run can still contain a bad turn.

387
00:19:07,333 --> 00:19:10,210
So they mark that turn, and take it out of the training

388
00:19:10,210 --> 00:19:12,770
loss. But they leave it in the context,

389
00:19:12,770 --> 00:19:14,610
along with whatever went wrong.

390
00:19:14,610 --> 00:19:17,249
So the model isn't taught to make the mistake.

391
00:19:17,249 --> 00:19:19,440
It is taught to recover from it.

392
00:19:23,100 --> 00:19:26,857
After all that, it's capable, and it's a mess.

393
00:19:26,857 --> 00:19:30,054
It repeats itself. It reflects in circles.

394
00:19:30,054 --> 00:19:31,804
It doesn't know when to stop.

395
00:19:31,804 --> 00:19:34,780
And in long agent tasks, many failures aren't wrong

396
00:19:34,780 --> 00:19:37,370
reasoning at all. They're just this.

397
00:19:37,950 --> 00:19:41,230
So they trained a reward model that grades each answer on

398
00:19:41,230 --> 00:19:44,270
its own: is it right, is it well formed,

399
00:19:44,270 --> 00:19:48,430
did it finish? They ran it first on thinking responses,

400
00:19:48,430 --> 00:19:52,110
then mostly on plain chat answers to everyday questions,

401
00:19:52,110 --> 00:19:54,940
the kind of training you'd assume is about manners.

402
00:19:54,940 --> 00:19:56,623
Then they tested coding.

403
00:19:56,623 --> 00:19:59,296
Sixty-five, up to seventy-two.

404
00:19:59,296 --> 00:20:01,869
Answers got forty percent shorter.

405
00:20:01,869 --> 00:20:06,094
And the rate of malformed or runaway answers went to zero.

406
00:20:06,094 --> 00:20:10,460
One agent benchmark went from fifty-six to seventy-five.

407
00:20:10,736 --> 00:20:14,400
Two surprises. Training on general chat improved hard

408
00:20:14,400 --> 00:20:17,600
technical work. And training mostly without thinking

409
00:20:17,600 --> 00:20:19,600
improved the model's thinking.

410
00:20:19,600 --> 00:20:21,200
It seems it already knew how.

411
00:20:21,200 --> 00:20:23,710
It just kept tripping over its own feet.

412
00:20:24,290 --> 00:20:26,369
Then comes a subtler problem.

413
00:20:26,369 --> 00:20:29,810
Reward only correct answers, and nothing stops the

414
00:20:29,810 --> 00:20:31,315
thinking from growing.

415
00:20:31,315 --> 00:20:33,269
So each problem gets a budget:

416
00:20:33,269 --> 00:20:36,350
the median length of past correct answers.

417
00:20:36,350 --> 00:20:38,450
Stay under it: no penalty.

418
00:20:38,450 --> 00:20:40,930
Go over it: the penalty grows.

419
00:20:40,930 --> 00:20:42,374
And here's the clever part.

420
00:20:42,374 --> 00:20:45,730
The penalty is scaled by how often the model solves that

421
00:20:45,730 --> 00:20:48,366
problem. Something it always gets right:

422
00:20:48,366 --> 00:20:51,567
full penalty. Something it usually fails:

423
00:20:51,567 --> 00:20:54,850
almost none. Be concise when you know the answer.

424
00:20:54,850 --> 00:20:56,480
Explore when you don't.

425
00:20:57,218 --> 00:20:59,784
Long agent runs have a different problem.

426
00:20:59,784 --> 00:21:03,138
You get one score at the very end of a long run.

427
00:21:03,138 --> 00:21:06,974
So a rubric also grades each action as it happens.

428
00:21:06,974 --> 00:21:09,060
And here's the part that surprised me.

429
00:21:09,060 --> 00:21:11,979
They trained only on the easier tasks.

430
00:21:11,979 --> 00:21:15,300
For a small model, those gave steadier training and bigger

431
00:21:15,300 --> 00:21:17,056
gains than the hard ones.

432
00:21:17,056 --> 00:21:19,380
Errors per turn fell about a fifth,

433
00:21:19,380 --> 00:21:22,550
and the overall score peaked near 71.

434
00:21:22,550 --> 00:21:25,819
Add it all up, and the whole of R L did this:

435
00:21:25,819 --> 00:21:30,486
accuracy up on six benchmarks, tokens down on all six.

436
00:21:30,486 --> 00:21:32,151
On one agent benchmark:

437
00:21:32,151 --> 00:21:35,125
nineteen points better, with half the words.

438
00:21:35,125 --> 00:21:37,940
Twice per token. Less per problem.

439
00:21:42,100 --> 00:21:44,005
So here's the scoreboard.

440
00:21:44,005 --> 00:21:47,300
On general agent work, it beats everything here on seven

441
00:21:47,300 --> 00:21:49,076
of seven. Code agents:

442
00:21:49,076 --> 00:21:51,223
three of three. Reasoning:

443
00:21:51,223 --> 00:21:54,164
five of six, one by half a point.

444
00:21:54,164 --> 00:21:56,980
And one of those rivals has more than three times its

445
00:21:56,980 --> 00:21:59,313
parameters. It does lose:

446
00:21:59,313 --> 00:22:02,820
narrowly on scientific code, and badly on following

447
00:22:02,820 --> 00:22:06,338
complicated instructions, 54.6 to 73.5.

448
00:22:06,338 --> 00:22:08,589
And in a shared assistant framework,

449
00:22:08,589 --> 00:22:12,210
against two rivals, it won all six tests.

450
00:22:12,869 --> 00:22:14,876
Now read it like a skeptic.

451
00:22:14,876 --> 00:22:16,941
These are the team's own numbers.

452
00:22:16,941 --> 00:22:20,630
Many are graded by another A I model acting as judge.

453
00:22:20,630 --> 00:22:22,067
And the setup matters:

454
00:22:22,067 --> 00:22:25,590
one rival drops from sixty-two to thirty-eight on the same

455
00:22:25,590 --> 00:22:28,980
benchmark, when the framework and the judge change.

456
00:22:29,312 --> 00:22:33,639
Most importantly, no published number isolates the loop.

457
00:22:33,639 --> 00:22:37,160
From these results, nobody can say how much of this win is

458
00:22:37,160 --> 00:22:40,790
the loop, how much the data, and how much the training.

459
00:22:41,132 --> 00:22:42,793
There is an outside check.

460
00:22:42,793 --> 00:22:46,010
A benchmark firm scored the quantized models on different

461
00:22:46,010 --> 00:22:50,168
tests, and Liquid AI, which makes the model that ties it,

462
00:22:50,168 --> 00:22:52,010
timed them on an iPhone.

463
00:22:52,010 --> 00:22:56,010
There, it ties for first, with a score of sixty-three.

464
00:22:56,010 --> 00:22:58,889
The nine-billion rival gets sixty-one.

465
00:22:58,889 --> 00:23:02,487
Far closer, and a slightly smaller model matches it.

466
00:23:02,487 --> 00:23:04,390
And then, the bills.

467
00:23:04,390 --> 00:23:06,810
The model that tied it took eight seconds on their

468
00:23:06,810 --> 00:23:09,767
standard prompt. This one took twenty-one,

469
00:23:09,767 --> 00:23:12,575
the nine-billion rivals over twenty-five.

470
00:23:12,575 --> 00:23:15,930
Cap every answer at one minute, and at fourteen tokens a

471
00:23:15,930 --> 00:23:19,257
second, its reasoning mostly never finishes.

472
00:23:19,257 --> 00:23:22,810
Its score falls to eighteen, and the nine-billion rival's

473
00:23:22,810 --> 00:23:25,768
to fourteen. The article doesn't say why.

474
00:23:25,768 --> 00:23:28,054
But a plain loop cuts what you store.

475
00:23:28,054 --> 00:23:30,170
It doesn't cut what you run.

476
00:23:30,170 --> 00:23:34,360
And that, of course, is the bill a router is built to cut.

477
00:23:38,020 --> 00:23:40,977
Step back, and look at what we've seen.

478
00:23:40,977 --> 00:23:43,699
A stack of layers, running again.

479
00:23:43,699 --> 00:23:46,493
A router, deciding who goes around.

480
00:23:46,493 --> 00:23:49,576
A chain of reasoning, going around in words.

481
00:23:49,576 --> 00:23:52,482
An agent, going around through the world.

482
00:23:52,482 --> 00:23:55,300
And a training pipeline, going around through its own

483
00:23:55,300 --> 00:23:57,786
failures. Five loops.

484
00:23:57,786 --> 00:23:59,698
And each one is the same move:

485
00:23:59,698 --> 00:24:02,180
take a fixed thing, apply it again,

486
00:24:02,180 --> 00:24:04,050
and decide when to stop.

487
00:24:04,710 --> 00:24:06,380
A lot is still open.

488
00:24:06,380 --> 00:24:09,350
Can a router learn from real reasoning data,

489
00:24:09,350 --> 00:24:11,342
and not just web text?

490
00:24:11,342 --> 00:24:14,950
Does routing hold up past three billion parameters?

491
00:24:14,950 --> 00:24:17,910
And how far can a small model go if all of it,

492
00:24:17,910 --> 00:24:20,150
the architecture and the curriculum,

493
00:24:20,150 --> 00:24:21,940
gets built to go around?

494
00:24:22,280 --> 00:24:25,160
Next time someone tells you how many parameters a model

495
00:24:25,160 --> 00:24:27,556
has, ask the better question.

496
00:24:27,556 --> 00:24:29,910
How many times does it get to think?

497
00:24:31,588 --> 00:24:34,880
And here's everything we didn't have time to say.
