Y Combinator Startup Podcast - 超越更大模型:递归作为人工智能的下一个扩展法则 封面

超越更大模型:递归作为人工智能的下一个扩展法则

Beyond Bigger Models: Recursion As The Next Scaling Law In AI

本集简介

一个仅有700万参数的模型在ARC竞赛等任务上表现超越了规模大千倍的模型,这就是递归推理所释放的力量。在本期《Decoded》中,YC的安基特·古普塔和弗朗索瓦·肖巴尔深入剖析了两篇关于递归AI模型HRM和TRM的最新论文,这些模型仅用当前最大模型的一小部分参数就实现了最先进的成果。他们解释了为何标准大语言模型在某些推理任务上遇到根本性瓶颈,推理时的递归机制如何赋予小型模型足够的计算深度来突破这一限制,以及将这些理念与大规模基础模型的强大能力结合后会发生什么。

双语字幕

仅展示文本字幕,不包含中文音频;想边听边看,请使用 Bayt 播客 App。

Speaker 0

欢迎回到《解码》的又一期节目。

Welcome back to another episode of Decoded.

Speaker 0

今天我请来了YC的访问合伙人弗朗索瓦·肖巴尔,聊聊AI研究里最近一个特别有意思的趋势——递归。

Today, I'm back with YC visiting partner Francois Chaubard to talk about one of the most interesting recent trends in AI research, recursion.

Speaker 0

我们重点要说的是,怎么在推理阶段用递归,而不是一味把模型做得越来越大,来提升模型的推理能力。

Specifically, we're gonna talk about how we can improve a model's reasoning performance by using recursion at inference time rather than by just making the model bigger and bigger.

Speaker 0

2025年有两篇论文,把这种做法的威力讲得特别清楚。

There were two papers that made the power of this approach really clear in 2025.

Speaker 0

一篇是关于层次化推理模型,也就是HRM;另一篇是关于小型递归模型,简称TRM。

One on hierarchical reasoning models or HRM and another on tiny recursive models, TRM.

Speaker 0

弗朗索瓦,谢谢你来参加我们的节目。

Francois, thanks for joining us.

Speaker 0

你能给我们简单讲讲这两个模型,到底哪儿特别有意思吗?

Can you tell us a little bit about these two models and what was so interesting about them?

Speaker 1

当然可以。

Sure.

Speaker 1

为了打个底,你之前那期视频讲RNN和语言模型已经讲得特别棒了,我就不重复了。

I guess to set up a little bit of a foundation, you already did an amazing lecture on RNNs and LMs in one of the previous videos, so I won't overdo it.

Speaker 1

简单说一下要点,RNN就是不断自己调用自己、循环执行的模型。

But just to give the cliff notes, an RNN is just a model that you recursively call again and again and again on itself.

Speaker 1

那时候大家都觉得,要实现通用人工智能,非得靠这种递归结构不可——直到2016年Alex Graves在NeurIPS的演讲,那场演讲太精彩了,他那些自适应计算时间的研究简直神了。

And we were very much in the belief that this was required to get to AGI peak RNN usage probably until 2016 with Alex Graves NeurIPS keynote, which is just fantastic, and all his his his adaptive compute time work.

Speaker 0

这都十年前的事了。

So this is about ten years ago.

Speaker 0

那时候大家都在搞这些模型。

People were working on these models.

Speaker 0

那会儿流行的是LSTM,还有带注意力机制的LSTM。

This was in the era of LSTMs and LSTMs with attention.

Speaker 1

是的。

Yeah.

Speaker 1

在注意力机制出来之前,你去问不同的教授,他们看法都不一样。

And depending on which professors you talked to before attention was invented.

Speaker 0

对。

Yes.

Speaker 0

没错。

Yes.

Speaker 0

完全对。

Totally.

Speaker 0

是的。

Yeah.

Speaker 1

我觉得RNN普遍受限的关键在于‘通过时间反向传播’——你得把模型展开,然后为了更新权重,还得去近似梯度,一路倒推回去,不断展开。

And and I think what really was the the the limiting step on RNNs in general was this thing called back prop through time where you have to you roll out the model, and then to update the weights, you need to approximate the gradient and you step back, back, back and you keep rolling out.

Speaker 1

随着模型越来越大,展开的步数越来越多,误差不断累积,梯度也越来越噪,最后根本没法训练了。

And as the the model gets bigger and bigger and as you roll out for more and more steps, then you have all these accumulation of errors and the gradient gets noisier and noisier and then it just stops the work.

Speaker 0

所以你遇到的就是梯度消失或爆炸的问题,因为如果输入有20步,你就得把矩阵连乘20次,这就导致了……

So you have these vanishing or exploding gradient problems and it's because if you have an input with 20 steps, you're multiplying these matrices 20 times that causes

Speaker 1

我们现在说的可是上下文长度达到百万甚至十亿级别。

And we're talking about doing context length of like a million or like a billion.

Speaker 1

所以根本不是20步,而是几十亿步。

So it's not even just 20, it's like a billion.

Speaker 1

更糟的是,你还得在每一步都保存激活值。

And even worse, you have to retain the activations at every single step.

Speaker 1

要是这事儿发生在你脑子里,那你得在每个激活时刻都准备上百万个你的大脑副本,才能做反向传播。

And so like if this were happening in your brain, would need like a million copies of your brain at every single activation so that I can back prop through it.

Speaker 1

不过也有一些技巧能缓解这问题,比如梯度检查点之类的,能减少点内存压力。

There's tricks around this that you can you can do and you can do gradient checkpointing and things like that to reduce that issue.

Speaker 1

但这么一来,其实就是拿内存换时间和算力。

But then you just like trading off memory for wall clock time and and compute.

Speaker 1

对啊。

Right.

Speaker 0

那现在你要是拿这个跟大语言模型比,比如现在大家普遍用的那些,表面上看好像差不多,但训练的时候,它们其实是对每个输入做一次性前向传播,对吧?

So now if you contrast that with LLMs, the ones that people are widely using, these while at face value they appear to be similar, at training time they're doing basically this one shot feed forward process for every input, right?

Speaker 0

大语言模型的Transformer模块可以并行处理所有输入。

The LLM, the transformer block can take all of the inputs in parallel.

Speaker 0

训练的时候它并不是一个一个地迭代处理,所以不会出现要存海量激活值的问题,也不会有严重的梯度消失问题。

It's not actually iteratively going over them one at a time at train time, so you don't have this needing to store tons of activations problem or this giant vanishing gradients problem with them.

Speaker 1

对。

Yeah.

Speaker 1

没错。

Exactly.

Speaker 1

就像是所有步骤在一瞬间同时完成了一样,简直像魔法一样。

Like it's actually like all happening in time in one shot magically.

Speaker 1

其实就是那种三角掩码的技巧,也就是那个因果掩码在起作用。

And that was like the the trill or lower triangle trick that kind of happens, this causal mask that occurs.

Speaker 1

所以你实际上是一次性完成所有时间步的前向计算,把整个序列丢进前馈网络,再一次性反向传播,训练速度快得惊人。

And so you actually do all all time steps in one shot, and you forward pass a feed forward model on all time steps in one shot, and you backwards in one shot, and it's amazing for train time in terms of like wall clock.

Speaker 1

虽然需要大量的浮点运算,内存占用也还是很大。

It requires a lot of flops and it still requires a lot of the memory.

Speaker 1

内存确实还得撑着,但至少不用担心梯度消失了。

You still need it there, you don't have the vanishing gradient issue.

Speaker 1

但你为此付出的代价是失去了这种潜在的推理能力和时间维度上的压缩。

And that what you actually paid for that you have to give up is this latent reasoning thing and this compression in the time direction.

Speaker 1

语言模型里根本不存在压缩。

There is no compression in LMs.

Speaker 1

我每次解码,都得把整部《莎士比亚全集》记在脑子里,就为了生成那么一小段。

Every single decode that I do, I still have to retain the entire, you know, Shakespeare novel just to, like, decode a little bit.

Speaker 1

而RNN就不需要这样。

And in RNNs, don't have to do that.

Speaker 1

所有信息都压缩在那个隐藏状态里,慢慢滚动推进就行。

It's all compressed in this hidden state that you kind of roll out.

Speaker 0

明白了。

Okay.

Speaker 0

那咱们再详细聊聊这个。

So let's talk about that in a little bit more detail.

Speaker 0

你提到的那种内在的推理能力。

Like, you you refer to this inherent reasoning ability.

Speaker 0

很多人觉得大语言模型是在进行推理,这个我们待会儿再细聊。

You know, many people think about LLMs as doing reasoning, and we're going to talk about that a little bit later.

Speaker 0

但你能帮我理清楚一点吗?在实际的前向计算过程中,你觉得大模型的推理能力最大的瓶颈到底在哪?

But help me understand where you see the biggest limitations in LLMs' reasoning ability is in terms of what the model does in an actual forward pass.

Speaker 1

是的。

Yeah.

Speaker 1

所以我们还得回过头去看 GPT-2。

And so I guess we go back to chat GPT two.

Speaker 1

GPT-2 那个架构在当年可是个里程碑,就靠一个词接一个词地预测,结果还真能用。

GPT two was this landmark architecture in paper that basically was just next token, next token, next token, and it kind of worked.

Speaker 1

