What MCTS really teaches us about RL, LLMs, and 10 layers of compute
Eric Jang 在 sabbatical 期间用大约 10K 美元 + Claude Code 重新实现了 AlphaGo, 在和 Dwarkesh 的对谈里把 MCTS 拆到底——为什么它不是 credit assignment、 为什么它比当下 LLM RL 优雅得多、以及 10 层网络居然能把一个看似 intractable 的搜索问题塞进一次 f…
当年 DeepMind 的"几百万美元 + 一整队研究员",今天 LLM 编程辅助下,a few thousand dollars of rented compute 就够了。
不是 credit assignment,不是策略梯度——而是给每一步重打一个更好的标签,然后做 supervised learning。
LLM RL 是 sucking supervision through a straw。AlphaGo 永远不需要从 0% 成功率起步。
"一个看似非常困难的问题,可以塌缩到一个非常简单的宏观仿真里"——这才是 AlphaGo 最深的洞见。
Andy Jones 2021 年的 board-games scaling laws,是后来 LLM 推理时间扩展的原型。
能:超参搜索 + 做实验。不能:从一条死路里跳出来"换个思路"。
Sabbatical · 业余项目:用现代硬件 + Claude Code 复刻 AlphaGo
项目代码:github.com/ericjang/autogo
VP of AI @ 1X Technologies · 人形机器人
Senior Research Scientist @ Google DeepMind Robotics
"It was just profound to see ... how smart AI systems could become."
围棋长期被认为是 search-intractable 的问题,但深度学习一把就破了。
而最神秘的是:"a 10 layer network can sort of amortize the simulation of something so so so deep in the game tree."
经典论证:
"it's just far more than the number of atoms in the universe."
计算机科学家曾长期认为:本世纪内不可能用搜索解决围棋。
搜索空间的breadth(每层选择多)与 depth(每局太长),
两者都得砍。
每个 node 存四个东西:
N (visit count) — 从 parent 走到这里走了几次
Q (mean action value) — 在这里平均最终能赢吗?
P (prior policy) — 来自 policy net,"先验觉得这步好不好"
children — 链表式指针
"This was what Claude 4.6 wrote for me when I asked it
and it was a very reasonable choice."
不像 tic-tac-toe 那样可以完整展开 9!——围棋的搜索树必须稀疏,只往看起来 promising 的方向长。
argmaxa [ Q(s, a) + c · P(a) · √N / (1 + Na) ]
Q = 这条分支历史模拟的平均胜率
"已经知道这里好不好。"
Na 越小这项越大;
visit count 还少的分支会被强行多看几眼。
"as over time you will move from the argmax being dominated by this exploration term ... to the argmax being dominated by the Q term."
随着搜索深入,"被 exploration 项主导"过渡到"被 Q 项主导"。
① Selection — 沿当前树用 PUCT 一路 argmax 下到 leaf
② Expansion — leaf 不是终局?跑一遍 policy net,把它的 children 全部生成出来
③ Evaluation — value net 给每个新 child 估一个 v(s);不需要真的下到终局
④ Backup — 把估值沿路径反推回 root,更新每个节点的 Q
每走一步棋跑 200–2,048 次 simulation;
AlphaGo Lee vs 李世石那场用了 tens of thousands of simulations per move。
终局太远——你不可能为每个 simulation 都搜到 300 步深。
human glances at the board and they know "I'm probably going to lose"
人脑里有一个隐式 value function,"在 a few seconds without actually playing every single game logically" 就给出判断。
"this gives us a hint that ... in games like Go there are ways to basically radically speed up the search process."
而且这种"压缩"远比想象中神奇——
"a 10 layer neural network pass ... 10 steps of neural network paralyzed distributed representation thinking is able to amortize and approximate to a very very high fidelity a nearly intractable search problem."
单个 logit:从这个 state 出发,我赢的概率是多少?
对 361 个落点的 softmax:哪些走法看起来不错?
架构选择基本不重要:ResNet 和 Transformer 都能 work。Eric 实测在小预算下 ResNet 反而比 Transformer 略好——因为它的局部卷积归纳偏置正好契合围棋的局部攻防。
AlphaGo Lee 用两个独立网络;后续所有论文合并成共享 backbone + 两个 head。"presumably this saves compute."
先用 KataGo 的开源模型做 best-response training——拿一个已经很强的对手当陪练,自己的网络从一个"勉强能跟"的状态出发。
然后再尝试 tabula rasa(AlphaGo Zero 风格、从零自博弈)那一套。
"init in initialization is everything."
"always pick something that works and then get it to do something better rather than start from something that doesn't work at all and then try to make it work."
把研究问题初始化到尽可能接近成功的状态,再从那里 push improvement。
"always want to initialize your research project to something as close to success as possible."
→ 对应到 LLM 时代:
横轴是 simulation 次数:
核心 trick:把蓝线相对红线的提升,蒸馏回 policy net。
"distill this MCTS policy network back into your sort of shoot from the hip policy network"
下一轮的 policy net 起点就更高了——MCTS 再爬一段更高,再蒸馏回去。
一个稳定单调的 boostrap loop。
训练 policy net 去预测 MCTS 选出来的那一步(one-hot label)。
预测 MCTS 的整个访问分布(soft labels)。
"you don't train the policy network to imitate the MCTS action you train it to imitate the MCTS distribution"
"the entropy of this distribution is far far higher than the one-hot. So there's actually way more information ... in bits per sample in a soft label."
"Monte Carlo tree search is doing something very fundamentally different which is it's not trying to do credit assignment on wins. It's trying to improve the label for any given action you took."
"for every action we took, we did a pretty exhaustive search ... to see if we could do better"
"the problem with go and chess is that the other player is always trying to do some [thing]"
对手总会让你漂出"最优轨迹"。鲁棒训练的关键不是只见过 optimal states,而是知道 从一个 drifted state 怎么走回来。
Replay buffer 该长什么样:
真正的 off-policy 灾难:训练数据全是 policy 根本不可能到达的状态——浪费 capacity,越训越差。
两个实力 50/50 的策略 πA、πB 互打 100 局,每局 300 步:
"this thing you're saying ... would be intractable and prevents you from actually getting beyond a certain level in Go is just by default how LLMs are trained."
LLM RL 之所以勉强 work 是因为 sample 数量足够大、advantage estimation 替你做了 baseline 减法——但这是用堆量换信号。
"sucking supervision through a straw"
"To get the supervision through a straw. Uh basically just upgrade all the tokens in a trajectory that might or might not have been relevant to getting the answer right."
把 LLM RL 极端拆解:
早期训练:
"the problem is you spend most of training in this regime ... in the low pass rate regime." — "a sort of depressing plot."
"you never have to initialize at a 0% success rate and solve the exploration problem of how to get a non-zero success rate. And this is what allows you to hill climb this beautiful supervised learning signal."
MCTS 在任何 policy(哪怕乱猜)上都能给出比当前 policy 更好的动作。
"supervised learning problem on improved labels"
没有 TD error、没有 PPO clip、没有动态规划——就是 KL min + 二分类。
"You can train like as big of a network as you want ... everything will just go stably."
⚠️ 前提:value function 必须靠谱。Eric 推荐先用 expert data 或 KataGo selfplay warm-up value head——chain of assumptions 里最容易塌的一环。
"there's something to it that ... is very disturbing where like what felt like a very hard problem can fall to a very very simple macroscopic simulation."
10 层网络 ≈ 10 步顺序推理
却能把一个搜索意义上 intractable 的问题,压进一次 forward pass。
→ AlphaFold 也是同一种现象:本来要跑天量微观模拟,结果一个不大的网络一把搞定。
Eric 的猜想:
"our understanding of problems like P equals NP or these very fundamental computational hardness problems are incomplete."
Worst case 的 NP-hardness 不代表平均场景的硬度——大部分实际问题是有结构、可摊销的。
围棋 / 天气 / 蛋白质折叠都对初始条件极端敏感——一个石子位置不同,整个未来全变。
但我们关心的从来不是"未来 100 步的精确棋盘",而是谁会赢、飓风去哪、蛋白怎么折。
"sometimes we don't necessarily care about the microscale things. We actually care about the macroscopic structure."
Lorenz attractor 单点轨迹不可预测,但整个吸引子有形状。Eric 说:"you have the maximum power of a neural network at the edge of chaos."
"Scaling Scaling Laws with Board Games" · 2021
Test-time compute ↔ training compute 可以互换:
可以从小棋盘外推大棋盘所需的 compute——这是 LLM 之前就出现的"scaling laws 跨规模迁移"案例。
"you actually have to make a strong gobot first and then use the scaling laws to kind of extrapolate."
Eric 一开始踩的坑:带 bug 的系统上研究 scaling 没意义——先得让东西真的 work。
后来 LLM 的 test-time scaling(CoT、推理模型)几乎是这个发现的直接续作——只不过载体从 MCTS 换成了语言里的思考链。
"The compute required to be the first to do something is always like much larger than the compute it takes to catch up."
3e23 FLOPs
整整一个 TPU pod
"way more compute than any other AI model at the time"
40× 算力压缩
开源代码
Jane Street 的 David Woo 主导
~$10K · Prime Intellect 赞助
4K 探索 + 3K 最终训练
"a few thousand dollars of rented compute"
任何 compute multiplier 都是 transitory 的:
三年后 NVIDIA 出更快的卡,
你今天精心设计的 trick 大概率就废了。
研究品味 = 知道 bitter lesson 现在能买你多少东西,以及什么时候不能完全依赖它。
超参搜索:不只是 grid search,而是开放式探索——
"I've identified that the gradients are kind of small on this layer so let me change it up here, let me rewrite the code so the data loader has a new augmentation."
像一个会 grind 性能指标的初级博士生 ("grad studentlike")。
执行实验:Eric 写了一个叫 experiment 的 Claude skill——给坐标轴和目标,自动跑、画图、写报告、推测原因。
不擅长 lateral thinking:在一个 track 上一头扎到底,不会停下来问"是不是这条路本身就走不通"。
"they don't seem to be able to kind of step back and do the lateral thinking ... like wait a minute this track doesn't really make sense."
很多 infra bug 是 Eric 自己手动 prompt "请检查 X" 才发现的。
Eric 使用:Opus 4.6 和 4.7
对战 KataGo 的胜率——干净、可验证、不可 hack。
"verifiable game like go on the outer loop."
和 LLM / 机器人重叠的所有子问题:
不一定要"打败 KataGo"——也可以是:
这样 reward hacking 风险更低,但仍然需要靠"打 KataGo"做最终校验。
要训练一个强围棋 bot,你得先发现深度学习。但深度学习是个几十年的赌注:
"this presents a very challenging long horizon RL problem where every step of the way you have like a committee telling you that this is a bad idea and then ultimately you break it through."
LLM 可以充当 "universal grammar":
某些 lab 的训练 run 失败,是因为一群人独立地各跑各的好 idea,最后两个看上去都对的 trick 在一起反而互相破坏。
→ "having a single top down vision of how things should work is very important."
很多 compute multiplier 有 correlated benefit——它们都在解决"GPU 不够快"的副作用,本质重叠。
任何一个 trick 的优势都是 transitory 的。
DeepMind 一开始就在游戏上磨刀:Atari、AlphaGo、StarCraft、AlphaStar。
后来转 LLM 时,看上去有 positive transfer——研究 taste、coding ability、distributed infra、project management 全都用得上。
"I assume that there's like positive transfer in some regard."
但 Google 一开始在 LLM 上落后——会不会正因为他们的 RL/games tech tree 反而拖后腿?
"the jury is still out ... it's even hard for humans to reason about what the optimal research strategy should be even with the data we have today."
→ 那么自动化研究员怎么可能做对?
"a 10 layer neural network ... is able to amortize and approximate to a very very high fidelity a nearly intractable search problem."
"It's not trying to do credit assignment on wins. It's trying to improve the label for any given action you took."
"You never have to initialize at a 0% success rate and solve the exploration problem of how to get a non-zero success rate."
"You don't train the policy network to imitate the MCTS action — you train it to imitate the MCTS distribution."
"What felt like a very hard problem can fall to a very very simple macroscopic simulation."
"The compute required to be the first to do something is always much larger than the compute it takes to catch up."
却能塌缩"一个本该 intractable 的搜索问题"
代码 · github.com/ericjang/autogo
博客 · evjang.com
推荐延伸阅读:Eric 的 "As Rocks May Think"
"There is some very interesting duality between [Go and LLMs]
and you can actually do a lot of research on Go MCTS and reasoning
with very small budgets."