我们当时就看着验证损失一路下降,困惑度也越来越低,模型表现越来越好,甚至能写出点像那么回事的莎士比亚风格文字。

And like we just watched val loss go down, perplexity goes down, like the model just is more performant, looks better, starts to make some Shakespeare that actually sounds somewhat plausible.

Speaker 1

对吧。

Right.

Speaker 1

但后来我们得让这些模型真正学会推理,去解决一些特别难的问题。

And then we have to get these things to reason and to actually solve some really hard problems.

Speaker 1

关于这个问题我做过大量的实验,就拿排序这个事儿来举例吧。

And and I've done extensive experiments on this, but like if you take, for example, sort.

Speaker 1

你给模型喂无穷无尽的未排序列表,还有对应的排好序的列表。

You get you have infinite amounts of unsorted lists and you give it sorted lists.

Speaker 1

就算一直这么训练它,它也没法真的把这个任务学好。

You keep feeding it to the model, it should work.

Speaker 1

是这么个理儿吧?

Right?

Speaker 1

这个模型根本没法直接把一个乱序的列表整理成有序列表。

It's actually impossible for the model to map from unsorted list to sorted list.

Speaker 0

你是说一次性完成的话?

If I have In a one shot basis.

Speaker 1

对,就是一次性完成的场景。

In a one shot basis.

Speaker 1

说白了从理论上讲,我们都知道比较排序法的复杂度下界是n log n步,你不可能用更少的步骤完成排序。

It's like it's like literally that we know a theoretical lower bound that for comparison sort you can't do better than n log n steps.

Speaker 1

如果我有一个包含31个字符或元素的列表,而我的Transformer最大只能处理30个,那我根本没足够步骤去做所有比较。

And if I have a list that's 31 characters or elements long and my transformer is 30, I run out of steps to do comparisons.

Speaker 1

我根本没法完成所有必需的步骤。

It's not possible for me to like do all the steps that is needed to to be done.

Speaker 1

在HRM和TRM里,他们用数独当不可压缩问题的典型例子,迷宫也是同样的道理。

In HRM and TRM, they use sudoku as an incompressible problem similarly and so are mazes.

Speaker 1

这些都属于不可压缩的问题。

Those are incompressible problems.

Speaker 1

滚动求和也是个不可压缩的问题。

Rolling sum, incompressible problem.

Speaker 0

你提到排序算法的时候,让我想起大学学算法那会儿,唯一能突破n log n下限的方法,就是能访问外部缓存。

So when you mentioned the sorting algorithm, when I think back to my algorithms class from college, the one way you could get faster than n log n in a sorting algorithm is if you had some access to an external memory cache.

Speaker 0

如果你能用个磁带啥的临时存数据,那确实能比N log N更快——通过有选择地把元素挪到外部存储里。

If you had some tape you could write to, then you actually can do faster than N log N by basically selectively putting things onto this memory.

Speaker 0

我觉得这正是当前大模型的硬伤:模型本身没有外部记忆磁带,所以很多提速的可能性就被堵死了。

And I suspect that's a key limitation of these LLMs in that because there's no external memory tape inbuilt into the model, you lose certain performance possibilities in terms of how fast you go.

Speaker 1

没错。

That's right.

Speaker 1

所以我觉得基数排序应该是最常见的那种。

And so I guess like a radix sort would be like the most common one.

Speaker 1

取决于你有多少个桶,就能把时间复杂度从 n log n 降到接近 n。

Had like depending on this the number of buckets that you have, you can kind of get from n log n to order n.

Speaker 1

但不可能比 n 还快。

You can't get less than n.

Speaker 1

你总得把每个元素都碰一遍。

You have to touch all the the elements.

Speaker 1

不好意思。

Sorry.

Speaker 1

这一步是躲不掉的。

You have to do that.

Speaker 1

如果你的神经网络里 Transformer 层用完了,就没机会再做这些操作了。

And if you run out of layers and transformer layers in your neural network, then you ran out of chances to do that.

Speaker 0

是的。

Yeah.

Speaker 0

这简直就是回到艾伦·图灵时代,搞图灵机那一套,对吧?

This is just like a this is like going back to like Alan Turing now and like a Turing machine, right?

Speaker 0

那到底该怎么把图灵机和大语言模型类比呢?我觉得这种类比有点说不太通。

Like what's the analogy there exactly that we should think about in terms of LLMs, I guess, not quite satisfying how you think about a Turing machine?

Speaker 1

对。

Yeah.

Speaker 1

那咱们就直接聊ChatGPT-2吧。

So if we let's just talk about like ChatGPT two.

Speaker 1

就是最原始的那个GPT-2,没加任何花里胡哨的东西。

GPT two, the the original, like no bells and whistles.

Speaker 1

它就是一个前馈网络。

It's just a feed forward model.

Speaker 1

就是一步一步地前向传递,然后取

And so it's just forward passing one step and to Taking

Speaker 0

输入一个东西,然后生成一堆输出。

an input, creating a bunch of outputs.

Speaker 1

对。

Mhmm.

Speaker 1

以数独为例,如果我有50个不同的A格子。

In the Sudoku case, if I have 50 different A squares.

Speaker 0

如果它——

And if it's

Speaker 1

只要根据现有信息能确定的就只有一种解法,那我有多少层,也就只能做到这一步。

provable that I can only do one given this information, then and I have this many layers, then that's all I can do.

Speaker 1

而所谓的捷径,就是思维链。

And the cheat this the cheat is the the chain of thought.

Speaker 1

所以确实,在测试时,它们是图灵完备的,能模拟所有图灵可计算的函数。

And so it's completely true that at test time, they are, turn complete and you can simulate all Turing computable functions at test time.

Speaker 1

但问题是,你怎么让它学会这个?

But how do you get it to learn it?

Speaker 1

你得训练它。

You need to train it.

Speaker 1

但问题在于,除非你用人类标注的推理过程来训练,可像千禧年难题这种,我们根本就没有现成的推理轨迹。

And that's where unless you're training it on human labeled traces for which there's a lot of problems like the millennial prize problem, we don't have the trace for.

Speaker 0

所以我们特别希望能有

So we'd love to have

Speaker 1

这些推理轨迹,

the trace for

Speaker 0

但根本不存在。

it, it doesn't really exist.

Speaker 0

没错。

Totally.

Speaker 0

说得通。

Makes sense.

Speaker 0

明白了。

Okay.

Speaker 0

明白了这个背景,咱们来聊聊这两篇论文吧,我觉得这能很好地突出它们和大家平时熟悉的模型之间的差异。

So with that context in mind now, let's talk about these two papers because I think that sets up a lot of the contrast we're gonna draw between these papers and the models that people are maybe more used to.

Speaker 0

先说说HRM吧。

So let's talk about HRMs first.

Speaker 0

你能不能给我讲讲这个模型是怎么工作的,背后有什么直观的思路?

Walk me through a little bit about how this model works and some of the intuition behind it.

Speaker 1

当然可以。

Sure.

Speaker 1

这个模型其实是从RNN直接发展过来的。

So this is directly in the lineage of RNNs.

Speaker 1

从RNN的角度来看,我觉得它并没有太多真正新颖的东西。

There's not that much novel from like the RNN standpoint, at least in my opinion.

Speaker 1

他们有个想法,说是受大脑启发——大脑里不同区域是以不同频率运作的。

They do have this idea of, you know, from a inspired by the brain where I have like, there's different parts of the brain that operate on different frequencies.

Speaker 1

有些区域频率特别高,属于层级结构里比较底层的部分。

There's some that operate at really high frequency which is on the low level of the hierarchy.

Speaker 1

有些则运行在很低的频率,属于更高层的结构,这两者之间的互动特别有意思。

Some that operate in a really low frequency which is the higher level of the hierarchy and the interplay between those things is really interesting.

Speaker 0

这确实是直接借鉴了人脑的机制,就像大脑不同区域会以不同频率产生不同的脑波,对吧?

So this is like literally in the human brain, there's some like bio inspiration here, which is that like you have like different waves running at different frequencies at different parts of the brain or

Speaker 1

差不多就是这个意思。

something like that.

Speaker 0

太棒了。

Cool.

Speaker 1

我觉得他们对这种频率层级的解释,至少是一种合理的理解方式。

And and I guess that interpret that's one interpretation of it, of the way that they they're talking about, you know, classifying these these hierarchies of frequencies.

Speaker 1

而最让我感兴趣的部分,是他们训练神经网络的方法。

And the way the most interesting part, at least for me, is the way that they train the neural network.

Speaker 1

你输入一个x,不管是不完整的数独、迷宫,还是ARC挑战题,先让底层模块跑t_l次,然后切换到高层模块。

You take in some x, some input, whether it's a incomplete Sudoku puzzle, a maze, or an ARC Prize challenge, you do TL steps with the l the the lower level module, then you do go to go to h.

Speaker 1

高层模块跑t_h次,最后再做n次外部精调。

You do that, t h times, and then you have n sup outer refinement steps.

Speaker 0

对。

Yeah.

Speaker 0

所以你其实就是用同一个矩阵、同一个变换,反复处理输入数据。

So you basically are like running through the input with a given matrix, with a given transformation repeatedly on it.

Speaker 0

你在这两个层级上做精炼,然后把这个过程重复好几遍。

You're doing that through two levels of refinement and then basically running that process several times.

Speaker 1

没错。

Yes.

Speaker 1

所以这里实际上有三层递归结构。

So there's exactly three levels of recursion occurring here.

Speaker 1

有底层、高层,还有外层的精炼步骤。

There's the low level, there's the high level, and then there's the outer refinement steps.

Speaker 0

我们叫它递归,是因为每次都用的是同一组权重。

And we're calling it recursion because it's the same weights that are being applied repeatedly.

Speaker 0

这些步骤之间,权重是不变的。

We're not changing the weights in between these steps.

Speaker 1

没错,就是这样。

Exactly right.

Speaker 1

你可以对 L 网络递归调用 TL 次。

You get to recurse on on the L net, TL times.

Speaker 1

对 TH 和 TL 进行循环递归,各 TH 次,然后再做 N sup。

You recurse on the TH and the TL, this looped recursion, TH times, and then you do N sup.

Speaker 1

整个外层的精炼步骤,重复 N sup 次。

You do this whole outer refinement step, n sup times.

Speaker 0

太棒了。

Cool.

Speaker 0

那为什么这样设计能奏效呢?背后的直觉是什么?

And so what's the basic intuition for why that works?

Speaker 0

这种做法到底为啥能出好结果?这篇论文实际展示了哪些效果?

Like, why does that produce an effective paper result, and what even were the results that this paper showed?

Speaker 1

对。

Yeah.

Speaker 1

所以呢,这个模型在ARC奖第一和第二轮都拿了state of the art。

And so, I mean, this got state of the art on ARC Prize one and two.

Speaker 1

这模型只有两千七百万参数,而且只在ARC奖数据上训练的。

This was a only a 27,000,000 parameter model that was only trained on ARC Prize.

Speaker 0

大概就一千个输入吧,其实就是一些谜题之类的。

So it's like a thousand inputs or something like that, like puzzles basically Literally a

Speaker 1

一千个任务,量特别特别小。

thousand tasks, which is extremely small.

Speaker 1

根本没做任何预训练。

There is no pre training at all.

Speaker 1

它从头开始,完全是白板权重,但当时已经能超越O3了——你要是还记得那时候的事的话。

This starts from like literally Tabula Rasa weights, and it can outperform at that time if we go back, you know, we had, o three, if you remember back way back when.

Speaker 1

而O3呢?直接得零分,真的一分都没有。

And it and it o o three gets zero, Literally zero.

Speaker 1

但这个模型在ARC奖第一轮至少拿到了70%,那会儿简直是重大突破。

And this got like something like 70% on ARC Prize one at least, at the time, which was just a huge breakthrough.

Speaker 1

所以你可以这么理解,这有点像变量的作用域问题。

And so kind of the the way you can kind of think this is like variable scoping.

Speaker 1

比如说,我有三个嵌套的函数,最内层的那个函数里会有一些作用域内的变量,他们叫 zl,就是那个会输出零的进位变量。

And so like if I have like, you know, three nested functions, guess the first the lowest level function has like scoped variables which they'll call z l, which is the carry that emits the zero.

Speaker 1

一个潜变量。

A latent variable.

Speaker 1

潜变量。

Latent variable.

Speaker 1

在传统的 RNN 文献里,这个东西叫隐藏状态。

And and like traditional, RNN literature, they would call this the hidden state.

Speaker 1

对。

Yeah.

Speaker 1

底层的隐藏状态。

The low level hidden state.

Speaker 1

我可以一层层递归下去,最后再把 zl 传回外层函数,也就是更高层的那个。

And I get to recurse, recurse, recurse, and then I pass back that ZL back to the the outer scoped function, the higher level one.

Speaker 1

我让这一层跑一次迭代,它又会回去调用更底层的函数。

I let that one do one iter, it goes back and calls the lower level again.

Speaker 1

这个过程是在第三层外循环里完成的,他们管这叫外层精化步骤。

It does this whole thing in a third outer loop which is called the outer refinement step.

Speaker 0

但你这么一说,听起来它跟RNN一样,也会遇到反向传播时的时间依赖问题。

But when you describe it like that, it seems like it would have the same back prop through time problem that you would have at RNNs.

Speaker 0

我觉得他们想了个挺聪明的办法来绕开这个问题。

And I think they came up with a clever trick to basically get around that.

Speaker 0

对,没错。

So like Yeah.

Speaker 0

他们到底用了什么妙招?

What was that trick that they figured out?

Speaker 1

这其实是这篇论文最核心的地方,我觉得正是它跟以往研究的根本区别:他们没像Alex Graves在神经图灵机、自适应计算时间、微分神经计算机那些论文里做的那样,把所有递归步骤都反向传播一遍。

And this is really the the crux of the paper that like differentiates it in my opinion in the literature is they instead of doing what Alex Graves did in all of his papers from neural Turing machines to, adaptive compute time, to a differential neural computers is he always backpropped through all of the recursion steps.

Speaker 1

而Alex之所以受限,就是因为反向传播要贯穿整个时间序列,模型根本没法做大。

And he was limited by backprop through time, so you can only make the model so big.

Speaker 1

你面临各种问题,比如梯度消失之类的。

You have all these issues, vanishing gradients, etcetera, etcetera.

Speaker 1

他们用的是一个叫DEQ的固定点迭代方法。

And what they do is they they kind of have this DEQ of method of doing fixed point iteration.

Speaker 0

听起来像是深度均衡模型。

Sounds like deep equilibrium

Speaker 1

均衡学习——这做法对搞计算机视觉的人来说完全反直觉,因为你根本不会这么干,但其实特别有道理,我来跟你解释为啥。

equilibrium learning where if I take a batch and this this is completely counterintuitive as a computer vision person because you'd never do this, but it actually does make sense and I'll explain why.

Speaker 1

如果我拿一批ImageNet或者CIFAR-10的数据,前向跑一遍,算出损失,反向更新权重,下一波我肯定换一批新数据。

If I take a batch of like ImageNet or CIFAR 10 and I forward pass through the model and I get some loss on a back prop and I update the weights, I would go get a different batch for the next one.

Speaker 1

但他们不是,他们就用这一批数据反复跑16遍。

But what they do instead is they actually do that 16 times.

Speaker 1

这么反复搞下来,你会发现残差越来越小,越来越稳定。

And so and as you do that, you actually can see the change in your residuals get less and less and less.

Speaker 1

这其实说得通,因为在RNN里,z_l和z_h是负责状态传递的——

And why it actually makes sense is because when in the RNN case, the z l and the z h, which are the carry, the task carry

Speaker 0

隐藏状态。

Hidden states.

Speaker 0

对。

Yeah.

Speaker 1

隐藏状态。

Hidden states.

Speaker 1

一开始全是零。

Start off at zeros.

Speaker 1

就是零。

Those are zeros.

Speaker 1

然后我们在这整个循环递归里走一遍,至少是那两个循环:TL 和 TH 这两步。

Then we go through this whole loopy recursion three the the the the at least the two loops, the two lower loops, t the the TL and TH steps.

Speaker 1

接着我只反向传播一次,就经过那两个模块。

And then I back prop just through the two modules, just once.

Speaker 1

我不用一直往回递归。

And I don't recurse all the way back.

Speaker 1

做一下 stop grad。

Do a stop grad.

Speaker 1

我就停在这儿。

I stop right there.

Speaker 1

然后有个很大的残差,我就不重置 z l 和 z h 了。

And then there's a huge residual and then I don't reset z l and z h.

Speaker 1

我会在携带状态或隐藏状态的另一个位置再做一遍。

I do it again at a different point in the carry or hidden Right.

Speaker 1

变量空间。

Variable space.

Speaker 1

所以实际上,每次都可以看作是不同的 batch,尽管输入的 x 完全一样。

And so one can actually look at it as like a different batch every time even though it's the same exact x's.

Speaker 0

是的。

Yeah.

Speaker 0

我理解的方式是,你递归的那16个步骤,其实是在构建一个 mini batch,只不过不是来自不同的输入,而是来自不同的记忆状态。

Like the way I kind of think about it is like the the 16 or whatever that you're recursing over, it's like constructing a mini batch not from different inputs, but from like different memory states basically.

Speaker 0

其实就是跨越这个隐藏层或者传递状态的内存访问。

It's like across this hidden or carry memory access basically.

Speaker 1

而且这个数学关系是成立的,确实管用。

And and that math holds and it works.

Speaker 1

当 ZL 和 ZL 的变化量、ZH 的变化量都趋近于零的时候,这完全符合 DEQ 的设定,对。

It follows DEQ directly in the event that the ZL and the delta in ZL and the delta in ZH go to zero Mhmm.

Speaker 1

但实际情况根本不是这样。

Which it actually just doesn't do.

Speaker 1

我们待会儿会讲 TRM,但 Alexia 已经证明了,这根本站不住脚,这数学方法根本用不上。

And so we'll get to TRM, but Alexia basically shows that it's just not the case and you can't actually apply this math.

Speaker 1

所以它能跑起来,原因就在这儿。

And that's why it's working.

Speaker 1

但这还远远不够解释它为啥能跑起来。

That's not sufficient support for why it's working.

Speaker 1

我们其实根本不知道它到底为啥能跑起来。

We actually don't know why it's really working.

Speaker 1

她发现其实可以一直反向传播到深层递归里,这个我们待会儿讲TRM的时候再细说,而且这么做真的能大幅提升性能。

And she figures out that you actually can back prop through all the way to the deep recursion, which we're going get into TRM in a and that actually improves performance much, much more.

Speaker 1

挺有意思的。

Interesting.

Speaker 1

明白了。

Okay.

Speaker 0

在聊TRM之前,关于这篇论文,我觉得大家对这个问题其实有好几种理解方式,对吧?就是他们怎么想到这个方法的,以及为什么这个方法有效或者无效。

So before we get into TRM, yeah, on this paper, I think there's a bunch of different ways people have looked at this, right, in terms of how they came up with it and then why this may or may not be working.

Speaker 0

一种说法是生物合理性。

One, it's a sort of bio plausibility argument.

Speaker 0

你知道的,我一般不太看重这种说法。

As you know, I'm usually not super keen on these.

Speaker 0

机器学习历史上老有人拿生物合理性当起点,结果后来发现,真正效果更好的反而是那些明显违背生物合理性的变体。

Think machine learning tends to have a long history of people starting with bio plausible arguments and then realizing that there's some variant of them that seems highly bio implausible that actually works better.

Speaker 0

你举个例子,对吧。

I think you have example Yeah.

Speaker 0

对

A

Speaker 1

经典啊,最早掀起这波深度学习热潮的论文就是AlexNet。

classic, the first deep learning paper that started this whole craziness is AlexNet.

Speaker 1

AlexNet里头有个挺有意思的小设计,叫什么局部响应归一化或者抑制之类的,就是说一旦某个神经元激活了,它周围就进入一个‘不应期’之类的。

In AlexNet, there's actually this funny little thing called like local receptive activation or depression or something like that, where like once this activation fires then like I have this like you know a refractory region or something like that.

Speaker 1

结果根本没用。

It actually doesn't work at all.

Speaker 1

根本用不着这玩意儿,后来VGG一出来,直接说:全删了。

And like it didn't work and you didn't need that and then VGG came out and said get rid of all that.

Speaker 1

就往深了做。

Just go deeper.

Speaker 1

三层。

Three.

Speaker 1

用三个三乘三的卷积堆起来,效果直接炸了。

And three by three comp and it actually just like outperforms dramatically.

Speaker 1

对。

Right.

Speaker 1

所以啊,你得这么搞,才能让论文被NeurIPS接收。

And so like this is like always the you need to do it to get accepted into NeurIPS

Speaker 0

没错。

and Yeah.

Speaker 0

完全对。

Totally.

Speaker 0

就是这么回事。

Totally.

Speaker 0

是啊。

Yeah.

Speaker 1

你才是这方面的专家,那你觉得什么是可生物降解的,什么不是?

You're definitely the expert here, but what do you consider to be bioplasable and what's not?

Speaker 0

我觉得很多机器学习的研究其实和神经科学领域的人干的活儿重合得挺多的。

Well, think that a lot of machine learning literature has overlapped a lot with people working in neuroscience.

Speaker 0

我觉得我们天然就会好奇大脑是怎么工作的,毕竟大脑就像一台超级厉害的计算机,干的活儿多得惊人,效率还高得离谱。

I think it is very natural for us to ask questions about how does our brain work because our brain is like an incredible instrument that does a ton of computing obviously and does it in a very shockingly efficient manner it seems like.

Speaker 0

所以长期以来,很多机器学习的研究都试图从人类思维中找灵感,想搞明白大脑是怎么运作的,然后把这些机制用到各种机器学习系统里。

And so a lot of machine learning resources for a long time sought analog from how we think to understand our brain to work and try to encode that in various machine learning systems.

Speaker 0

比如神经网络这个概念,名字就这么起的,因为我们觉得它大概是模拟了神经元的基本运作方式;还有那些激活函数,也是想模仿生物神经的一些特性。

So from the very basic concept of what a neural network is, it's called a neural network because we think it's some basic model for what a neuron is, How certain activation functions work are meant to be inspired by certain biological

Speaker 1

你觉得呢?

Do think

Speaker 0

这个问题问得好。

that's good question?

Speaker 0

其实吧,我们经常用生物可能性来激发灵感,但最后做出来的玩意儿,往往偏离了生物现实,跑到了一个更接近但其实不太可能在生物体内实现的方向——可偏偏效果还更好。

The thing about them is that often we use biopossibility to inspire us to come up with ideas, but we end up veering away from the biopossible to something adjacent to them that is likely bioimplausible, but that seems to work better.

Speaker 1

就是那种在GPU上跑得飞快的。

Something that runs better on a GPU.

Speaker 0

没错。

Exactly.

Speaker 0

在GPU上跑起来更快。

It runs better on a GPU.

Speaker 0

它在某些方面更高效,而这些效率恰恰跟我们实际在计算系统里实现它的方式有关。

It's more efficient in some capacity that is relevant to how we actually encode it in a computational system.

Speaker 0

我觉得琢磨生物可能性挺有意思,确实能激发我们去想一些新点子。

So I find thinking about bioplasibility fun and interesting and it's definitely a great way to inspire us to think about new things.

Speaker 0

但我自己在选机器学习方向的时候,一般不会被生物可能性捆住手脚——除非它只是个引人入胜的科学起点,能带我们深入探索。

But I tend to not be bounded by biopossibility when I think about what machine learning systems we should prioritize working on or think are as particularly exciting other than as an interesting scientific launching point for a deeper exploration.

Speaker 0

我觉得更让我着迷的,其实是之前咱们聊过的自动机理论那一块。

I think the version of this that I find more compelling is actually that original discussion we were having around automata theory basically.

Speaker 0

说白了,就是基础的数据结构和算法理论:当你跑一个复杂的算法时,有个内存缓存真的特别有用,能让你跑得更高效。

And honestly just actually like fundamental data structures and algorithms theory which is that if you're running a complex algorithm having access to sort of a memory cache is actually very useful for being able to run that algorithm efficiently.

Speaker 0

我总觉得这些隐藏状态或者记忆机制,就像图灵机的纸带,或者基数排序里的内存池,能让模型在一次前向传播里,聪明地使用这个缓存,从而实现原本需要更复杂操作才能达成的高效计算。

And I kind of think of this set of hidden states or carry as akin to a Turing machine tape or akin to the radix sort memory bank where you can basically train a model to use this memory cache in an intelligent way in a single forward pass so that you can get a more efficient time operation that would otherwise require some sort of more complicated

Speaker 1

推理。

reasoning.

Speaker 1

是的。

Yeah.

Speaker 1

我想之前想说的是,我们搞COT和工具使用,其实是为了突破GPT-2的局限。

Think the a point I wanted to make earlier is that like we did this COT stuff and this tool use thing as ways to get beyond the the the the of GPT two.

Speaker 1

所以我们是怎么做到的呢?我其实做过这个实验。

And so the way that we get We You can actually I've done this experiment.

Speaker 1

如果你给我无限多的无序列表和有序列表,只要我能做链式思考,能教它每一步怎么走,那它在测试时真的就能实现排序,变成一台图灵机。

You can actually If you give me infinite amounts of unsorted list and sorted list, if I can do chain of thought and I can do every single step and teach it to do every single step, then I can actually get it to do do sort and become a Turing machine at test time.

Speaker 1

同样,还有一个更简单、更容易实现的办法:你告诉它,嘿,Python里有个叫sort的函数。

And similarly, an even cheaper one that is much easier to do is you teach it and you say, hey, there's this Python function called sort.

Speaker 0

直接调用这个函数就行。

Just call the function.

Speaker 1

直接调用这个函数就行。

Just call the function.

Speaker 1

这可是最省事的办法,根本不需要反向传播。

And like, that's the easiest thing to do and you don't need back prop at all.

Speaker 1

所以这两种就是窍门。

And so those are the two hacks.

Speaker 1

现在,弗朗索瓦,这问题解决了。

Now, well Francois, this is solved.

Speaker 1

咱们完事儿了。

Like, we're done.

Speaker 1

对吧?

Right?

Speaker 1

不对。

No.

Speaker 1

因为我得知道什么是排序。

Because I needed to know what sort was.

Speaker 1

如果我们根本不知道归并排序该怎么办?

What happens if we didn't know what The merge

Speaker 0

链式思考不可能从零开始自己发现排序算法。

chain of thought is not going to inherently discover sorting from first principles.

Speaker 0

它是从模型训练时所学的所有历史知识中找出来的。

It's finding it from our historical knowledge of everything it's trained on.

Speaker 1

对。

Yeah.

Speaker 1

我的意思是,那些演示里头都提到过,终极考验其实是‘爱因斯坦测试’。

Mean, this is like the the demos had this whole thing about like the ultimate test is the Einstein test.

Speaker 1

就是回到1911年,看它能不能从头把现代物理重新推导一遍。

Like go back to 1911 and then like have it rebuild all the physics up until now.

Speaker 1

同样,咱们就假设我们只知道冒泡排序。

Similarly, let's just pretend that we only had bubble sort.

Speaker 1

别的排序方法一概不知道。

We knew other no other sort system.

Speaker 1

如果你只用冒泡排序的输入输出来训练它,它就只会冒泡排序。

If you chain of thought it on all the bubble sort input and output, it will only do bubble sort.

Speaker 1

而且连冒泡排序都未必能做好。

In fact, won't even do bubble sort that well.

Speaker 1

所以这是最理想的情况,工具只能知道冒泡排序。

Like so this is the best situation and then the tool use, of course, it can only know bubble sort.

Speaker 1

我想达到归并排序的水平。

I want to get to merge sort.

Speaker 1

那我该怎么发现归并排序呢?

How do I discover merge sort?

Speaker 0

我想强调一下,这点可能之前没说清楚:其实LLM里早就有一种人们熟悉的递归方式,就是我们之前说的思维链。

And I think the interesting thing just to emphasize here because it may not have been extremely clear is there already exists some type of recursion that people are used to in LLMs which is chain of thought we mentioned earlier.

Speaker 0

但这种递归发生在模型输出的词元层面,并不是模型本身固有的能力。

But that is a recursion that's happening in the token space of the model's outputs, not inherent to the model itself.

Speaker 0

这正是根本的限制——模型只能做前馈式的单次输出,我们只是靠一个‘作弊’手段:不断让它输出,再让它读自己的输出,假装能做出点聪明的事。

And that's sort of the fundamental limitation is that the model can only do a feed forward one shot output and then we basically just have this hack that if you keep letting it output things then it can read its outputs and do somewhat intelligent seeming things with it.

Speaker 0

但它的能力似乎被我们喂给它的数据上限卡死了,现在各大实验室都在疯狂抢购数据,对吧。

But it seems to sort of be upper bounded by the data that we feed it that, you know, the labs are very hungrily buying right now Yeah.

Speaker 0

而不是那种真正内在的、递归式的推理能力。

And not this sort of like inherent underlying recursive reasoning.

Speaker 1

是的。

Yeah.

Speaker 1

所以不管是用思维链还是工具调用,这两种方法都受限于人类已有的知识范围。

So in both cases, both hacks to solve this in COT and tool use, you're bounded by the bounds of human knowledge.

Speaker 1

一旦问题超出了人类知识的边界,那你就真没辙了。

In the event it's outside the set of human knowledge, then like you're kinda SOL.

Speaker 1

所以这是一点。

And so that's that's one.

Speaker 1

你提到离散空间和潜在空间的区别,这点特别到位。

The other you make a great point about discrete versus latent space.

Speaker 1

在离散空间里做推理,LLM 只能输出一个个具体的词,就像进位一样,必须强行映射回离散的词元空间。

Reasoning in a discrete it can only output the carry in the case of LLMs has to be snapped back to some discrete token space.

Speaker 1

而像 RNN 这类模型,它们一直保持在连续的潜在空间里,维度要高得多。

And in the case of RNNs in general, they remain in this continuous latent space which is much higher dimensional.

Speaker 1

假如给我一条这么长的带子,你把它切成十个格子,跟让它自由发挥所有可能的值相比——

If you give me like a tape that's this long and you cut it up into 10 buckets like versus all the possible values

Speaker 0

对。

Right.

Speaker 0

没错。

Exactly.

Speaker 0

是啊。

Yeah.

Speaker 1

连续空间的表现力强得多。

It's much more expressive to being continuous space.

Speaker 1

但我们没法这么训练,主要是因为反向传播在时间上的限制。

But we can't train it that way because we actually, you know, because you're inhibited by back prop through time largely.

Speaker 1

所以这篇论文才这么让人兴奋。

And this is why this paper is so exciting.

Speaker 0

明白了。

Okay.

Speaker 0

那在我们转到TRM论文之前,先总结一下。

So before we then go over to the TRM paper, let's just summarize here.

Speaker 0

在我们转到TRM论文之前,从HRM论文里最值得我们记住的关键点是什么?

What matters most from the HRM paper that we should take away before we transition and contrast them with the TRM paper?

Speaker 1

对。

Yeah.

Speaker 1

我觉得最重要的一点就是这个外层优化循环。

I think that the the number one piece to take away is this outer refinement loop.

Speaker 1

这个外层优化循环是可以扩展的,而且有非常清晰的分析。

The outer refinement loop scales and there's a a great breakdown.

Speaker 1

basically,Sapient团队——得给这篇论文点个赞,因为里面创新太多了——其实并没有对每个输入都做详细的规模消融实验。

Basically, the the Sapient authors, which is huge kudos for this paper because there's so many innovations in this paper, didn't really do like scaling ablations on every single one of the inputs.

Speaker 1

但Constantine,他在François Chaubard公司那边,就在印度,真的做了这项工作。

But this guy Constantine at Francois Chaubard's company, India, actually did.

Speaker 0

好。

Mhmm.

Speaker 1

他做了一个特别棒的分析,发在YouTube上,你去看看就知道了。

And it's this amazing breakdown that he put on posted on YouTube that you can go check out.

Speaker 1

但说到底,最关键的一点是,外部精炼循环才是这些东西效果这么好的核心原因。Alexia 其实也独立发现了这一点,她把它放大了,证明你可以把其他那些乱七八糟的东西全砍掉。

But basically, main takeaway is that the outer refinement loops is the main beneficiary is the main reason why these things work so well, which Alexia basically takes the she found, I think, in parallel and scales up and shows that you can get rid of a lot of all those other stuff.

Speaker 0

明白了。

Okay.

Speaker 0

就像很多机器学习领域那样,后续的论文基本上就是把第一篇论文删掉75%,就像我们以前视频里常做的那样,只留下最核心的魔法。

Like a lot of machine learning, the follow on paper is basically delete 75% of the first paper as we've often done in videos here and keep the magic basically.

Speaker 0

对。

Yeah.

Speaker 0

所以,好吧。

So okay.

Speaker 0

那这个魔法到底是什么?

So what's the magic then?

Speaker 0

在TRM论文里,真正关键的是哪一部分?

Like what's the part that actually matters in terms of what stays in the TRM paper?

Speaker 0

咱们现在来对比一下这两篇论文在架构上的核心差异。

And let's now contrast the core architectural differences between these two papers.

Speaker 1

是的。

Yeah.

Speaker 1

我觉得如果拆成两个主要部分,这个外部精炼循环确实非常有效,效果特别好。

So I think that I guess if I break it down into two major things, this outer refinement loop thing is really great and works really well.

Speaker 1

还有这个截断的随时间反向传播,其实就是普通的随时间反向传播,只不过我在某个较早的时间点就截断了。

And that this like truncated back prop through time, which is back prop through time except I truncate at some time Some earlier point.

Speaker 1

较早的时间点,对。

Earlier point Yeah.

Speaker 1

叫T-back。

Called t, t back.

Speaker 1

T等于1就已经完全够用了。

T equals one is actually is completely sufficient.

Speaker 1

所以截断到T等于1的随时间反向传播,完全够用。

And so truncated back wrap to time t equals one, completely sufficient.

Speaker 1

这听起来特别反直觉。

And that's very counterintuitive.

Speaker 0

这正是HRM发现的。

Which is what HRM found.

Speaker 1

HRM是这么做的,而TRM更进一步,不是只走一次h网和l网的调用,

Which way HRM found and TRM does a little bit further rather than going through just one call to the h net and the l net.

Speaker 1

它实际上完成了一整个递归循环。

It actually goes through one full recursion loop.

Speaker 1

比如我做16次,其实只要回溯一次就够了,效果就差不多了。

So if I do it 16 times, I just go back through one time and that is is is kind of sufficient.

Speaker 1

如果你用这种伪不动点迭代的方法,每一步都用梯度去修正,奇怪的是它真能跑通,而且在携带空间上批量处理也没问题。

And if you do it with this like fixed point iteration thing, pseudo fixed point iteration thing where you keep hitting it with a gradient at every single step, It like weirdly works and this batch size across the carry space Right.

Speaker 1

真的能行。

Like actually works.

Speaker 0

所以这部分,这两个模型都保留了。

So that part is also kept between these two models.

Speaker 0

对。

Yeah.

Speaker 0

另一个变化好像是,以前有这种高低层次思维的双层结构,现在没了。

It seemed like another thing that changed was having these this sort of double layer of like you know higher order thinking and lower order thinking.

Speaker 0

看起来现在被简化成单一层次了。

It seems like it collapsed that down into just a single one.

Speaker 0

这背后的直觉是什么?TRM论文里是怎么实现的?

What's the intuition there and how does that actually work in the TRM paper?

Speaker 1

对。

Yeah.

Speaker 1

挺有意思的。

So it's interesting.

Speaker 1

她其实做了个消融实验,对比了用两个独立网络和只用一个网络的效果。

She actually ablates having two separate networks versus just having one.

Speaker 1

我觉得更关键的是变量作用域:低层特征和高层特征都该有,但用同一个网络就够了。

I guess the more important space is the variable scope is that you should have low level features and high level features but the same network.

Speaker 1

所以表现最好的是

And so the best performing

展开剩余字幕(还有 246 条)
Speaker 0

同一个网络其实就能提取出这两类特征。

The same network can extract both basically.

Speaker 1

对。

Yeah.

Speaker 1

LNET 和 HNET 其实是共享权重的,就统称为 net。

You weight share between the LNET and the HNET it's just called net.

Speaker 1

你只用一层 transformer,而不是像 Sapient 那样用四层,直接简化成一层,做点迭代优化,但还是把 z l 和 z h 保持分开。

And and you do just one transformer layer versus the four like they do in in Sapient and just whittle it down to one and do more of a cursion and that but you keep z l and z h to be distinct and separate.

Speaker 1

她管它们叫 x 和 y,我真觉得这名字太绕了。

And she she calls it x and y which I found very confusing.

Speaker 1

Z x y z,这命名简直让人头大。

Z x y z which is very confusing.

Speaker 1

还不如直接叫 z h 和 z l,清楚多了。

And it's just like z h and z l is just cleaner.

Speaker 0

你要是读原文就会发现,y 其实就是潜在空间。

So if you read the paper y is actually like latent space.

Speaker 0

其实就是 z 这么回事。

It's it's like z basically.

Speaker 1

而且这根本不是什么标签。

And it is not a label.

Speaker 0

明白了。

Okay.

Speaker 0

这可真把我整蒙了,不过呢——

Which really threw me through But the

Speaker 1

我这儿先过一遍代码,带你一步步看。

anyway, so I will go through some code here and I'll walk you through it.

Speaker 1

我把她那一套命名全改了,用了 Sapient 的写法,对我而言清楚多了,也直接多了。

So I replaced all of her nomenclature and used the Sapient notation which is much cleaner and more straightforward to me at least.

Speaker 0

好,厉害。

Okay, cool.

Speaker 0

在咱们看代码之前,先说说这些 TRM 到底是怎么运作的,挺有意思的,因为这种递归结构现在给了你一堆 Transformer 没有的优势。

And now before we dive into code for a sec, like in terms of how these TRMs actually work, know, it's pretty interesting because this recursion advantage now gives you a bunch of advantages over transformers.

Speaker 0

不用搞几百层、上千层甚至上百万层的Transformer,也不用堆那么多参数,就能直接获得计算上的深度。

Rather than having 500 or 1,000 or a million or whatever transformer layers and having tons and tons of parameters you get compute depth basically without this parameter depth.

Speaker 0

整个优化过程更像是一种迭代式的期望最大化算法。

And the optimization process looks like more of like an iterative kind of like expectation maximization algorithm.

Speaker 0

你能聊聊TRM论文里这个机制是怎么实现的吗?

You wanna talk about how that worked in the TRM paper?

Speaker 0

因为我本来以为

Because I thought

Speaker 1

这个点也挺有意思的。

that was also pretty interesting.

Speaker 1

它们俩其实都有种类似的EME感觉,就是我们会根据输入x和z_h来更新z_l。

So both of them kind of have the same kind of EME feeling thing where like we update z l condition upon the input x and z h.

Speaker 1

对。

Yep.

Speaker 1

最后一个z_h。

Z the last z h.

Speaker 1

对。

Yep.

Speaker 1

比如说,Z h 的上一时刻。

Z h t minus one, let's say.

Speaker 1

然后我们不断更新 Z l,Z l,Z l,一遍又一遍地改。

And then we keep updating z l z l z l z l, and we keep updating it.

Speaker 1

接着我们根据 Z l 来更新 Z h。

And then we go holding we update z h condition upon z l.

Speaker 1

其实根本不用管 X,就只看 Z l 就行。

And actually it's just z l, it's not even x.

Speaker 1

然后直接更新 Z h。

And then we just update z h.

Speaker 1

你可以把 Z l 想成局部变量,一直在被覆盖、被更新、被更新。

And and the way to think about z l and z h is z l is like your local scoped variables that are just being overwritten and updating, updating, updating.

Speaker 1

至于 Z h,Azalea 提到过这一点,抱歉,Azalea。

And then z h and Azalea makes this point I'm sorry Azalea.

Speaker 1

亚历西亚也提到了这一点。

Alexia makes this point.

Speaker 1

这就是一个候选答案,一个潜在的答案,它和正确答案只差一个嵌入空间的距离,或者说是通过一次MLP查找就能逼近的答案。

That is that is a candidate answer, a proposed latent answer that is just an embedding space away, a one MLP lookup away from the true answer.

Speaker 0

所以你其实是在做类似EM算法的事情,只是稍微抽离一点来看。

So you're kind of like EM ing just to like zoom out a little bit.

Speaker 0

你是在同时最大化:在给定输出条件下,正确答案出现在你记忆中的概率;以及在你记忆中存储的信息条件下,输出正确结果的概率。

You're kind of maximizing the probability of the correct, you know, stored in your memory conditioned on a given output and maximizing the right output conditioned on the information stored in your memory quote unquote in parallel.

Speaker 0

而这种优化算法最终会让你学会一种递归方法,把正确信息存到这个局部记忆里——没错。

And like that optimization algorithm leads to you ultimately learning a recursive method that stores the right information to this local memory basically Yeah.

Speaker 0

然后输出正确的内容。

And then outputs the right thing.

Speaker 1

如果我们真拿数独来想,这其实特别自然地解释了底层到底发生了什么——数独就是一个不完整的谜题。

It really like if we actually think of sudoku, it's actually a really natural way to think about what's actually happening under the hood where sudoku is an incomplete puzzle.

Speaker 1

你不可能一次就猜出所有格子。

You can't guess every cell at any one time.

Speaker 1

其实它的设计就是让你一次只能猜一两个格子,对吧。

You can actually, it's designed where you can only guess one or two cells Right.

Speaker 1

得靠现有的信息来推断。

Based on the available information.

Speaker 1

所以这根本不是个能压缩的问题。

So it's not it's an incompressible problem.

Speaker 1

如果你光靠瞎蒙,蒙了又蒙,那组合空间大到没法算。

You actually can't do it unless you're just randomly guessing and guessing and guessing, which is a very high combinatorial space.

Speaker 1

所以ZL的做法是:试试这个,再试试那个,做点计算,想想小细节,然后提个猜测,再根据它可能发现的东西去调整,传给ZH,ZH一填,局面就多了一点进展,然后——

And so what, the ZL is doing is is some type of let me try this, try that, do some computation, think about little things and then it proposes and then we go to condition upon like something that it may have found, it sends it to z h, z h fills it in and now we have a little bit more of a filled in pseudo And

Speaker 0

训练过程就是在教这个算法该这么干。

the training process is training the algorithm to know to do that.

Speaker 0

对吧?

Right?

Speaker 0

它其实是在优化一种策略:你存下的这些信息,越能导向正确的结果。

It's like it's maximizing that it's like oh this strategy for what you save tends to lead to correct outputs.

Speaker 1

没有推理过程。

Without chain of thought.

Speaker 1

没有推理才是最关键的。

Without chain of That's the most important part.

Speaker 1

这就像是,如果我们玩数独,却根本不会解,就只是个不懂数独的普通人类。

It's like, if we had Sudoku and we know how to solve Sudoku because like we were just, you know, dumb homo sapiens that didn't know how to solve Sudoku.

Speaker 1

是的。

Yeah.

Speaker 1

它自己就直接解出来了。

Like it would just have solved it.

Speaker 1

所以这才厉害,它真能不靠一步步引导,自己发现解法。

And that's why it's cool because it actually is able to discover things without being teacher forced via a chain of thought.

Speaker 1

对。

Right.

Speaker 1

挺有意思的。

Interesting.

Speaker 0

是的。

Yeah.

Speaker 0

我们看看代码吧?

Should we look at some code?

Speaker 1

好啊。

Let's do it.

Speaker 0

行。

Okay.

Speaker 0

咱们直接切入主题吧,我想看看这些论文或模型的核心思想被提炼成什么样了。

Let's dive in and I would love to see what these papers or models look like just distilled down to their core essence.

Speaker 0

我知道训练细节很多,但关键是那个核心训练算法,最好能对比一下这两种方法。

I know there's lots of details on how you train them, but kind of the core training algorithm, it'd be great to contrast the two methods.

Speaker 1

对。

Yeah.

Speaker 1

其实它们非常相似。

So, I mean, they're remarkably similar.

Speaker 1

所以本质上,一个在学习,另一个也在学习。

And so largely one is and learning one is learning the other.

Speaker 1

一开始,你设 z h 和 z l 都为零。

But basically, you start out with some z h and z l that are just zeros.

Speaker 1

对。

Yep.

Speaker 1

你有一个输入嵌入空间。

You have some input embedding space.

Speaker 1

我们从原始的 x 变成 x,也就是迷宫的初始状态,或者 whatever 它是。

We go from x raw to x, which is the maze state or whatever it is, initial maze state.

Speaker 1

然后在不计算梯度的情况下,这部分不会反向传播任何梯度。

And then with no grad, you don't pass any gradients back through this.

Speaker 1

你所以

You So

Speaker 0

这其实就是关键所在。

this is the trick basically.

Speaker 0

这其实是一种挺特别的反向传播,还是按时间展开的。

It's an odd back prop back prop through time.

Speaker 1

这是三个递归层级里的两个。

Here are two of the three recursion levels.

Speaker 1

他们这么搞纯粹是为了简化,但我其实会反复调用 z l,每次 t 低的时候都跑一次。

So you have this is like the the the they do this just for for for simplicity, but I hit z l t low times.

Speaker 1

然后每到 t 低的模数点,我就更新一次 z h,再重复一遍,循环往复。

And then once for modulo t t low, then I hit the z h, and I do it again and again.

Speaker 1

就像你说的,我是根据 z h 和 x 来更新 z l 的。

And like you said, I'm updating z l condition upon z h and x.

Speaker 1

对。

Right.

Speaker 1

接着我再根据 z l 来更新 z h。

And then I update z h condition upon z l.

Speaker 0

没错。

Right.

Speaker 0

所以这其实就是期望最大化那种风格,没错。

So this is the like expectation maximization style Exactly.

Speaker 0

这种做法。

Approach.

Speaker 1

对。

Yeah.

Speaker 1

其实你根本不需要这个。

And then you don't really need this.

Speaker 1

这纯粹是为了整洁,清楚地表明这条线以上没有梯度通过。

This is like just for cleanliness to show clearly that there's no gradients occurring above this line.

Speaker 0

就是把那之后的权重都冻结住。

Just freezing the weights past that.

Speaker 1

没错。

Exactly.

Speaker 1

然后我再跑一遍 L net 和 H net,接着

And then I hit L net and H net one more time and then

Speaker 0

这跟上面说的是一回事。

Which is the same thing as up above.

Speaker 0

所以这就没什么问题了。

So this is just Okay.

Speaker 0

其实就是让不计算梯度的部分再跑一遍。

It's literally just the no grad thing running one more time.

Speaker 0

没错。

Exactly.

Speaker 0

太好了。

Cool.

Speaker 1

是的。

Yeah.

Speaker 1

再明确一点。

And just make it really clear.

Speaker 1

这样就搞定啦。

And then there you go.

Speaker 1

这就是你的HRM模型了。

And that's your HRM model.

Speaker 0

不错。

Cool.

Speaker 1

而且他们

And they

Speaker 0

这个用起来挺简单的。

That's use quite simple.

Speaker 1

两个两个两个加两个就完全够了。

Two two two and two is completely sufficient.

Speaker 1

如果你真往上加太多,康斯坦丁早就明确说过,根本没用。

If you actually go much higher, the Constantine showed very clearly that it doesn't actually help.

Speaker 0

那这就是三次递归里的两次了。

So that's two of the three recursions.

Speaker 0

你说第三次是在

You said the third happens in the

Speaker 1

是在训练循环和测试循环里进行的。

is in the train loop and at the test loop.

Speaker 1

两者都有这个m次测试或n次监督,亚历克西亚称之为深度监督。

They both have this m test or n supervision, which Alexia calls deep supervision.

Speaker 1

他们管这叫加法精炼步骤。

They call it adder refinement steps.

Speaker 1

叫啥都行,反正怎么叫都行。

It's just whatever you want to call it, call it ends up.

Speaker 0

所以训练时你得重复这个操作这么多次,而测试时有个不同的超参数,控制每个模型递归多少次,就是m等于10。

And so you do this ends up times during training, and then during test time there's a different hyper parameter for how many times it recurses over each model, which is m 10.

Speaker 0

其实它们是一样的。

They're actually

Speaker 1

是一样的。

they're actually the same.

Speaker 1

明白了。

Okay.

Speaker 1

所以这些,其实我们完全可以把它统称为同一个东西。

And so these this and this we can probably just call this the same.

Speaker 1

对。

Yeah.

Speaker 1

而且它本质上就是一样的。

And but it's it's it's the same.

Speaker 1

而且Constantine在这方面做得挺到位的。

And if you actually Constantine does a good job of this.

Speaker 1

如果你训练时用16次,测试时只用1次,性能也能达到将近八成,几乎没什么损失。

If you actually train on 16 and you test on only one, you get like seven eights of the performance almost all the performance.

Speaker 1

所以其实挺有意思的,这玩意儿算得太多,真正带来的提升却没多大。

So it's actually quite interesting that this is just overdone too much compute and it doesn't actually help you all that much.

Speaker 1

所以把它设成1其实就挺好的。

So setting this to one is actually like

Speaker 0

但对更复杂的问题来说,测试时多算几次应该还是有帮助的,这大概就是为什么你要这么设置吧。

But presumably for like more complicated problems, having more test time compute is still useful is like the reason you would set it up this Yeah.

Speaker 1

当然。

For sure.

Speaker 1

所以我们用HRM,算出损失后,只对这里这两部分做反向传播,然后更新一步,清空梯度,但不会更新 z h 和 z l。

And so we call our HRM, we get some loss, we back prop through just the those two little parts here, and then we step, we zero out the gradient, but we do not update z h and z l.

Speaker 1

它们还是保持原样。

These are still the same in it.

Speaker 1

这点特别关键。

So that's the really important detail there.

Speaker 1

对。

Right.

Speaker 1

然后我们再把上一轮的 z h 和 z l 重新传进去。

And then so we go back, pass in the z h and the z l from the previous one.

Speaker 1

所以这次其实不是同一个批次了。

So now this is actually not the same batch

Speaker 0

对。

Right.

Speaker 1

因为我们已经更新了 z h 和 z l。

Because we have updated z h and z l.

Speaker 1

所以现在处于潜在空间的不同区域。

So it's in a different part of the latent space.

Speaker 0

太棒了。

Cool.

Speaker 0

对。

Yeah.

Speaker 0

这其实就是通过内存空间构建小批量的关键思路。

And that's the key like mini batch construction through memory space

Speaker 1

没错。

Yeah.

Speaker 0

概念。

Concept.

Speaker 0

对。

Yeah.

Speaker 0

不错。

Cool.

Speaker 0

没错。

Exactly.

Speaker 1

到了测试阶段,其实就是三个循环。

And then at test time, it's simply the three loops.

Speaker 1

首先是外层的优化循环,训练时递归确实挺关键,但测试时递归反而没那么重要,对。

So there's your outer refinement loop, which turns out like just at train time train time recursion was important, but test time recursion was actually not that important Yeah.

Speaker 1

这还挺反直觉的。

Which is kinda kinda counterintuitive.

Speaker 1

而HRM内部则包含另外两个循环。

And then the HRM inside that has your two other loops.

Speaker 1

明白了。

Makes sense.

Speaker 1

就这样了。

And and that's it.

Speaker 1

所以挺简洁的

So pretty

Speaker 0

很简单。

simple.

Speaker 0

现在呢

Now

Speaker 1

这里主要就两个改动:他们把 LNET 和 HNET 合并成了一个 net。

that's the only two changes, the main two changes here is that they collapse LNET and HNET into just net.

Speaker 1

太好了。

Great.

Speaker 1

而且这是个关键细节。

They and it's important detail.

Speaker 1

这是四层 Transformer。

These are four transformer layers.

Speaker 1

这里是四层 Transformer,这边就只有一层。

This is four transformer layers and this is just one transformer layer.

Speaker 1

亚历克西其实发现,加深网络并没有带来好处。

And Alexi actually shows that going deeper actually didn't help.

Speaker 0

对。

Yeah.

Speaker 0

而且在一些测试里,只用前馈网络,效果跟Transformer一样好。

And actually on some tests, it was just the feed forward and that actually worked just as well as a transformer there.

Speaker 0

是吧?

Right?

Speaker 0

比如在数独任务上。

It was like on Sudoku

Speaker 1

数独的MLP模型表现居然超过了Transformer。

Sudoku MLP actually outperformed the the tension.

Speaker 1

它在迷宫任务上得了零分。

It was it could scored zero on the maze.

Speaker 1

MLP在迷宫任务上也是零分。

The MLP scored zero on the maze.

Speaker 1

所以这一点还不清楚。

And so there's it's not clear.

Speaker 1

Transformer 并不总是更优,这并不明显。

It's not obvious that the transformer is always better.

Speaker 1

所以有权重共享,但不是只回传一两步,而是直接通过一个潜在递归步骤完整地反向传播。

So there's the weight sharing and then instead of going back just the one two, the h this back propping through just these two, you actually back prop through one latent recursion step all the way through one latent recursion step.

Speaker 1

我来简单捋一下这个过程。

So let me just walk through this a little bit.

Speaker 1

所以这里的情况也是一样。

So we have the same thing here.

Speaker 0

起点是一样的。

Same starting point.

Speaker 0

对。

Yeah.

Speaker 1

这里主要也是同样的情况。

It's mainly the same thing here.

Speaker 1

我们这里要重复六次。

We're doing this six times.

Speaker 1

然后再做一次,接着进入深层递归。

And then we we go one more time here and then we do our deep recursion.

Speaker 1

这个外层循环总共会跑六轮。

This is the outer loop ends up times.

Speaker 1

所以 again,我们还是用 no grad 和 detach,但这里就不一样了。

And so again, we have the no grad, we have the detach, and then this is where it's different.

Speaker 1

所以我在 detach 之后把这个叫作潜在递归。

So I I am calling this latent recursion after the detach.

Speaker 0

对。

Yeah.

Speaker 0

也就是说,完整地跑了一次递归循环,没错。

So it's one full recursive loop is happening yeah.

Speaker 1

所以这就是优化里的关键区别。

And so that's the main difference in the optimization.

Speaker 1

其他地方都一样。

Otherwise, it's the same.

Speaker 1

然后输出结果,搞定。

And then it outputs and then you're good to go.

Speaker 1

训练的时候也跟之前完全一样。

And you train it exactly as the same way before.

Speaker 1

到了测试阶段,还是老样子。

And then at test time, it's the same thing again.

Speaker 1

所以大体上没啥区别。

And so largely the same.

Speaker 0

太棒了。

Cool.

Speaker 0

从很多方面来看,这其实是个简化版。

And so in many ways it's sort of a simplification.

Speaker 0

对吧?

Right?

Speaker 0

你把其中一些部分给合并了。

You're collapsing certain parts of it.

Speaker 0

你把这个网络结构简化了。

You're simplifying this net architecture.

Speaker 1

对。

Mhmm.

Speaker 0

不过在时间反向传播这部分,稍微复杂了点,因为你现在要反向传播的路径比以前更长了。

It's slightly more complicated along this backpack through time this back backprop through time part because you're actually backpropping through more than you did before.

Speaker 0

没错。

Right.

Speaker 0

其实就是从第一个版本里吸取经验,然后把大部分东西都简化了。

But it's like taking a bunch of lessons from the first one and basically simplifying most of it.

Speaker 1

这其实也正是她需要把模型变小的原因。

Which is actually why she need I think is why she needs to make the model smaller.

Speaker 1

所以HRM这个模型有两千八百万个参数。

And so it's a 28,000,000 parameter model for HRM.

Speaker 1

现在她把模型压缩到了七百万参数。

Now she brings it down to a 7,000,000 parameter model.

Speaker 1

准确地说,从70%提升到了87%,

Actually gets from 70% to 87% on

Speaker 0

对,

Right.

Speaker 1

在我们的Price One上表现很好,Price Two上也做得不错。

On our price one and and does actually quite well on our price two as well.

Speaker 1

所以呢,

And so yeah.

Speaker 1

她把模型缩小了三四倍,

So she makes the small the model model, you know, three four times smaller.

Speaker 1

但因为用了递归结构,效果反而更好。

But because it has that recursion, it it actually outperforms.

Speaker 1

有一位叫梅兰妮·米切尔的研究者,写过一本书,讲的就是这种现象——变大不是提升性能的必要条件,增加递归也不是非得不可。

And there is one there's this researcher named Melanie Mitchell that writes this book talking about this very phenomenon, is like it is sufficient not necessary to go bigger and get better performance and it is sufficient and not necessary to to add more recursion.

Speaker 1

对。

Mhmm.

Speaker 1

所以我特别期待的是,如果你把这两者结合起来,会发生什么?

And so where I'm really excited is what happens if you do both.

Speaker 0

对。

Right.

Speaker 1

但你还是会受限于时间反向传播。

And you're still limited by back prop through time.

Speaker 1

就连Alexia在内存层面,也肯定受限于最后一环的时间反向传播。

Even Alexia is is limited by back prop that last step from a memory perspective for sure.

Speaker 1

所以如果你能把模型做得特别大,再配上大量递归,又不用时间反向传播,那就能把这种技术的所有优势,和巨型大模型的所有优势全结合起来,到时候就能搞出些惊人的东西来。

And so if you can make the model really big and you have lots of recursion and we do something else other than back prop to time, then we can get exact all the benefits of this and all the benefits of the giant LLMs and then you can get some crazy stuff.

Speaker 0

那咱们最后收个尾,聊聊更大的图景吧?

So now to wrap up, why don't we talk a little bit about the bigger picture?

Speaker 0

这对AI研究领域意味着什么?

What does this mean for the field of AI research?

Speaker 0

那人们该怎么看待这些模型在当前研究格局中的位置呢?毕竟它们和大家平时听说、甚至日常用到的那些方法相比,明显有点不一样。

How should people think about where these models fit into the current span of research happening, especially given that it seems like a bit of a departure from a lot of the methods that people are used to hearing about and increasingly seeing products that people use?

Speaker 0

对。

Mhmm.

Speaker 1

我觉得,从施密特和胡伯的论点,还有我们今天聊的这些来看,递归很重要,而且它不会消失。

Well, I think for one, this from the arguments that Schmidt Huber makes and that we've talked about today, recursion is important and it's not going away.

Speaker 1

很明显,把递归加进模型里确实带来了实实在在的好处。

And it clearly, the benefit is here of adding recursion into models.

Speaker 1

你已经看到像谷歌推出的递归语言模型了,那些东西相当强大,也很酷。

And you've seen things like the recursion language models out of Google that are are pretty powerful and cool.

Speaker 1

所以这一块,我觉得短期内肯定不会消失。

And so that's that's definitely one piece that's I don't think going away anytime soon.

Speaker 1

接下来是这种加法优化循环,就是类似 BTT、T=1 这种截断的反向传播时间方法。

The next one is this adder refinement loop like back t t b t t like t equals one, truncated back wrap through time t equals one.

Speaker 1

我觉得这个想法特别厉害,而且它效果这么好,我们其实还没真正深入探索过,也没完全搞懂背后到底发生了什么。

I think that that is a really powerful idea and the fact that that works so well, we have yet to really explore that extremely really understand what's happening there.

Speaker 1

第三点是,我们知道递归确实有效。

And then the third is that idea of like, okay, we know that recursion works.

Speaker 1

我们现在有那些超小的递归模型,才七百万参数,就能解决

We have these tiny recursive models that are 7,000,000 parameters that can solve

Speaker 0

真的很小的问题。

Really small.

Speaker 0

一个

A

Speaker 1

一亿、一百亿、一千亿,对,就是这个量级。

100,000,000, 100,000,000,000, 100 Yeah.

Speaker 0

可能十亿就够了。

Probably a billion.

Speaker 1

一个万亿参数的模型,训练数据是整个互联网,结果反而输给了只有七百万参数的模型。

A trillion parameter model can solve trained on the entire Internet and a 7,000,000 parameter wins.

Speaker 1

所以正确的做法应该是,抓住这里的亮点,再结合那边的亮点——这些优势可能已经在Gemini里,或者至少部分存在了。

Like the right answer is to like take the amazingness here and take the amazingness here which probably is already in Gemini already or some of these these it might be at least in some part.

Speaker 1

但如果你能把这两种TRM和那些巨型模型的优势结合起来,真正把它们融合在一起,我觉得这事儿肯定会爆发,规模会大到超乎想象。

But when you when you take the benefit of both these TRMs and these giant models and you actually slam them together, I think that it's just gonna take off and it's gonna be really huge.

Speaker 0

对。

Yeah.

Speaker 0

TRM和HRM特别有意思的一点是,它们都不是通用模型,对吧?

One of the things that's really interesting about these TRMs and HRMs is they're not general purpose models, right?

Speaker 0

这些模型都是为特定任务设计的,对吧?

These were task specific models, right?

Speaker 0

专门训练来解数独的模型,天生就做不了ARC竞赛题,必须专门用ARC的数据集再训练一遍才行。

The model trained to do sudoku cannot do ARC Prize inherently, it has to be trained on the ARC Prize set to do so.

Speaker 0

而用来做这些任务的大型语言模型,本质上是通用模型,最多再加点微调数据或者上下文学习的数据来适应具体任务。

Versus the LLMs that are used on these tasks are general purpose models that maybe get some additional fine tuning data or in context learning data on those tasks.

Speaker 0

所以我觉得,真正的交集可能在于:能不能做出更通用的智能体,像现在基于下一个词预测的算法那样通用,同时还能做更复杂的推理来达成目标。

And so I think that's where the interesting overlap might come is if you can make these more general purpose agents that can somehow be general purpose in the way that the sort of next token prediction algorithm has given us and do more complex reasoning to achieve that.

Speaker 0

看起来,我们完全可以用更高效的架构来实现大规模的推理能力。

It seems like you can have really efficient architectures to do scale up reasoning.

Speaker 0

对。

Right.

Speaker 1

很多人觉得,LLM 的厉害之处在于它能找出特别棒的嵌入表示空间。

And like a lot of the view of what these LLMs are doing is finding really amazing embedding representation spaces.

Speaker 0

没错。

Yes.

Speaker 0

但是……

But

Speaker 1

而在这个空间里做推理,其实做得并不多。

reasoning inside that that space is actually not done all that much.

Speaker 0

是啊。

Yeah.

Speaker 0

一直都是通过词元空间来做的。

It's it's always through the token space

Speaker 1

词元空间。

token space.

Speaker 1

所以你可以想象,我们找到了一种从token空间或者从像素图像映射到潜在空间的方法。

And so like what you can imagine is we found mapping from token space or from vision from pixels.

Speaker 1

在这个潜在空间里,各种东西的语义区分得特别清晰,这样一来,下游任务处理起来就轻松多了。

Some really cool latent space where like things are just nicely semantically separated and we can, you know, makes it really easy for downstream task to do.

Speaker 1

但要是能在这样的空间里,用一些超小的推理模型,加点递归机制,专门训练这些小模型来做推理,我觉得这招肯定能成。

But now in that space use this like tiny reasoning models, use some some type of recursion inside that and train those those those that model on that a little small model on that reasoning I think that's gonna really gonna work.

Speaker 0

弗朗索瓦,太感谢你把这一切讲得这么清楚了。

Francois, thanks so much for breaking it all down for us.

Speaker 0

咱们下一期《解码》再见。

See you all in the next episode of Decoded.

Speaker 0

谢谢。

Thank you.

关于 Bayt 播客

Bayt 提供中文+原文双语音频和字幕,帮助你打破语言障碍,轻松听懂全球优质播客。

继续浏览更多播客