# Eric Jang – Building AlphaGo from scratch

- **Show:** Dwarkesh Podcast
- **Published:** 15 May 2026
- **Source:** https://www.dwarkesh.com/p/eric-jang
- **Transcript:** https://podcasts.opennash.com/shows/dwarkesh-podcast/eric-jang-building-alphago-from-scratch-2f7ad4/
- **Provider:** OpenNash Podcasts (machine-generated)

## In brief

Eric Jang argues that AlphaGo remains the cleanest worked example of how intelligence can be built from search, learning from experience and self-play. Its key trick is that Monte Carlo Tree Search (MCTS), a method that tries out many possible futures, gives a better move for every single position, so the network trains on clean supervised labels instead of a vague win-or-lose signal.

The central tension is between that tidy setup and how language models are trained today. Policy-gradient reinforcement learning (RL) rewards a whole long answer and must guess which of 100,000+ tokens mattered, and it may start with almost no success to learn from. Jang also finds AI coders strong at running experiments and tuning, but weak at picking the next question or escaping dead ends.

## Key insights

1. **Search gives a better label every move** MCTS relabels each position the AI played with a stronger move found by search, so the network is trained on a clean supervised target. This avoids guessing which moves caused a win, the credit-assignment problem.
2. **A small network can compress deep search** Jang calls it profound that a roughly 10-layer network, under 3 million parameters, can play strong Go without explicit search. It approximates what would otherwise need an astronomically large game-tree search.
3. **Naive RL learns little when success is rare** Jang shows that when a model rarely produces a correct answer, each attempt carries very little information, whereas supervised learning learns the full distance from the right answer. AlphaGo avoids this by never starting from a zero percent success rate.
4. **Being first costs far more than catching up** Jang rebuilt a strong Go bot for roughly $10k of donated compute by training against KataGo, an existing strong bot. AlphaZero had no such opponent to learn from, so it had to do everything from scratch.
5. **AI agents execute research but choose poorly** Jang found Claude Opus 4.6 and 4.7 good at hyperparameter tuning and running experiments. They struggled to choose the next experiment or to step back from a dead-end track, so he often had to catch bugs himself.

## Questions this episode answers

### Why is Go so hard for computers compared with other games?

A 19 by 19 board gives around 361 possible moves per turn over games of 250 to 300 moves, so the tree of possibilities is larger than the number of atoms in the universe, per Jang. There is also no score until the game ends, so you can't judge a move locally.

### What does Monte Carlo Tree Search actually do in AlphaGo?

On each move it runs many simulations that follow promising moves, grow the tree, and use a neural network's guess of who is winning to judge positions. The number of times each move was visited then becomes the final move recommendation, and the tree is thrown away afterwards.

### Why is AlphaGo's training described as more efficient than how language models learn with RL?

Jang says LLM RL rewards a whole trajectory and must work out which of many tokens deserved credit, while AlphaGo gets a better target for every move from search. He notes this is closer to how humans learn.

### Could the AlphaGo approach be applied to language models?

Jang says it has been tried, with tree structures applied to reasoning in Google research around 2023 and 2024, and the jury is still out. He suspects AlphaGo's exploration rule is a poor fit because language has too many possible next tokens and you rarely sample the same one twice.

### How good is AI at automating AI research right now?

Jang says current models are very good at tuning settings, writing code and running well-specified experiments, but weak at deciding what to investigate next and noticing when a line of work is a dead end. He thinks more advanced models might change that, but he doesn't claim it.

## Facts

- **Eric Jang** [0:03:05]: "Trump-Taylor rules are designed to be completely unambiguous for Go. So this is what all Go AIs train against and resolve against."
- **Eric Jang** [0:08:05]: "The game ends when either a player chooses to resign or both players pass consecutively."
- **Eric Jang** [0:09:43]: "in a 19 by 19 Go board, there are roughly to the order of 361 moves on any given move."
- **Eric Jang** [0:11:50]: "this is also why computer scientists for many years thought that Go was not a tractable problem this century."
- **Eric Jang** [0:12:53]: "there are some early algorithms in bandit literature like UCB1, which is not exactly appropriate for a sequential game like Go, but very much inspired the action selection algorithm used in AlphaGo."
- **Eric Jang** [0:16:01]: "in AlphaGo, they use a slightly different action selection criteria called PUCKT, and it's short for predicted upper confidence with trees."
- **Eric Jang** [0:45:23]: "So the four step process is basically selection, expansion, evaluation, and backup."
- **Eric Jang** [0:50:35]: "In original AlphaGo Lee, they actually did something kind of interesting, which is that they took this value and they averaged it with the value of a real Go play out."
- **Eric Jang** [0:39:15]: "The OG AlphaGo paper, or called AlphaGo Li, initialized this network with a supervised learning data set of expert human play."
- **Eric Jang** [1:15:21]: "AlphaGo Li, the original AlphaGo paper, had two separate networks. And then in all subsequent papers, they merged them into two heads."
- **Eric Jang** [0:41:42]: "Actually, it turns out this model is already a pretty good Go player."
- **Eric Jang** [0:33:21]: "One interesting finding from the Katago paper was that they found it actually quite useful to pool together global features together."
- **Dwarkesh Patel** [1:51:14]: "in 2021 Andy Jones had a paper called Scaling, Scaling Loss for Board Games and he basically anticipated inference compute or inference scaling"
- **Eric Jang** [1:56:01]: "I got a donation from Prime Intellect for about 10k and then I spent maybe the first 4k doing kind of exploratory research and then about 3k on the kind of final run."
- **Eric Jang** [1:59:41]: "So whereas KataGo was trained on V100s, you can train on half the number of desktop Blackwell GPUs and it still works."
- **Eric Jang** [2:00:36]: "I think AlphaGo Zero, their plot was first 30 hours or so are spent basically catching up to the supervised learning baseline."
- **Eric Jang** [1:56:21]: "So with my own bot that I've hosted online, I actually used sort of best response training against the Katago models to kind of get a strong level performance."
- **Eric Jang** [1:31:12]: "you have a decoder that might predict some words like, Hello world. And so in current LMRL, they treat this entire sequence as a single action"
- **Eric Jang** [1:37:19]: "Neural Fictitious Self Play, which was used to great effect in systems like AlphaStar and OpenAI's Dota."
- **Eric Jang** [1:49:08]: "The CPUCK rule involves square root of n over one plus nA. In an LLM, you're most likely never gonna sample the same child more than once"
- **Eric Jang** [1:47:06]: "there was some research, I think from Google in 2023, 2024, where they did try to apply tree structures to reasoning."
- **Eric Jang** [2:22:54]: "I mostly use Opus 4.6 and 4.7 throughout the working on this and what works is that the models can do a very good job of doing hyperparameter optimization."
- **Eric Jang** [2:25:11]: "they don't seem to be that great at selecting what the next experiment should be in a given track."
- **Dwarkesh Patel** [0:59:05]: "20 years ago, Jane Street's data center fit in the corner of an office."

## Transcript

**[0:00:00] Dwarkesh Patel:** Today I'm here with Eric Jang, who was most recently Vice President of AI at 1x Technologies, before that Senior Research Scientist at what is now Google DeepMind Robotics. And you've been on sabbatical for the last few months. One of the things you've been doing is rebuilding and improving and hacking on AlphaGo. And so today what we're going to do is you're going to explain building AlphaGo from scratch and what it tells us about the future of AI research and development.

**[0:00:25] Dwarkesh Patel:** But before we get to that, why is AlphaGo interesting? Why is this Why is this the project you decided to do on sabbatical rather than just hanging out at the beach? Sure, yeah.

**[0:00:34] Eric Jang:** I like making things, and AlphaGo and GoAI is one of those things that really got me into the field. When I saw the kind of early breakthroughs on AlphaGo in 2014, 2015, 2016, and so forth, it was just profound to see how smart AI systems could become and the kind of computational complexity class that they could tackle with deep learning. This is a problem that has long been understood to be kind of intractable for a search and yet it was solved through deep learning.

**[0:01:06] Eric Jang:** And so that was quite mysterious to me and I've always wanted to understand that phenomenon a little bit better. My training is often in deep neural nets for robotics where the decisions made by the neural networks are a bit more intuitive. But AlphaGo is a sort of problem where the decisions are actually the result of a very, very deep search. And it's always been very mysterious to me how like a 10 layer network can sort of amortize the simulation of something so deep in the game tree.

**[0:01:34] Eric Jang:** Yeah, interesting. So if you plot out how much compute it took to build various iterations of strong GoBots over the years, you can see that in 2020, there was a open source project called Katago by David Wu from Jane Street, who basically achieved a 40x reduction in compute needed to train a really strong GoBot tabular rasa. I'm not certain if it's stronger than AlphaGo0 or AlphaZero or MuZero, but it's very, very strong. And this is what most Go practitioners today train against when they're playing an AI.

**[0:02:04] Eric Jang:** And thanks to LLM coding, what took a whole team of research scientists at DeepMind and millions of dollars of research and compute can now be done for a few thousand

**[0:02:12] Dwarkesh Patel:** dollars of rented compute. By the way, if you're listening to this on an audio platform, this is a blackboard lecture, so I highly recommend switching over to a video platform like YouTube, if you can, to look at the math and the graphs and the Go board. Okay, I guess we should first discuss how Go works. Great. So, yeah, how does the game work?

**[0:02:31] Eric Jang:** So, the game of Go is a very simple one that can be implemented quickly and easily in a computer. The objective of the game is basically to put down black and white stones and try to occupy as much territory in the game as possible. So, I might start by putting down a black stone. Black always goes first. So go ahead. And so the way you capture an opponent's stones is that for every intersection, if you can surround all four of its neighbors with your stones, then this one is sort of cut off from oxygen, if you will, and then it is a dead stone.

**[0:03:05] Eric Jang:** So then now I control these four stones as well as this empty intersection here. So there's like slight variations between Chinese, Japanese, and what is called Trump-Taylor rules. Trump-Taylor rules are designed to be completely unambiguous for Go. So this is what all Go AIs train against and resolve against. So in typical Go, like when the humans play, you're actually not allowed to put this white stone down here. It would be instant suicide. In Trump-Taylor, it's actually fine.

**[0:03:30] Eric Jang:** You put it down, and then it immediately resolves to death. So the outcome is sort of the same. Let's go ahead and start over and play a few stones, and then I'll explain some more. So I'll just start there.

**[0:03:44] Dwarkesh Patel:** I'm like basically playing randomly here, but I'm trying to get around your stones and see if I can close them. Sounds good. Yep.

**[0:03:57] Eric Jang:** So this move basically exposes one empty neighbor for your white stone, and it's very akin to a check in chess, where if you don't respond immediately by putting in one here, then I can immediately capture this. Ah, I see. Okay. Because it is sort of the diagonals that determine whether you're grounded in it. The cross-section, not the diagonals. So this one is surrounded on three sides. Yeah. And so you're at threat of losing that stone if you don't play one immediately there.

**[0:04:23] Eric Jang:** Now you can see that I'm starting to pressure you because by putting a stone here, now you are forced to put one here. Otherwise you would have this to block to yourself. And then if you think through what happens if you were to respond here, you can probably search into the future and deduce what I'll do in response once you do that.

**[0:04:43] Dwarkesh Patel:** You have a lot of confidence in my abilities, but I'm guessing you'd put the black here. That's right. And then I would capture all three of these stones. So I should just assume that this is gone. This little block is gone.

**[0:04:52] Eric Jang:** Yes. So in Go, it's actually okay to let an opponent capture some stones if, for example, it allows you to position to capture more stones in somewhere else on the board. And this is what makes Go a very beautiful game is that you can kind of lose the battle but win the war, right? And as the board size increases, the complexity of these kind of micro versus macro dynamics gets more interesting.

**[0:05:15] Dwarkesh Patel:** Presumably you'd put one here.

**[0:05:17] Eric Jang:** And so now I would capture this entire group. Okay. And this would be mine. Okay, there's one more case that I want to demonstrate, which actually I had a bug in my code recently, which is the following situation. So let's consider a formation like this, right? And then we have other pieces on the board in play or whatever. And so let's talk a little bit about how the game ends. In this territory, who controls these areas?

**[0:05:47] Eric Jang:** Is it white or is it black? White. It's actually black because I have actually surrounded this whole area. And it's very, assuming I have other black stones here, it's actually very hard for you to break this out of the control of these stones. So when the final score is tallied, would these ones also count as being in? Yeah, great question. So this is where different rule sets have different ways of scoring. And so we should talk a little bit about how you resolve scores between humans and how you resolve scores between computer code.

**[0:06:17] Eric Jang:** Because there's actually some ambiguity in how humans evaluate this. So most humans would look at this board configuration and conclude that black has kind of totally surrounded white. And so white has no chance of life. We could play out more here, but then at the end, I would capture everything. However, if you have a way of breaking this formation and connecting white to something outside of it, then it can flip, right? And so this is where it's, you know, a little bit hard for a computer to decide these kind of things, right?

**[0:06:43] Eric Jang:** So how do humans do it, right? Like, it's worth thinking a little bit about how humans resolve this because this will actually map later to how we think about the deep neural network. Humans basically say, I think the game is done. And then you have to also say, I think the game is done. and then we'll say like, I think these are my stones and then you have to agree. If you don't agree, then we keep playing.

**[0:07:03] Eric Jang:** So essentially, once two humans, their so-called value function agree on a consensus, then the Chinese rules result that. Yeah, interesting. So in Trump-Taylor scoring, it's perfectly unambiguous. So it can be decided, you know, algorithmically by a computer. So if let's say you have this at the end game, the way you score this is that you first count how many stones you control, and that's unambiguous. Then you count how many empty intersections that are not touched by your opponent's stones.

**[0:07:35] Eric Jang:** So these intersections would not count for either player because all of these intersections are connected to both white stones and black stones. If this were like this, then white would get three points. Now, this is a little odd because a human would know that white is actually losing these points. But Trump Taylor's scoring would consider white to have all of these points as well as these points. Got it, okay. So that is a very big difference in how computer Go scores things and how humans score things.

**[0:08:05] Eric Jang:** How does the game end? The game ends when either a player chooses to resign or both players pass consecutively. Cool. Yep, so that's the rules. Nice.

**[0:08:15] Dwarkesh Patel:** All right, now help me correct this with AI. Great, okay. Let's understand how AlphaGo actually works and how somebody in the audience might be able to implement it.

**[0:08:24] Eric Jang:** Great, yeah. Let's start with kind of an intuition about the underlying search process used to make moves. And we'll layer on ideas from deep learning to make it much more efficient and attractable. So Go is a game where there's just two players. We're gonna draw a person here, and we're gonna draw an AI here. And let's say this person is playing black, so they go first. So we're gonna draw. We go here. And then now the AI is going to make a move based on what it sees here.

**[0:09:02] Eric Jang:** So there's a question of how you encode these inputs into the AI. Maybe you could use ones and zeros, but you wanna represent black, white, and empty. So you would need at least three different values here, right? So maybe you could use zero, ones, and twos or something. So the AI might see something like 0 0, 1. Great. So this is the input to the AI on its turn. Yeah. So the AI can choose, let's just pick three possible random moves that can go, and I just drew these at random.

**[0:09:43] Eric Jang:** And so which move is best here, right? Well, we don't know until the game ends. Go does not have any kind of local reward of which move here is good. And this is what makes Go a very difficult game, is that you don't actually know who won until you really get to the end of the game. So how deep is this tree, right? Well, in a 19 by 19 Go board, there are roughly to the order of 361 moves on any given move.

**[0:10:07] Eric Jang:** And of course, as it fills up, you have less moves. And the number of steps in the game can be somewhere from 250 to 300 moves. And maybe experts might decide to end the game well before that. But under Trump Taylor scoring, you actually have to play things all the way to the end. So this could be like 300 moves or something. Right, so like 300 depth of the tree. Yeah. So if you keep on expanding possible moves here, so in this move the AI is going, and then here the human would go.

**[0:10:39] Eric Jang:** And then, you know, there's some... and so forth. You can find that, like, essentially what you end up with is an enormous explosion in the possible game outcomes originating from just this one state. So this is something to the order of, like, you know, 361 to 300, power of 300, which is far more than the number of atoms in the universe. Like it's just, and of course actually there are redundancies and symmetries, so it's not actually 300, but that's sort of the, if you were to do a naive tree where there were no merging of children, then actually you end up with a tree about this big.

**[0:11:21] Eric Jang:** What do you mean by merging of children? Right. Let me use this board here. So if we start here, and then you play here, and then I play here, and then you play here, that is equivalent to, I start here, you play here, I play here. Yeah. And then you play here, right? Yeah. So both of them arrived at the same spot, but through different paths. So this child node can be thought about as a shared ancestor.

**[0:11:46] Dwarkesh Patel:** And I guess it's not 361. It starts at 361, but it decreases by one each time.

**[0:11:50] Eric Jang:** Yes, and the branching factor decreases by one each time. Yeah. But in any case, this is a very, very, very large tree. And this is also why computer scientists for many years thought that Go was not a tractable problem this century. Because the amount of compute you would need to exhaustively search every possible possibility is just too large. If you could, Go is actually a deterministic game. So on any given state, you can actually compute what the best possible strategy you can make is in order to win the game.

**[0:12:20] Eric Jang:** You can search all the possible futures where you win and then just make sure you always stay in that set of futures. So AlphaGo's kind of core conceptual breakthrough was using neural nets to to make this search problem tractable. So before we get into how neural networks are involved, let's talk a little bit about how we can, assuming we have a powerful enough computer, search this tree to find the best move, right? So in the beginning, you're not gonna build out the whole tree, because storing that tree would be very expensive.

**[0:12:53] Eric Jang:** Instead, you might do something like interactively figure out which leaves of this tree are worthy of exploring and expanding into the future to see what else is there. So there are some early algorithms in bandit literature like UCB1, which is not exactly appropriate for a sequential game like Go, but very much inspired the action selection algorithm used in AlphaGo. So UCB1 looks like on every move, we're going to take the best action or the argmax over a that maximizes the Q of a, and I'll explain what Q of a is in a moment, plus some sort of exploration bonus.

**[0:13:46] Eric Jang:** So on every node, we're going to track a few quantities. So let's consider each of these a node. This is the root node. where you're making decisions from. And these are the children of the root node. And we're gonna say each node is basically a data structure. That is, it stores a visit count of this node, this child node. Is how often the parent visited this node? Yes, and we'll call this an action. So one thing that is easy to trip on is if you come from robotics or other kinds of reinforcement learning is like, where are the actions, right?

**[0:14:27] Eric Jang:** I'm only talking about nodes. Nodes here represent states and because this is a perfectly deterministic game with no randomness, you can actually just infer the action based on the child. So if I go here, that implies an action. And this is the state that we resolve it. So the LLMs, if you ask to vibe code a MCTS implementation, it'll most likely design the right data structure here. But it's sort of a chef's choice. You can actually rewrite the tree structure however you like.

**[0:14:56] Eric Jang:** This was what Claude 4.6 wrote for me when I asked it, and it was a very reasonable choice. So then Q represents the mean action value of this action. And I'll use a subscript aided to note that this kind of corresponds to taking a specific action to get here, right, from the root node. So if we have root, basically taking A gets us to this node here. Yeah. And then we're going to also store the probability of taking this action.

**[0:15:34] Eric Jang:** Again, from the parent. From the parent, yes. Yeah. Like, what are the odds that we sample this one? Yeah. And this will become relevant later. You know, like we've talked about a deterministic tree for now, so I'll bring probabilities into this later. And then finally, we have a sort of dictionary of children, which is just like more of these notes in a sort of classic linked list style reference tree. So this is the basic data structure to implement a tree.

**[0:16:01] Eric Jang:** And in AlphaGo, they use a slightly different action selection criteria called PUCKT, and it's short for predicted upper confidence with trees. And this is basically, when you select which child to take, you do argmax A of q of s A plus constant. So the equation and forms are actually pretty similar. These are both scoring criteria, right? Like you want to argmax this quantity, and you want to argmax this quantity to determine which action to take. So let's break down the intuition of how you select actions here.

**[0:16:55] Eric Jang:** This is the mean action value, so how good is a given child on average? And if you actually knew the whole tree, then this is all you need to select the best action. You don't really need to do more than that. But if you're interactively building this tree as you're figuring out what the Q values should be, then what you have to do is occasionally try some other actions as a sort of exploit versus exploit trade-off.

**[0:17:19] Eric Jang:** So in both UCB and Pucked, there is this term here that basically rewards taking actions that you haven't taken before. So as we mentioned before, each node stores the visit count of taking that specific action. So everything is initialized to zero. And so for a given action, let's just say like action A, Initially, it's zero, and so as n is increasing, if let's say we've already made 10 action selections from that root node, but we haven't picked a yet, then this term actually starts to become quite large for a.

**[0:17:54] Eric Jang:** Yeah. Right. And conversely, if we have chosen a 10 times out of 10, then now this term is quite small. It diminishes very quickly. And the same thing is actually true here.

**[0:18:05] Dwarkesh Patel:** Just to make sure I'm understanding it, but maybe I can put it in my own words. Let's just focus on UCB. What we're saying here, you can think of it conceptually as two different things, the Q and then this exploration term. Let's just be clear about what Q is. Q is basically saying, hey, once we do these rollouts, so you're actually running all these simulations, you go down the tree, and then you figure out, okay, if I end up at the terminal value of this tree, do I win this game or not?

**[0:18:34] Dwarkesh Patel:** And then you do this, you average whether I win this game or not across all the, you know, the leafs of this tree starting from this node, that average you put in Q. Correct. And so you're saying the Q is basically representing, will I win this game or not? What is this probability that I'll win this game starting at this node? That's your sort of, that is your sort of exploit. That is like saying, I've run these simulations, I think this is a good move or not.

**[0:18:58] Dwarkesh Patel:** And then this other term is saying, have I explored this branch enough yet relative to the other actions I could be exploring? Or I have already explored. If I haven't explored this branch yet, maybe I think it has a low score, but I just haven't explored that many leaves down this node in this tree. So I should maybe try this, even though the queue, the sort of exploit, is telling me that this is not that valuable.

**[0:19:23] Dwarkesh Patel:** Because ln of n grows slower than n, basically as over time, you will move from the argmax being dominated by this exploration term, which is the second term here, to the argmax being dominated by the Q term, which is like, okay, I've done enough simulations. I'm quite confident that this is the branch to go down. Yes, that's right.

**[0:19:46] Eric Jang:** So the motivation for UCB was to come up with an algorithm where if you don't know the payoff of the arms, the different actions you can select to begin with, This strategy, basically, given some exploration term here, bounds your regret in terms of how wrong you can possibly be. I don't know the proof. I don't also know if this one is proved to have a logarithmically or like square root bounded regret or anything, but I think the algorithm was just derived to look something like this.

**[0:20:14] Eric Jang:** And you can tell that these terms, they grow a little bit differently. And this is actually just to account for the fact that Go has many more actions in every given move compared to your standard banded problem. Yep. So one small clarification to make is that you talked a little about simulations and probabilities and forth. We should remember that Go fundamentally is a deterministic game. So the notion of, like, where does the notion of probability come from here, right?

**[0:20:39] Eric Jang:** If you had a very powerful computer, there is no probabilities. You can just compute the true average of what the mean action value is. So where does the probability come in? Well, it turns out that as in, you know, computer go before alpha go, we've always done some sort of Monte Carlo method where we have some, we take the expected Q value averaged over a randomly selected tree. And that randomly selected tree is where probabilities come in.

**[0:21:09] Eric Jang:** So the interpretation of Q is, what is the expected action value under the random distribution induced by some random search process? Makes sense. And so where does the random search process come in? That's where P of action comes in. Yeah. So if we assume a very naive algorithm where you have a uniform probability of taking any valid action, then this would just be one over the number of valid moves in this setup. And you would be kind of taking this average over this very diffuse tree, right?

**[0:21:42] Eric Jang:** And this is a valid interval you can take, but it's very slow because you're gonna consider a lot of trees that have very low value. And it's essentially almost like a important sampling problem where you want to, there's only a few actions and sort of paths that can contribute high value, and almost everything else is low value. So that's a sort of a tricky problem here. Okay, so this is the action selection criteria for how you decide which moves to move down.

**[0:22:11] Eric Jang:** Now, as you move down in tree search, you will eventually run into a node where it's quite clear you've won or lost, right? At the very, very end of the game, when there are no valid moves to play left under Trump Taylor scoring, you can decide whether you won or lost, right? So you either win or you lost. And so this is basically the final return of the whole game. And so the question here is, we can assign a value, u, to a terminal leaf node of the tree, but how do we assign the values for nodes prior to that, the parents?

**[0:22:55] Eric Jang:** And it turns out, you know, what you simply do is you just take the, your mean action value is essentially your average. So let's suppose these were leaf nodes. Sorry, these were all leaf nodes. The mean action value of this node, you know, this action here, is just the average of whether you won or lost at the leaf nodes. And correspondingly, you can kind of walk up the chain and say, like, well, the mean action value of this node, let's call this, like, QB, and this is action B, is just the weighted average of these ones here.

**[0:23:30] Eric Jang:** Yeah. Right. And the weighted average is, it could be dependent on if you have a different sampling distribution or not, but the basic intuition is that you want to resolve the game where you have a deterministic win or lose, and then you can kind of go backwards. This is called the backup step and assign values to these nodes or actions corresponding to the averaged over the final terminal leaf. Okay, so if you were to do this without neural networks, it would still be intractable.

**[0:24:01] Eric Jang:** You would have trouble finding which actions to sample. A lot of the actions would contribute very low value, especially if you're trying to fight your way out of a losing position, and only a few actions give you high value, so the search in practice is still very, very expensive. But the idea is that if you can, because Go follows a tree structure, you can actually inform a very good estimate of the value of this node based on the values of downstream, assuming they're all correct and assuming you've searched deep enough.

**[0:24:34] Dwarkesh Patel:** Your explanation earlier about the sorts of states where it's obvious to a human who's going to win, but it's not obvious to, or like you deterministically still had to play it out, actually drove home the intuition of why the value function both is trainable and to why it's necessary in order to actually be able to learn this game effectively. I mean, it's worth defining value in the first place. Sounds good. Yeah.

**[0:24:59] Eric Jang:** Yeah. So we talked about, you know, this U value being, you know, your final resolution of whether you won or lost. And this is the terminal leaf node condition. Now, humans don't play all the way to the sort of edges of the tree, the leaves of the tree, right? They kind of stop, you know, some dozens of moves before, maybe even a hundred moves before in sort of high level play. So how do they know, right?

**[0:25:20] Eric Jang:** You can think about humans as implicitly having a neural network called a value function that basically takes in a board state and then kind of evaluates he win. And so the human glances at the board and they know, like, I'm probably going to lose. And they're essentially running a neural network that looks at a board and implicitly they are amortizing a huge number of possible game playouts. and taking that average and then deciding whether the board is winnable or not and then whether they should concede or, you know, keep playing or not.

**[0:25:56] Eric Jang:** And this is remarkable. If you think about, like, the beauty of something like this, it's like a neural network in a human can somehow do all of this simulation at a glance and then just know, like, within a few seconds without actually playing every single game logically based on just kind of, like, crystallized knowledge and experience that, like, they can do this. And so this gives us a hint that in games like Go, there are ways to basically radically speed up the search process.

**[0:26:26] Eric Jang:** And this is one of the fundamental intuitions behind why AlphaGo works, is that you can train a value function to look at a board and quickly resolve the game without playing out all of these trees into a very deep search depth. Yep, makes sense.

**[0:26:42] Dwarkesh Patel:** I will say for the audience, I sort of found for previous episodes when I was prepping, and it seemed somewhat relevant to understand how AlphaGo works, I would find it very, very confusing. But it's the kind of thing where once you understand the problem in this way and then you'll build the next few pieces, it is actually much more understandable and it will make a lot of sense. And it's okay to be confused right now, but it's probably simpler to understand by the end of this lecture than you anticipate.

**[0:27:09] Dwarkesh Patel:** So I'll just make that note for the audience.

**[0:27:12] Eric Jang:** Yeah, the important intuition at a high level, just to step back about where we're going with all this, is that classically, for games like Go, you could build a tree, but we don't have computers powerful enough for that. And estimating the value of every action that you could possibly take is also hard because you don't know until the end of the game. You could take averages by playing them to the end, but that's also hard because you don't know which actions to take.

**[0:27:39] Eric Jang:** to sample these averages. So conceptually, there's kind of two problems. There's the breadth of the tree, and then there's the depth of the tree. And AlphaGo gives us a way to basically shrink both of those to be very attractive. That's essentially the kind of core idea behind it. Okay, so we take this idea that humans can glance at a board and instantly predict whether we win, and maybe that gives us the opportunity to really truncate how deep we search.

**[0:28:05] Eric Jang:** And then we also know that humans can look at a board and decide, you know, what boards, you know, like intuitively at a glance, what moves might be good on a Go board, right? So these are kind of two things that we can use deep neural networks for to accelerate this search process. Let's go back, before we talked about neural nets, let's just go back to how this play out works. So we've only talked about making one move, right?

**[0:28:33] Eric Jang:** So the AI looks at this encoded Go board. It has a tree. It searches for, you know, deeply into the tree to find out which of its actions might be the best. And then it takes that action. And then now, you know, it goes back to the human. So maybe now the human sees a Go board that looks like, you know, like this. And then they make their move. So maybe they put their stone here. and then now we go back to the AI, which now looks at a new encoded board.

**[0:29:19] Eric Jang:** So I've used two to denote the AI's playing as white and one to denote the human playing as black and zero as empty. And then now on the AI's turn, it does the MCTS tree search all over again from scratch, right? So it throws away this old tree that is searched last round, and now there's a new root node, and it begins to search anew. And then so on and so forth. So MCTS is basically, you can think about it like a search algorithm that is deciding what moves to play best, aided by neural networks.

**[0:29:51] Eric Jang:** And it's done on every move. Okay, great. So let's talk about the neural network part of this.

**[0:29:58] Dwarkesh Patel:** And while you're racing, another sort of thing that was important for me to understand was this MCTS data structure with nodes and children of nodes and whatever. This is done per move and reinstantiated once a move is made. So a human makes a move, then the AI looks at this and is trying to basically run a bunch of simulations to figure out, okay, what move should I make next? And a simulation is basically like exploring one more node in this MCTS tree.

**[0:30:29] Dwarkesh Patel:** And at the end, once you run a thousand simulations, that informs then this, I guess as you will explain, this probability of what move to make next. That's what you store. You choose the best move given those probabilities. You discard all of that. Then the next player makes a move. And you restart this process at the beginning of every move. Correct.

**[0:30:53] Eric Jang:** One small addendum, you don't discard all of that. You keep one thing behind that we'll use later.

**[0:30:59] Dwarkesh Patel:** Just like I did for Reiner, I wanted to make flashcards for this episode so that people could retain these concepts. And ideally, an LLM could generate some candidates for me to then refine. But to actually get high-quality suggestions, I needed to design a whole pipeline where the AI could take and ingest screenshots of the blackboard and the right timestamps, and then make SVG diagrams in case visuals were helpful, and then run their writing and drawing through a critic, and then revise the card in response to this feedback.

**[0:31:25] Dwarkesh Patel:** It's very hard to accomplish this just by stacking LLM calls. This sort of step-by-step recipe works much better if you have a durable agent that's been engaging with the task across all the previous stages. So I used the cursor SDK to spin up an agent for each card. The cursor hardness saved me a bunch of work in designing some custom context scaffold or figuring out how to design tool calls for taking screenshots or making animations.

**[0:31:48] Dwarkesh Patel:** These agents all run in the cloud, so I don't have to worry about leaving my laptop open. I just get an email when I have candidates to review. You can check out my cards at flashcards.dwarkesh.com. You can start building with the agent's SDK at cursor.com slash dwarkesh.

**[0:32:05] Eric Jang:** Okay, so now we have a basic intuition of how moves are made with search. We're going to talk about how neural networks can speed this up by providing an analog to the human intuition. So there's two networks. There is the value network, which takes in a state and it predicts, am I gonna win or lose? It's a binary classification problem. Then we're gonna have a policy network, which induces a distribution over good actions to take. So I'm gonna draw a one dimensional flattened move distribution, but this is really like a square kind of grid, right?

**[0:32:44] Eric Jang:** So maybe it thinks actions are like, these are the kind of probability distribution over good actions. And both of these are categorical classification problems, right? So you can train this like any classifier with deep learning, cross entropy, loss, that kind of stuff. So the specific architecture does not actually matter too much. I tried a few different architectures, transformers work, ResNet's work for small data regimes. My experience is that ResNet still kind of outperform transformers and kind of give you more bang for the buck at lower budgets.

**[0:33:21] Eric Jang:** But this may not be true. Wait, why is that? They provide the inductive bias of like local convolutions. Yeah. And generally transformers start to outperform residual convolutional networks when you want more global context. I see, okay. So one interesting finding from the Katago paper was that they found it actually quite useful to pool together global features together. and aggregate global features throughout the network to kind of give the network a global sense of how to connect value from one side of the board to another side of the board.

**[0:33:52] Dwarkesh Patel:** What does it mean to aggregate global features?

**[0:33:54] Eric Jang:** Yeah. So if you have a very large 19 by 19 Go board and you've got some sort of battles going on here and you've got some battles going on here, when you pass this through a convolutional neural network, The receptive fields of the convolutional network are going to be good at computing local things and making that invariant. But they won't be able to kind of connect these two features easily, right? They need to sort of be pulled together and attend to each other somehow.

**[0:34:26] Eric Jang:** So the argument about, you know, why transformers are good for computer vision tasks, like with, you know, vision transformers and so forth, is that because they have sort of global attention across the whole thing, they can more easily draw these connections. But you do need more data there so that you can kind of learn through data the sort of invariant local features. I've tried very hard to make transformers work for this problem, because I was kind of curious if transformers would present some sort of breakthrough in Go and just remove a lot of those tricks.

**[0:34:56] Eric Jang:** But to try as I might, I actually haven't figured out a way to make transformers better than Resonets for now.

**[0:35:01] Dwarkesh Patel:** So one more potential question. It makes sense why Transformers with their global pooling of information would be better if you need to consider information that is not just spatially... Or yeah, CNNs give you a sort of bias that the things that are next to you are especially irrelevant.

**[0:35:21] Eric Jang:** And then they're sort of aggregated up. Yeah, exactly.

**[0:35:23] Dwarkesh Patel:** Yes. But suppose... Okay, so for games where it isn't that relevant, what is happening locally, you just kind of have to consider the whole thing. Mm-hmm. You're saying Transformers would work better. How about games where, so we're talking about the spatial dimension. How about the temporal dimension where right now we're only considering the previous move because it is a deterministic, full information game. But what if it was something like poker or diplomacy where really a bluff they made a while back is sort of relevant to understanding now and isolating to decide to make your next move.

**[0:35:55] Dwarkesh Patel:** And so you need to consider all those previous states. Would that change the consideration of what inductive bias is most relevant and what architecture is most relevant?

**[0:36:01] Eric Jang:** Right. Great question. So Go is a perfect information game. And in perfect information games, there does exist a Nash equilibrium strategy for which you can do no worse than any other strategy. So if you know that your opponent has a particular bias, like they love to play aggressively, You can actually in principle counter that specific strategy better than a Nash equilibrium policy. But to counter any given strategy, there does exist a single Nash equilibrium that can be decided solely using the current state.

**[0:36:36] Eric Jang:** So that is a design choice that most Go agents, AlphaGo chose to do, which in hindsight turned out to work very well because the Nash equilibrium seems to be superhuman. Like no human strategy seems to be able to beat it. Now, there are variations of this where you would actually need to consider temporal history. And this is a very exciting research area that I would encourage people to kind of fork my repo and try these things out, which is if you were to play, let's say, 2v2Go, then you actually need to model your partner's behavior.

**[0:37:06] Eric Jang:** And you may not have information on how they play, so you need to aggregate some information on how they play so that you can respond accordingly. Yeah. Like these are situations where it's no longer a perfect information game. And then in those cases, in games of imperfect information or partial observability, then you do need some context to build a model. Yeah. And I think that's a place where things can get very, very exciting in terms of self-play or diplomacy style.

**[0:37:31] Eric Jang:** Yeah, interesting. Okay, so returning back to the neural network, the architecture again is not super important. You can get it to work with transformers, you can get it to work with resnets. I found that for low budget experiments, resnets work a little better. You can also use kind of a Karpathy style auto research, hyperparameter tuning to make your architecture pretty good. And so you don't have to worry too much about that. You just need to sort of set up the problem so that you have a sort of target optimization.

**[0:37:56] Eric Jang:** Yeah. Okay, so we're gonna pick just a somewhat arbitrary architecture that worked for what I did. But again, this part is not super important. You have your encoded board state. And we're gonna just choose to, let's say, do three, three, like similar to an RGB, we're gonna have three kind of channels. One channel to include black, one channel to include white, and then one channel maybe to encode empties or maybe like a masked region if you want to train on multiple board sizes.

**[0:38:29] Eric Jang:** I'm actually not gonna talk about multiple board sizes for now, that's a little bit too complicated. So we'll just say we've got this two or three channel RGB-like image, And then we go into a ResNet. And then we have two branching heads. One head predicts the value function. And this is like a single logit. So this is like R1. And then we have the policy, which is R361. So this is the architecture. And we're going to basically train this to predict the outcomes of games, given the board state.

**[0:39:15] Eric Jang:** And we're also going to train this to predict what are good moves. Yeah. Right. So the OG AlphaGo paper, or called AlphaGo Li, initialized this network with a supervised learning data set of expert human play. Later, they removed this restriction by having the model teach itself how to play well. But I find it actually from a matter of implementation for your audience, It's super, super nice to always kind of initialize your experiments to something that's easy and then get the problem working before trying to bite off the whole thing and learn a tabular resin.

**[0:39:47] Eric Jang:** You generally want to kind of initialize, just as in deep learning, initialization is everything, right? You always want to initialize your research project to something as close to success as possible, especially if you're doing something new that you haven't done before. Like always pick something that works and then get it to do something better rather than and start from something that doesn't work at all and then try to make it work. So under that philosophy, it's a great idea to start from something that has a good initialization.

**[0:40:14] Eric Jang:** So we're gonna take human expert plays and train this model to predict good actions, right? So we're gonna take all of the winning games, all the moves in which a human won, and sorry, an expert won, and then predict those actions. And then regardless of board state, whether you won or lost, you're going to predict the outcome. Yeah. So you might be wondering, like, okay, well, some of the early boards, you know, where basically only one stone has been put down, how could you possibly know whether, who the winner of this game is, right?

**[0:40:44] Eric Jang:** Well, if you have, you know, hundreds of thousands of games, then on average, you'll probably see that boards that start like this have a sort of, half of the games that branch off from this will win, and half of the games that branch off from this will lose. So that'll actually be fine. When you train this model to predict those, the logit will sort of converge to 0.5. And so for these things, it's sort of expected that once you train the model, a starting board state will look like 0.5.

**[0:41:10] Eric Jang:** And then as you progress towards the end of the game, it'll actually look something like, if this is 0.5, the win probability will sort of either go like this or it'll go like this. And this is sort of your move number. Yeah. And so as you get hundreds of steps into the game, it becomes much more clear who's more likely to win or who's more likely to lose under your expert data distribution.

**[0:41:36] Dwarkesh Patel:** I didn't understand the significance of why this way of thinking about value is especially relevant to the expert data.

**[0:41:42] Eric Jang:** It is not relevant to the expert data. It's true for any data that you train it on. So if you were to learn a tabular rasa, you would also expect this to fall out. So if you just do this, So imagine you're vibe coding AlphaGo and you gather some expert data sets from like how to go online, or you have a data set of human players and you train this model. Actually, it turns out this model is already a pretty good Go player.

**[0:42:08] Eric Jang:** It'll most likely beat most human players, right? So if you just take this policy recommendation and take the argmax over its... If this is the probabilities, if you take the argmax and you just take this action, as your Go play, it'll be a very, very fast Go player that doesn't think in terms of reasoning steps, it just kind of shoots from the hip, and it'll be a very strong Go player. Which is already quite miraculous if you think about like, you know, 10 neural network layers, maybe under like 3 million parameters can already do something that impressive.

**[0:42:46] Eric Jang:** And so you can start this way, and it's important when implementing this to kind of just verify that this is probably true. It's good to verify that your Go rules are implemented correctly, that you can run these simulations relatively quickly. And just as almost like a sort of a checkpoint that you want to make sure that you can actually do this basic step before you try to layer on more complex things like search. Yeah. So, but yeah, we can do a lot better than taking the raw neural network and playing the moves.

**[0:43:13] Eric Jang:** And this is how we can apply it to Monte Carlo Tree Search. So let's apply the neural network to improve Monte Carlo Tree Search. So we start with our root node. And we now have a four step iterative process to do MCTS. So this tripped me up when I was first reading the paper and trying to understand it. But essentially what we're going to do is, we're gonna choose a number of simulations. So like, num simulations.

**[0:43:50] Eric Jang:** and this number varies. This can be, you know, somewhere between 200 to 2048. I believe in the AlphaGo Li match, they used tens of thousands of simulations per move because they really wanted to boost the strength of the model as much as possible. But in training, you don't actually need too many and Kodigo, I think, uses something on this order as well.

**[0:44:10] Dwarkesh Patel:** Do you know if they used, if you watch the documentary, they had a laptop out during the game? They didn't use a laptop itself. It was like on some... It was on some TPU pod, I think. Yeah, but now - Honestly, kind of unfair. Well - Lee is not using like one E22 flops to do a move, you know?

**[0:44:26] Eric Jang:** Fair enough. Interestingly enough, modern Go bots don't need that much compute at test time. And what we'll actually find out as we talk about how the MCTS policy improvement works is that over time, the raw network actually takes all of the burden of that big TPU pod and just pushes it into the network. And you can do all of that work with one neural network for the pass. But the TPU pod will always add the extra oomph on top, and so that's what they wanted for the match.

**[0:44:57] Eric Jang:** So we're gonna pick this kind of like num simulations thing. And for every simulation, we're going to basically do several things simultaneously. We're going to see which moves are the best in the current tree. We're going to add extra leaves to the tree if we get to a point where we need to add a leaf and we're gonna update the action values for the tree. So that's what every simulation involves these kind of like four step process.

**[0:45:23] Eric Jang:** So the four step process is basically selection, expansion, evaluation, and backup. So at the beginning of our Monte Carlo tree search, our tree is very basic. It only has the root node, our current board that our AI wants to play at. And so we're going to basically select the best action for this. So when this root node is created, we also know that we can evaluate this under our neural network and get the quantities, you know, v theta, as well as our probability over actions.

**[0:46:08] Eric Jang:** And I'm gonna say root. So for all of the actions here, we can create a bunch of children, right? So this one has, well, in this case, I'm drawing a 3x3 board with one board missing. So basically, there are, you know, eight possible children associated with this root node. So like. And each of these has an associated probability of taking that action, right? So there's p8, p1, p2, etc. Okay, so at the beginning of our Monte Carlo tree search, we have our root node and we can initialize it with some children, right?

**[0:46:59] Eric Jang:** Because we know the policy network evaluated on the root node gives us, on a three by three board with one existing stone placed, eight possible children that this AI could take. So with each of the children, their policy network also gives us the probability of selecting that child. So the first step is to do the selection of the tree. And again, this is a very shallow tree. All we have so far is a tree of depth one, essentially, right?

**[0:47:23] Eric Jang:** So our first move is to select by maximizing or argmaxing the pucked criteria, which is basically Q s a plus c pct times p of a divided by n over 1 plus na. So for each of these, we're going to, na is zero for all the actions initially, n is zero. And so we're going to basically just pick according to this. Initially, what is going to be the chosen action here is most likely going to be biased towards the highest likelihood action here, right?

**[0:48:15] Eric Jang:** Because these are sort of uniform for everybody. So let's suppose P1 was the highest probability node. So you selected this one here. Now, you got to this node and you realize that it's not a leaf node. It's not a terminal game, so you cannot resolve the final resolution. So the next step that you do is expansion. So you will then run this node, this board state, through the policy network. Note that this is the AI's move, right?

**[0:48:45] Eric Jang:** Like AI is making this move. And so when we expand this tree, we're now thinking about what the human might do, or any opponent might do, right? So this is like your opponent. The tree expansion process actually is completely, so when we evaluate the node here, we're gonna now evaluate the node from the perspective of this player. Yeah. So then this one has possible actions that we could take, and we expand basically the leaf nodes here.

**[0:49:19] Eric Jang:** So for each of these nodes that we could arrive at, And we're gonna now check how good those nodes are, right? So maybe from here, like the human could play here, the human could play here, or the human could play here. And we're gonna store essentially the V theta for each of these things. So V theta of node one, or like node one prime, V theta node one. And so we're basically using our neural network to make an intuitive guess of how good is this board from the perspective of this player.

**[0:50:07] Eric Jang:** And fortunately because it's a zero sum game, it's easy to deduce that the value for this player at this step is just one minus the value for this perspective. So it's easy to flip the search process depending on which player you're at. And so this is the expansion step. You've taken a non-leaf node and expanded it and evaluated the value. And this is essentially a quick guess as to like, if I were to play to the end, am I gonna win or not, right?

**[0:50:35] Eric Jang:** So you can almost think about the V theta as a shortcut for searching to the end of the tree for any given simulation. And then this is essentially the evaluation step. We're evaluating the quality of each of these boards. In original AlphaGo Lee, they actually did something kind of interesting, which is that they took this value and they averaged it with the value of a real Go play out. So they actually played a real game from here all the way to the end.

**[0:51:06] Eric Jang:** So I'm just going to draw this squiggly line to indicate some path. And they kind of played this all the way to Trump Taylor resolution of a full board. And so this is like a zero or one, right? And so they took this value and they just averaged it with this one here. So the formula they did was like alpha times V theta of some node, plus sort of like one minus alpha of a true randomly sampled plant.

**[0:51:47] Eric Jang:** And you might be wondering, okay, well, how do they play this out, right? It would be very, very costly to do another search on this play out, almost like a tree within a tree. So they don't do this. Instead, they just take the policy network and play it against itself. So they just take this as both players and they just play it all the way to the end. And this is something that helps ground the estimates here in reality, because you can get a single sample estimate of whether you win or not.

**[0:52:14] Eric Jang:** You can think about in the end game where the board is almost resolved that this one actually becomes quite useful because the play according to the policy will most likely decide a pretty reasonable guess of the game. And so you're not facing a problem where this one kind of becomes untethered from reality. It turns out this is totally unnecessary. So in all subsequent papers after AlphaGo Li, they just got rid of this. And so in my implementation, I also did the same and it speeds things up a lot because you don't have to roll these games out on every single simulation.

**[0:52:42] Eric Jang:** Yeah, yeah.

**[0:52:43] Dwarkesh Patel:** Okay, so again, just to reinforce my own understanding and just to re-explain it. For the audience, by the way, in case it's not obvious, the P there in the select, that is the probability coming from the network in this case. Correct.

**[0:52:56] Eric Jang:** The policy network here.

**[0:52:58] Dwarkesh Patel:** Yeah. Okay, so fundamentally, a simulation, just think of it as like rolling out one more node in the search process.

**[0:53:09] Eric Jang:** Almost. So a simulation is easy to think about when the whole tree already exists, right? You just walk down the tree using the puck selection criteria and then you keep going. Now, in AlphaGo, the data structure is such that we begin with a tree that has no, basically only depth one, which is its only children. And you want to iteratively build out the tree as you're also selecting actions down the tree. So that's the kind of core thing here is that because Go is such a combinatorially complex game, you cannot afford to build the tree in advance and then search it.

**[0:53:46] Eric Jang:** You must search while building the tree. Right. Okay. So let me just finish up with actually the last step, which is the backup, right? So once you've scored these things, you basically take the mean, the value, the Q value assigned to the node here for taking this action is now just the average across your evaluated values. You take a running mean over all of the simulations that you've taken, and they average the values of the children.

**[0:54:16] Eric Jang:** Yeah. So that's what is known as the backup step. And once you evaluate this, you can actually kind of recursively go back. So if you know the action value of this node, you can then take the average on its parent and so on and so forth. So you have this kind of four-step process where you are choosing the best action that you know of so far. then you may run into a node where you haven't been to before, so you need to grow the tree a bit.

**[0:54:40] Eric Jang:** And then you run it through the network to guess whether you're going to win or not. And then you walk all the way back up to the root node to update your values on what the best moves are. So as you do this iteratively, this selection criteria will cause you to visit the, because you're always selecting according to this criteria, you're always going to be selecting the best action you think at any given branch, right? So the final visit counts of how often you chose these things will reflect your correct policy distribution as induced through this search process.

**[0:55:14] Eric Jang:** And so the visit count that we store in the node earlier actually becomes the sort of vote for which way we should finally select an action here. So as a sort of test of understanding, it's worth thinking a little bit about whether we could make this even simpler. Like, could we actually maybe even get rid of this one and still make the thing work? So recall that when you do an expansion and then an evaluation at, let's say, this node, you are checking the sort of win probability of each of the child nodes, right?

**[0:55:44] Eric Jang:** And so if this one is like one and these are zero, you do kind of know something about which action might be better to take. And so why would you still need this, right? Like why not just normalize this one into some distribution and call that your policy distribution? This is fine, you can do this, and this probably does work. But in practice, having a single forward pass that gives you a pretty good guess is how the breadth is pruned out.

**[0:56:19] Eric Jang:** There is a sort of duality here. Like it would be weird if, let's say, the policy recommended an action that disagreed with the value, right? If let's say the policy said this was very high probability, but this one said it was a low value, then there's actually something kind of fundamentally wrong between your policy head and your value head. So they are linked and you probably could get rid of this if you came up with a different way to recover this from just the value evaluations.

**[0:56:44] Dwarkesh Patel:** Right. But just to make sure I understand, the reason you don't do that is so that you don't have to do 360 independent forward passes to like, here's the value of everything, let's target max over it, right? Instead, you can just do one forward pass and get the probabilities of all of them.

**[0:56:59] Eric Jang:** You can usually batch these somewhat efficiently. Mm-hm. So it probably is not a huge computational burden in practice. Mm-hm. But yes, you would have to pass up to 361 boards into a single mini-batch update to evaluate all the values here, then normalize them. Now, there's actually a more important reason why we still do this, which is how Monte Carlo Tree Search is used to feed back on itself. And sort of recursively improve its own predictions and search capabilities.

**[0:57:29] Eric Jang:** And that's where this one, having this as an explicit entity you're modeling, rather than an implicit normalization over your value is a good idea. Makes sense, okay. Okay, so we talked about the simulations and basically, what you end up with as you roll out the number of simulations is a tree that kind of looks like. I'm drawing a very low dimensional version of this. Of course, in the real game, it's much more high dimensional. But you'll end up with basically a tree structure that has a lot of leaves that kind of terminate and are not visited again because their value is deemed to be too low.

**[0:58:08] Eric Jang:** But then along one path, there will be a set of actions with very, very high visit counts that kind of gravitate towards that one set of decisions as you increase n. So this is kind of like the mental picture of what the tree in Monte Carlo Tree Search looks like. And you should contrast this with like an exhaustive tree, like in tic-tac-toe, where you could say like, you know, there's nine actions, and then eight, and then seven, and six.

**[0:58:34] Eric Jang:** And so it's sort of like a nine factorial sized tree. The Monte Carlo Tree Search in Go is very, very sparse. It only considers the paths that you've expanded children nodes on. Okay, so now that we have the search algorithm that applies the value function as well as the policy function, we can now talk about how the Monte Carlo Tree search algorithm can actually act as a improvement operator on top of these guys here.

**[0:59:05] Dwarkesh Patel:** 20 years ago, Jane Street's data center fit in the corner of an office. Ron Minsky, who co-leads the tech group there, told me about how it all got started. One of our compute clusters we called the Hive. And I remember the first version of the Hive was literally like six Dell boxes stacked on top of each other at the end of the row. And the trading systems themselves we also had there because we actually wanted the ability to make sure we could turn the damn thing off.

**[0:59:30] Dwarkesh Patel:** I mean, there were ups and downs. Like literally at some point, you know, one of the people who was cleaning the office unplugged one of the trading systems in the middle of the day as they were vacuuming. So, you know, in the end, it is in fact better to have it all in a data center. Jane Street's data centers have come a long way since those six tells. And I got to tour one of them in Texas with Ron and Dan Panticorvo, who leads Jane Street's physical engineering team.

**[0:59:50] Dwarkesh Patel:** You know, these cabinets, these GB300 cabinets, consume at peak about 140 kW. Compare that to traditional air cooled, you're talking about 10 to 40 kW. It's a lot more. We got deep into the details of running one of these data centers, things that I had never considered before. It's filled with a liquid, a mix of distilled or deionized water and propylene glycol, 25 % of propylene glycol. that's to inhibit any bacteria or algae growth. I don't love the world where we have to worry about bacteria growing in our servers.

**[1:00:18] Dwarkesh Patel:** I got to see way more of what actually happens in a data center than I've ever seen before. Jane Street was willing to literally pull up the floorboards and take out the racks and take me to the back where all the chillers are. You can check all of this out at janestreet.com slash thwarkash, where we posted the full tour.

**[1:00:34] Eric Jang:** Okay, so we now talk about the RL part of how this thing gets stronger by playing itself, right? Let's say we play a game where the AI, so you make a move. AI will kind of compute the search and then this is this sort of visit count distribution. Let's say this is your policy, your initial policy recommendation at this node. And then after MCTS, it gets more confident about one of these actions, right? And so maybe the distribution looks a bit more peaky like this, based on the search.

**[1:01:15] Eric Jang:** Now, of course, you can tune the search process so that it ends up more diffuse, but that's probably not a good idea. MCTS should get more confident about specific actions than others. But it, of course, might place a lot of weight on other actions initially. And then as you increase the number of SIMs, it should converge to a very peaky distribution. So this is your new, let's call this like, let's wrap this in like a MCTS operator of A given S, right?

**[1:01:45] Eric Jang:** So after applying MCTS process, your policy recommended distribution looks like this. It's a bit more peaky than the previous one. And so then you take the argmax, or maybe you just sample from this. It doesn't have to be argmax, and then you make your move. And then you throw away the tree, And then you begin a new on the next move, right? So again, you compute a new distribution. So initially, maybe your guess looks like this.

**[1:02:23] Eric Jang:** And then you refine it through MCTS.

**[1:02:28] Dwarkesh Patel:** There should be one more x on the board, right?

**[1:02:30] Eric Jang:** I'm sorry, that's correct, yes. to something that looks like, right? So on every move, you have your initial guess from your policy network. And then the search process that combines your policy network and your value network arrives at a more confident action that you take. And then so and so forth. And then the game ends and one person wins and one person loses. So the beauty of how AlphaGo trains itself is that it actually can take this final search process, the outcome of the search process, and tell the policy network, hey, instead of having MCTS do all this legwork to arrive here, why don't you just predict that from the get-go?

**[1:03:16] Eric Jang:** Why don't you not use this guess and just predict this to begin with? And if you have this guess to begin with in your policy network, then MCTS has to do a lot less work to get things to work. And so if we draw a sort of test time scaling plot, so let's say like this is like number of simulations. Let's say, you know, at zero simulations, your sort of implicit win rate is like, I don't know, here.

**[1:03:42] Eric Jang:** And then, without any, if you just take this raw action, this is what your winning rate is. And let's say as we increase the number of sims, maybe you kind of have a win rate that looks like this, right? So when you search for, let's say, 1 ,000 simulation steps, that gets you to a policy here that gets you to here, which is great. But if you were to distill this MCTS policy network back into your sort of shoot from the hip policy network, then you could actually start here.

**[1:04:21] Eric Jang:** like if let's say this was zero by distillation, then if you spend another 1 ,000 SIM steps, then you actually kind of get to here. It's almost like if you could just amortize the first 1 ,000 steps actually into the policy network instead of the search process, then you can begin at a much better starting point and then get a much better result for the number of SIMs that you put.

**[1:04:46] Dwarkesh Patel:** The save more type nature of test time scaling as the number of simulations increases, the increase in win rate is smaller. Is that true even for the distilled network? That is to say, is there some gain of like, okay, we start from the distilled, we get these early gains again, or is that just inherent to like the nature of MCTS?

**[1:05:03] Eric Jang:** To be honest, I actually don't know the test time scaling behavior of MCTS simulations. And I believe it might actually be quite sensitive to how strong this one is in practice. I'm just drawing a monotonically increasing function that gets to one. So don't pay too much attention to the shape of the curve. Just know that it's monotonic with respect to C. Okay, so the idea of MCTS is very brilliant, which is like we got something better by applying search.

**[1:05:30] Eric Jang:** And we're going to now, on our next iteration of updating this network, just train this to approximate the outcome of 1 ,000 steps of search. And so instead of starting here, we get to now have a neural network start here, and then the play gets stronger once we then apply another 1 ,000 steps on top of it. And you can keep going, right? So the training algorithm for AlphaGo is to basically take the games where you've applied the search on every move that the policy encountered, whether you won or lost, and that's quite important.

**[1:06:00] Eric Jang:** And you're just gonna train the model to imitate the search process. So there's an analogy to robotics actually, which is the dagger algorithm. First I'm gonna draw a schematic of, let's say, the states, right? So S0, S1, S2, S3. So let's say we took a series of actions in an MDP to get a trajectory. And these actions may be suboptimal, right? Maybe we lost at the end of this game. So there is a family of algorithms that basically take trajectories and and relabel the actions to better trajectories.

**[1:06:45] Eric Jang:** So maybe a better action here would have been to take A0', a better action here would have been to take A1', and yet another one like A2', A3'. So what MCTS is doing is basically saying, like you play this game where you eventually lost, but on every single action, I'm gonna give you a strictly better action that you should take instead. It does not guarantee that you are going to win, but it does guarantee that if you take these tuples as training data so that you retrain your policy network to predict these ones instead of these ones, you're gonna do better.

**[1:07:26] Eric Jang:** And this is very related to Dagger in robotics and imitation learning, where you want to collect a intervention here. And even if you're in a not great state, for example, like a self-driving car that veers off the side of the road, there is still a valid action that kind of corrects you and brings you back.

**[1:07:42] Dwarkesh Patel:** Yeah. Okay. So, pedantic question. But is there a guarantee that MCTS must be better than the policy? For example, you could imagine early on in training, because MCTS is informed by the value network, early on in training, when the value network hasn't been well-trained on finished games, that MCTS is worse than sort of randomly standardized policy. So is it just like a heuristic that MCTS is better than the policy? or is there some guarantee?

**[1:08:10] Eric Jang:** Right. In practice, it is a heuristic, and it does work also in practice, but let me illustrate an example where MCTS can give you a worse distribution than your policy network. And this can often happen if your self-play algorithm has trained to a good point, but then somehow it collapses because it's not trained on diverse data or something. So let's say we have a board state where the policy recommendations here are very good. So like, you know, pi of AS is like, great.

**[1:08:43] Eric Jang:** But somehow, because maybe we're playing on a lot of games where the bots just resign instead of playing all the way to the Trump Taylor resolution, they kind of forget how to evaluate those kind of late stage plans, right? Like in the case that we showed with the corner play, maybe like 100 % of our training data in our replay buffer has lost examples of how to evaluate the value function at those states. So you might end up in a scenario where your terminal value is very bad.

**[1:09:13] Eric Jang:** And if the terminal values of the leaves are not good, then this will actually propagate all the way up and cause your puck selection criteria and your backups to be off. And then you end up visiting a very, very different distribution than what your policy initially recommended. Also, if your number of sims is low, then you might also have a variance issue where you just don't explore enough. Like it's only guaranteed to converge when you kind of take end to infinity.

**[1:09:41] Eric Jang:** So variance in your search process as well as inaccuracies in your evaluation can definitely screw with the quality of your policy network. And so that's why it's not a guarantee to improve. And that is why I suspect why AlphaGo Lee had the playouts to the end in their training algorithm so they could ground this thing in real plants. Yeah. In practice, what you could also do is just like for 10 % of the games, you prevent the bots from resigning and you just say like, resolve it to the end.

**[1:10:09] Eric Jang:** So you get some training data in your replay buffer to really resolve those kind of like late stage play outs that normal human players would kind of not play to. Yeah, yeah. So this is why MCTS kind of, if you assume that the value functions are correct, why it gives you a better policy is because, and it's a very critical chain of assumptions. Assuming that this is accurate, then your search process should give you a better recommendation than your initial guess.

**[1:10:36] Eric Jang:** Right.

**[1:10:36] Dwarkesh Patel:** Okay, so if you have a cold-started policy, if you have an AlphaZero type thing, really what's happening for the first few epochs is the policy is kind of useless, and what you're really just doing is, hey, but let's play full games. And once we have played full games, for the preceding moves, we'll have labeled who won, who didn't win. and the loss for AlphaZero has two components, which is like, how good is the policy relative to MCTS?

**[1:11:04] Dwarkesh Patel:** And how good is the value prediction relative to who actually won the game from this move? And this is sort of like, you can think of this being applied to every single action or every single move. And really what's happening in the beginning of AlphaZero training is just like, we're trying to get the value function to actually predict who will win the game if you find yourself in this state and you're this player. and functionally that's all that's happening and later on, once that's well trained, now the policy is also improving.

**[1:11:31] Dwarkesh Patel:** Correct. Okay.

**[1:11:32] Eric Jang:** One trick I did find to be pretty useful and this is not a peer-reviewed claim so just like take this with a grain of salt is like I found it useful in my own implementation to do the following. You want to first make sure that this is good before you invest a lot of cycles doing MCTLs, right? Like it doesn't really make a lot of sense to do search on garbage value predictions. So you want to kind of start at a good place where this works.

**[1:11:55] Eric Jang:** AlphaGo lead does a very good thing where it just takes human games and then you train on it and it just works, right? Totally works. You can also take an open source go bot, play it against itself, generate data, also works. So if you have some offline data set that has realistic good play, you can easily learn the late stage value functions pretty well. And that's what you kind of need to start the search process. Sorry, can you just read this in some more time?

**[1:12:22] Eric Jang:** Sure. So it's quite easy to evaluate a late-stage Go game. Like when almost all the pieces are on the board, it's almost like a decidable problem, right? Because there's a lower and lower uncertainty as to the depth of the tree. So most games played to the end by reasonable people will be good training data to train a good value function at terminal parts of the tree. Got it, okay. Then as you play more games, the search will back up good values into the sort of intermediate nodes of the tree.

**[1:12:51] Eric Jang:** And then as you increase the amount of data, your value head gets a good intuition of what is a healthy board state versus a not healthy board state. Those are much more subtle to judge in the mid-game than the beginning or the end. So the most difficult part to score is not the beginning because the beginning is just obviously 0.5 and then at the end it's pretty obvious who's winning. So the hard part that you want to learn in the value function is who is winning in the middle.

**[1:13:15] Eric Jang:** And so this is actually very analogous to TD learning. Yes, and there's a beautiful connection to TD learning that we can talk about in a bit, as opposed to, you know, contrasting with Monte Carlo Tree Search. So, you first want to get good value functions, and expert data can kind of give you a quick shortcut. I recommend for, you know, practitioners just do that first, just to initialize to a good starting point. And then if you want to do the AlphaZero thing or Cotigo kind of tabula rasa learning, then what you can try to do is on a small board, play random games, just take a random agent.

**[1:13:45] Eric Jang:** And if you play like, you know, 50 ,000 games, you'll actually learn a pretty good value function as well. Because on a 9x9 board, there's actually, you can see enough of the common patterns with random play. And then if you train a model that kind of can train on both 9x9 and 19x9 data, and Katago proposed one of these architectures, then there's some pretty good transfer learning from the value head evaluated at 9x9 to the 19x9.

**[1:14:12] Dwarkesh Patel:** Right, because this unlike other games has very much a sense of like, there's not like a new kind of piece that is introduced when you increase the size or something.

**[1:14:20] Eric Jang:** If we take it to its limit and consider like a very tiny 4x4 Go board, like if you play 50 ,000 games, you're going to have a lot of end states that look like human play. It's just like tic-tac-toe at that point. So if you broaden this a little bit to 5x5 or 9x9, it's not unrealistic to imagine that purely random play will actually generate pretty reasonable looking boards. and then so you can score those pretty easily.

**[1:14:42] Eric Jang:** And so that is what gives you the bootstrapping to be able to then improve your policy with search. But it's very, very critical that MCTS has accurate value estimates. And you need to ground the value. Ultimately, MCTS will fall apart if you don't have a grounding function for the value.

**[1:14:59] Dwarkesh Patel:** I'd be curious how much compute you save by training the value and policy on the same network that because they share the same representations, how much more efficient learning is? because that would be interesting if they're basically kind of... We've just talked about how they're kind of making similar predictions or they shouldn't be in line with each other. And so I'd be curious if actually you're halving the amount of compute you had to do by giving them the same network.

**[1:15:21] Eric Jang:** Right. AlphaGo Li, the original AlphaGo paper, had two separate networks. And then in all subsequent papers, they merged them into two heads. And presumably this saves compute. But answering that question in a very rigorous scientific way is actually... It's a simple question, but in practice actually takes... Like if you really want to chase that question down to its limit, it takes quite a bit of work to really resolve that. But intuitively, yes, they share a lot of representations.

**[1:15:47] Eric Jang:** And as we mentioned, there is a sort of like your policy network and your value network when doing evaluation should kind of agree, right? So there really should be this sort of consistency between them. Yeah. Could I believe this is the wrong way to think about it?

**[1:16:00] Dwarkesh Patel:** I feel like when I learn how an LLM works and how simple RLVR is, at least as an algorithm, how simple it is, I'm sort of stunned by the kinds of things it can do, that it can learn how to build very complicated code repositories and whatever simply from getting a yes-no. And here, I feel like if you understand it more deeply of just predicting MCTS, it actually seems, Awful Go seems less impressive in retrospect the more you understand it, because you're like, oh, you're putting in a lot of bias by just saying how much you, you're like telling it how it should titrate exploration as things go on.

**[1:16:38] Dwarkesh Patel:** You're building this very explicit tree search for it. And so I don't know if you share that intuition where it actually, the more you understand it, the less impressive the accomplishment in 2017 seems. I personally disagree. I think

**[1:16:52] Eric Jang:** I think they're profound for different reasons. And I don't understand the LM RL enough to comment on your podcast about it. But I think AlphaGo, so why is it a profound accomplishment? I think maybe it's worth stepping back a little bit and just like, it is different than modern RL and we can talk a little bit about some of the algorithmic choices there. But I think the most profound thing here is that a 10 layer neural network pass, so basically 10 steps of reasoning.

**[1:17:25] Eric Jang:** Yeah. And of course, the reasoning is not just one trail of thought. It could be like the distributed representations and a lot of thoughts going on at the same time. But by construction, let's say a 10 layer neural network can only do 10 sequential steps of thinking, right? 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. So this was a breakthrough that I think most people don't even understand today, like fully comprehend how profound that accomplishment is.

**[1:18:01] Eric Jang:** And this is what also girds AlphaFold, for example, where you have a very, very difficult physical simulation process that you would need to roll out so many micro-scale simulations, and yet 10 steps of a somewhat small neural network can somehow capture what feels like a, you know, MP class problem into a single problem. And so it actually makes me wonder if, you know, our understanding of problems like P equals NP or, you know, these very fundamental, like, computational hardness problems are incomplete, right?

**[1:18:38] Eric Jang:** Like, it's not like, you know, obviously this is not a proof of, like, P equals NP or anything, but there's something to it that, like, kind of is very disturbing where like what felt like a very hard problem can fall to a very, very simple macroscopic simulation.

**[1:18:52] Dwarkesh Patel:** Yeah. That is a very interesting insight that a lot of problems which are proven to be NP-hard, like I don't know if Go is proven to be NP-hard, but protein folding, et cetera, have been like neural networks can solve them because they're NP-hard in the worst case, but we're not dealing with the worst. We're usually not concerned with the worst case. We're, you know, like these problems have a lot of structure to them.

**[1:19:12] Eric Jang:** Yeah, I think that the kind of question we should be asking ourselves is like, we've been formulating, you know, solutions to MP hard problems as in like kind of worst case complexity. And I wouldn't say, you know, this solves go, right? It doesn't give us a exact solution of the optimum. But in practice, like it is extremely useful. And the same thing has been shown in like alpha tensor, alpha fold, where like, yes, there is a very hard problem that in the worst case seems intractable.

**[1:19:40] Eric Jang:** And yet we're able to make like almost arbitrary amounts of progress. So here's a sort of like, you know, In the limit, what might this look like, right? Well, if you want to simulate something very complex like weather or predict the future, like do we live in a simulation or not? The computing resources you need to build a very complex simulation might be much smaller than you think, based on our ability to amortize a lot of that computation into the forward pass of a single network.

**[1:20:09] Eric Jang:** So to me, AlphaGo was the first paper that kind of like really showed this like profound level of, you know, simulation being compressed into a small amount of...

**[1:20:19] Dwarkesh Patel:** I feel totally not at all qualified on the computational complexity of the math to comment on this. But I wonder if there's an important role of chaos here where if... What is the problem with weather? And why does it take 10x the amount of resources to predict weather a day out? And continually so for every more day out. It's because it's a chaotic system And so small perturbations can totally change the final estimate as time goes on.

**[1:20:49] Dwarkesh Patel:** And I guess it's interesting. Well, I guess you would expect that for Go and protein folding as well.

**[1:20:54] Eric Jang:** So here's an analogy to weather that might be relevant in Go. So the problem of like, you know, here's our current board state. Yeah. Given what we know about both players, what is the board state in the future? Yeah. What is the exact board state in the future? Yeah. Right? This is extremely sensitive to initial conditions. Yeah. Like a single stone place here can kind of disrupt the entire prediction. Yeah. Right? So this is hard. This is kind of intuitively the chaotic problem.

**[1:21:26] Eric Jang:** And yet somehow, so this is hard. Somehow we can predict who's going to win. Yeah. Like, and this captures a lot of possibilities here. And so there's this more macroscopic quantity that we really care about, which is the average or expectation or some sort of global macro structure over a lot of possible futures.

**[1:21:48] Dwarkesh Patel:** That's an interesting way to think about it.

**[1:21:49] Eric Jang:** And so in weather, it could be the same thing, right? We don't exactly care what the velocity of wind 6 ,000 feet above a specific latitude, longitude is. We kind of care where's the hurricane or things like that. And I would say in chaos, there's a classic Lorenzo tractor, which kind of looks like this, right? Yes, if you start anywhere on the Lorenzo tractor, you don't know where you're going to end up. But you do know that the thing looks like this.

**[1:22:16] Eric Jang:** And so there's this kind of beauty of like, sometimes we don't necessarily care about the microscale things. We actually care about the macroscopic structure. And these things can be predictable.

**[1:22:26] Dwarkesh Patel:** And contrast that, say, to something like a hash function, which is also incredibly dependent on initial conditions, but doesn't have a macrostructure, or at least hopefully if the arguments work. Yes, one would hope. And so there's like no equivalent of a value function or like broadly how's the weather going to be that is interesting there. It's really just about what is the move, what is a board going to look like 100 moves from now exactly.

**[1:22:50] Eric Jang:** Yes, intuitively that seems correct. And then again, this is also out of my area of expertise. But I find it interesting that cryptography has not been able to... The tools of cryptography and hashing have also not been able to prove that you cannot come up with fast approximations. Like you cannot come up with fast approximations. If they were able to do that, then you could prove P is not equal to MP.

**[1:23:17] Dwarkesh Patel:** In fact, we know that there's structure in many cryptographic protocols, obviously like RSA cryptography. there is structure and that structure is what quantum computers exploit to break them right I see um Reiner has a very interesting blog post which we talked about in the episode where he uh talks about how if you look at at a high level what cryptographic protocols look like and what neural networks look like it's extremely similar where you have sequential layers of jumbling information together and it's because there's this conversion devolution in the algorithms where in cryptography you want the final state to be incredibly sensitive to initial conditions so that it can come out sort of looking jumbled based on if you change anything.

**[1:24:00] Dwarkesh Patel:** And then neural networks, you similarly want everything to be dependent on all the information because you want to process all the information and consider how it relates to itself.

**[1:24:08] Eric Jang:** Yeah, you have the maximum power of a neural network at the edge of chaos. I think there's some like research papers from Joshua Stoltec on this. Yeah, there's something kind of quite fundamental about chaos that is, it's not just like hopeless noise. It's like there's something kind of useful in chaotic systems, at least at that boundary. But yeah, this is just my thing about this as a philosophy. I don't actually know the math well enough to comment on it.

**[1:24:35] Eric Jang:** Anyway, if we go back to, we'll talk about LMRL a little bit because there's some connections there. But let's just go back to the MCTS. What is it doing? It is not, crucially, it is not saying we're going to increase the probability of winning directly. It's not going to say like we're going to upweight all actions that won and downweight all actions that didn't win. Importantly, what it is doing is saying for every action we took, we did a pretty exhaustive search on MCTS to see if we could do better.

**[1:25:06] Eric Jang:** And we're just going to make every action that we took better by having the policy network predict that outcome instead. And so this is a very, very nice idea because you have one super vision target for every single action. Yeah. So the variance of your learning signal is very low compared to the alternative naive RL thing. So let's actually consider what, let's consider a very naive algorithm that looks a lot more like modern LLMRL today, where we do something like, let's take the winner of a self-play game and encourage it to do more of that.

**[1:25:39] Eric Jang:** Okay, so it's worth kind of thinking a little bit about, like, okay, what are some alternatives that we could do to train self-play agents instead of MCTS, right? Like, you know, we use a lot of LLM-style RL these days. Like, is that relevant? Could we do that instead? So let's think through this a little bit. Let's suppose we have a very naive algorithm where we take a league of agents of different checkpoints and we play them against each other.

**[1:26:02] Eric Jang:** And for the games where a single player wins, we're going to reinforce those actions up And then retrain the policy network to imitate those guys instead of the MCTS objective. So what ends up happening is, let's say you have a chain of actions that led to a win. And you have a matchup between two agents that are basically the same. So in fact, let's just assume that policy A and and policy B are evenly matched, right?

**[1:26:38] Eric Jang:** So their true win rate is like 50%. So let's say you play 100 games, and then each game, let's say, lasts 300 moves. And you're doing some sort of evolution strategy or some way to perturb these things to get them to do different things, or maybe you don't and you just play them against each other and you see like, occasionally this one might actually have a better strategy than this one, right? And so let's say, you know, 51 games, policy A wins.

**[1:27:21] Eric Jang:** And then 49 games, policy B wins. And this is just due to random luck or maybe you perturbed policy A in some way that let it do this. And just to have a very, very simple model, let's pretend that for 49 of the games, they played exactly equally. I'm sorry, for 50 of the games, they played exactly equally. And on that one game where this one won, it played slightly differently. It made one critical move that normally it would have done differently, but due to some exploration or some random noise, it just happened to make a smarter move than it did previously.

**[1:27:58] Eric Jang:** So you have one supervision signal, like one true supervision signal for your policy network. And then you have 99 games times 300 moves for which imitating those actions gives you exactly the same policy you had before. And so the scale of your variance is actually very bad because it's like you only have one label out of this enormous data set of actions, of supervision actions where you want... Actually, sorry, let me clarify a little bit.

**[1:28:31] Dwarkesh Patel:** Okay, so we were just talking about how the good move, the out-of-distribution move, is a small fraction of all the moves that are played across all the games on which you'd want to train. And this, of course, reminds me of how LLMs are trained with policy gradient methods. Karpathy, when he was on the podcast, called it like sucking supervision through a straw. And so, yeah, it's interesting that this thing you're saying which would be intractable and prevents you from actually getting beyond a certain level in Go is just by default how LLMs are trained?

**[1:29:03] Dwarkesh Patel:** Right.

**[1:29:04] Eric Jang:** So in this case, this is not to say it doesn't work. If you imagine increasing the number of games to millions of samples, you actually can get some meaningful supervision. Samples so long as you find a way to sort of mask out the supervision from these guys. And then this is where things start to get pretty related to RL in terms of advantage and baselines and so forth. So let's look at the gradient variance of a very naive approach like this, where I'm just gonna call it like gradient RL.

**[1:29:34] Eric Jang:** And it's basically the sum of rewards.

**[1:29:49] Dwarkesh Patel:** All right, I see what you're saying.

**[1:30:04] Eric Jang:** So the sum of rewards is the return, right? So like in our naive setup here, we only have an indicator variable for the return where either you won or lost. So in the case where you lost, well, you just don't train on, your gradient is zero, you don't train on those examples, and when you won, And then you try to predict those things, right? So you can think about this setup as a special case of this general formula here.

**[1:30:32] Eric Jang:** The trouble here is that this is very high variance because when you multiply these terms out, when you try to compute the variance of this, and so variance of the gradient is equal to expectation of squared minus, and just for simplicity, we can pretend this is like on average zero or something, if you're centering it at no signal. And the variance here basically means that you're taking the square of this product term, and so you end up with a term that kind of grows quadratically with t.

**[1:31:12] Eric Jang:** So variance, when you have a setup like this, this thing acts as a coupling effect on top of these terms here. So let's actually map this to an LLM case and we can answer like why do LLMs only do one step RL instead of a multi-step RL scenario. In LLMs, you have a decoder that might predict some words like, Hello world. And so in current LMRL, they treat this entire sequence as a single action, just AT, and big T is just one, right?

**[1:31:55] Eric Jang:** And so yes, it is true that because of how transformers are formulated through the product of conditional probabilities, we do have probability of this sequence is equal to the sort of sum of log probability of the whole sequence is equal to the sum of the probabilities of like, you know, individual tokens, right? So in this case, I would say something like, you know, log L plus log low plus log world. So this is true. And if this term were one, then they would be the same thing.

**[1:32:41] Eric Jang:** However, in sampling things, if you have a reward term assigned to every specific token, now you have these interaction effects between the cross multiplication of these terms and these terms. Right. And so the problem becomes, how do you ascribe the credit associated with every episode to all these different terms here?

**[1:33:02] Dwarkesh Patel:** I guess the thing I'm confused on is what would that even look like to do it that way in LLMs? Because you only do get a reward at the end of the episode.

**[1:33:13] Eric Jang:** You could imagine a reward that says, like, I'm going to give you some process supervision where you get a reward for each of these actions on every step.

**[1:33:23] Dwarkesh Patel:** Okay, so you're saying instead of doing it that way where you... Well, I guess the way you've written it, it would be a sum at the end anyways. So they wouldn't have to be multiplied. But you're saying instead of doing it that way, you would just add up this process rewards at the end and then treat that as one single reward signal?

**[1:33:39] Eric Jang:** Correct. For one single log-proc action.

**[1:33:42] Dwarkesh Patel:** But isn't that how it's written to begin with anyways? Like the sum of the rewards?

**[1:33:48] Eric Jang:** Yeah. So the thing that's a little bit hidden here in the math is that we're assuming that when you decompose the problem to a multi-step problem, that you're now introducing kind of correlations between your actions through the computation of this guy. And so if you separate these things out, then there will be, this will magnify the variance of this one. So in the case where you don't separate it out, if you just have t equals one, you just have a single estimate of logprop and a single estimate of reward.

**[1:34:17] Eric Jang:** Now, this term still shows up in, so in LLMs, it looks a little bit more like, the naive reinforced estimator looks a bit like return of the single action times, you know. It looks kind of like this. This is sort of the very basic form here, but this is still a contributor to variance. So you want to make sure that you don't, similar to how in this case, we were training on a lot of neutral labels.

**[1:34:51] Eric Jang:** You want to make sure that you're sort of penalizing the labels that don't help and only rewarding the ones that actually make you better. Right. So intuitively, the analogy here is like, can we find a term in our training objective such that it's actually kind of discouraged from doing this or, you know, these don't have any effect on the gradient and this has an effect on the gradient.

**[1:35:12] Dwarkesh Patel:** Right. I guess if you apply that there, the only thing you could do is eliminate 49 of the games. So at least the way you have it written there, it would be 51 times.

**[1:35:26] Eric Jang:** Actually, the optimal case is to pull out, discard all of these moves, and only get a gradient on that single move that you got better. Yeah, but how would you do that? Right, so this is a pretty tricky problem in practice. And so this is where advantage estimation happens in reinforcement learning. So you want to subtract a term from your multiplier. Instead of an indicator function of like 1 and 0, you want something that kind of behaves like a 0 for all of these guys.

**[1:36:02] Eric Jang:** And then a 1 for all of these ones.

**[1:36:04] Dwarkesh Patel:** So you could do that if you can say, hey, I won this game, so this is slightly above baseline performance. Well, you won on a lot of games.

**[1:36:14] Eric Jang:** Exactly. But you don't know which ones let you win because they were truly better versus winning on access. How would you design a baseline where it's truly better? Yeah. So this is where in RL people use things like TD learning to better approximate the quality function, the queue that we mentioned earlier. So you can try to subtract that from your return. I see. So ideally, what you really want to do is, in RL, you want to push up the actions that make you better than the average.

**[1:36:44] Eric Jang:** Yeah. And push down the actions that make you worse than the average. And they call this advantage. There are multiple ways to compute it. I highly recommend John Schulman's general advantage estimation paper as like a good treatment on how to think about various ways to compute it. But at the end of the day, you want to reduce variance by trying to make this smaller and so that it doesn't magnify the variance of this one.

**[1:37:08] Dwarkesh Patel:** So, but this requires you to have a very good estimate of what average performance from a state would look like. And this gets us back to the value function thing we were talking about earlier.

**[1:37:19] Eric Jang:** Right, and so this, keep in mind that in this case, this model-free RL setting is trying to solve a credit assignment problem where you don't know which actions were actually good and which ones were bad. 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. And so we can actually think about a completely different algorithm called Neural Fictitious Self Play, which was used to great effect in systems like AlphaStar and OpenAI's Dota.

**[1:37:52] Eric Jang:** Mm-hm. So let me talk a little bit about how you can kind of unify some of these RL ideas in the model free setting as well as the self-play setting. Okay, so what happens if you don't have the ability to easily search a tree, right? Like in Go, it's a perfectly observable game. You can easily construct a pretty deep tree that completely captures the game state. In a game like StarCraft, where you don't have really complete control over the binary, it's a little bit hard to do this, and I'm not even sure if it's a deterministic game, right?

**[1:38:22] Eric Jang:** So that makes this kind of difficult from a data structures perspective. So what is done instead is that the basic idea of supervising your actions with a better teacher is still there, right? So given neurofictitious, so we're going to talk a little bit about how neurofictitious self-play works. Same idea, we're gonna come up with better labels for each of the actions we took, just like in MCTS. But how do we derive the better labels? In MCTS, we perform search to, and assuming we have a good value function, the search will kind of give us a better result than our initial guess.

**[1:39:17] Eric Jang:** In a game where you can't easily simulate a search process, what they do instead is train what is known as a best response policy. So you fix your opponent. So let's say you're currently training Pi A against a strong opponent, Pi B. In StarCraft, maybe, like, you know, these are the Zergs and you're playing Protoss or something. So you fix your opponent, and you treat this as a classic model-free RL algorithm where your goal is just to beat this guy.

**[1:39:53] Eric Jang:** And so here, you use your standard TD learning style tricks or use PPO or any, actually, like, you know, model-free RL algorithm to try to hill climb against winning this player. And so you train, you train, basically, you have a reward function that's like, you know, return is like, you know, one if wins against IB. So this is no longer a self-play kind of problem, right? This is just like a fixed opponent, and you're just solving, trying to maximize a score against that, and then, you know, zero otherwise.

**[1:40:29] Eric Jang:** And so you have a sort of fixed environment where all you care about is just beating this guy. And once you have a good policy that you train with, pick your favorite model free R algorithm, PPO or SAC or any kind of mixture of the, or VMP or whatever, you now have a good policy that gives you a good label for what this one should do when playing against that player. And when you train multiple best response policies, you can basically then distill the RL algorithms into the labels for a given opponent.

**[1:41:03] Eric Jang:** So you might have, let's say, a best response policy against PIB, and then maybe you have a league of opponents like PIB, PI C, PI D. And you're gonna take the best response policy that you train against each of these fixed opponents. And for this one, you're going to supervise them with the label that this one would provide. So it's kind of like, this is almost like a proxy for your MCTS teacher, right? Instead of MCTS teacher, you use a model-free RL algorithm to find the best search that you could do to kind of beat your opponent.

**[1:41:37] Eric Jang:** And then finally you're distilling the policy here into what is known as like a mixed strategy where it's trying to basically average across all possible opponents you could play against. And this is what gives you something that can do no worse than an average selected opponent from the league. And so this gets around the problem of having to derive a teaching signal from MCTS, but it still fundamentally is about relabeling your states with better actions so that they improve your policy.

**[1:42:06] Dwarkesh Patel:** And just to make sure you understand, this is like, if you win against this other policy, you sort of reinforce all the actions on that trajectory.

**[1:42:15] Eric Jang:** Yes. So here you can use a number of algorithms like PPO, VMPO, Q-learning, even if you want. Like the specific algorithm here can be, it's usually a model free thing because you don't have search. But there's an interesting connection from MCTS and Q-learning that I wanna bring up. So in MCTS, you do something where you have a tree. And through the resolution of your value function at the leaves of the tree or your approximate leaves of the tree, you can kind of back up through the sequence of many sequences, and then obtain some sort of mean value estimate, right?

**[1:42:56] Eric Jang:** Your Q is kind of derived from the average of a bunch of simulations. In model-free algorithms, there is often a component of estimating a Q value. And so, Q values are often learned through TD learning. Although in PPO, the way that they do advantage estimation is not necessarily through a Bellman backup. But in Q-learning, there's this kind of very cool trick where you do, Q s a is backed up as r plus some discount factor times the max aq of your next step.

**[1:43:37] Eric Jang:** So intuitively, how this works is if you have an MDP, And then this is like terminal. What this is sort of saying is that like, the best action you can take at this state is equal to the reward you take for taking this action, plus the best that you can do at the next state. So there's a sort of recursive and dynamic programming property of MDPs. And you can train neural networks to basically try to enforce this consistency.

**[1:44:13] Eric Jang:** So you can say like, well, once I know the Q value of this action, I can then use that to kind of compute something about the Q value.

**[1:44:20] Dwarkesh Patel:** So when earlier I was like, hey, why are we training policy? Why don't we just train the value alone? That is what this is.

**[1:44:27] Eric Jang:** This is a algorithm for recovering value estimates of intermediate steps when you don't have the ability to do forward search. So you must collect a trajectory first of like n steps before you're able to do this trick. But the intuition is kind of the same, which is that like knowing something about the Q value here can tell you something about the Q value here. And indeed, you can recover a policy from a Q value. So you don't need to explicitly model the policy distribution.

**[1:44:55] Eric Jang:** You can actually recover the policy distribution by doing argmax over your Q values. Right, yep. So, queue learning or this kind of like approximate dynamic programming kind of propagates what you know about the future queues backward like this, right? And you can see that there's a sort of similar structure that goes on here where, in this case, you're planning over trajectories your agent hasn't actually been to yet. Whereas in this case, you're planning over trajectories your agent has visited.

**[1:45:23] Eric Jang:** Yeah. So, importantly, why does queue learning, why was queue learning a big deal, right? It's because historically, we just haven't had the ability to do search on fairly high-dimensional problems like robotics or whatever. So for a long time, we kind of make the assumption that like, okay, well, if we can't model the dynamics with like a world model or something, we're going to instead just collect trajectories and then plan with respect to the only number that really matters, which is reward.

**[1:45:48] Dwarkesh Patel:** Okay, so this is very interesting. And then to unify this with our discussion of LLMs. So with LLMs, you're doing something, you don't have Q values, but you're doing this sort of backwards learning where, hey, let's find the trajectories which pass some unit test in some coding environment. And then let's reinforce those trajectories. And then there's a huge difference between that and this forward approach with MCTS. And the reason you can do MCTS, and it's much more preferable to do MCTS because you can do it per move and make each move better rather than having to learn per trajectory and hope, you know, as Karpathy said, hope to learn this like...

**[1:46:24] Dwarkesh Patel:** Through a straw. Yeah, so you get the supervision through a straw. Basically, just upgrade all the tokens in a trajectory that might or might not have been relevant to getting the answer right. The reason you can do this much more sort of sample efficient, much more favorable thing with Go is that because MCTS works in Go, you basically know that, hey, if I just do search locally here and this search is sort of truncated at the end by this value function that works even if I haven't unfolded my whole trajectory.

**[1:46:54] Dwarkesh Patel:** I can just say this is my new policy and I can improve in a more iterative, like local way rather than having to unfold all these trajectories.

**[1:47:06] Eric Jang:** So there was some research, I think from Google in 2023, 2024, where they did try to apply tree structures to reasoning. Yeah. And I think it's, you know, the jury is still out as to whether this can ever work. So I would say we probably will see revisiting of this idea of forward search in the future. But there's two things that make MCTS very simple for Go, which is that value estimation is kind of concrete and you can determine it for real.

**[1:47:38] Eric Jang:** And then you can kind of sort of use it to truncate depth, as you said. And then the breadth is also determined. And what's kind of critical is that the action selection algorithm where you iteratively visit and grow the tree is well suited for the size of problem that Go is and the depth of the problem. But for something like LLM reasoning, Pucked might actually not be a good enough heuristic. It might be too greedy with local tokens and it might do something like, oh, only give you sort of obvious thoughts that are correct but not really solve your final problem.

**[1:48:11] Eric Jang:** So I would say the jury is probably still out on how, like, what the final instantiation of reasoning for LLMs would look like. And I wouldn't rule out that, like, this stuff could, you know, come back. But it's been hard.

**[1:48:21] Dwarkesh Patel:** Don't LLMs sort of natively learn to do MCTS where they'll try an approach and be like, oh, that doesn't work. Let's back up. Let's try this other thing and then go in the direction that proves to be more fruitful.

**[1:48:34] Eric Jang:** Yeah, certainly. I think that LLMs manage to do something that looks like real human reasoning without having to do an explicit tree structure. That being said, I think the idea of doing forward search and simulation to get a better sense of what is valuable might make a comeback, even though not exactly in the same instantiation as Alfga.

**[1:48:54] Dwarkesh Patel:** But just to make sure I understand the crux of it, like the breadth from the number of legal actions being wider and the depth from not being able to train a value function as easily because...

**[1:49:08] Eric Jang:** So here's an example where LMs break down. The CPUCK rule involves square root of n over one plus nA. In an LLM, you're most likely never gonna sample the same child more than once, right? So if you have, let's say, multi-steps of thinking, because language is so broad and open-ended, a sort of discrete set of actions is not really an appropriate choice for an LLM. Even though they're discrete tokens, it's just such a large number that this type of exploration heuristic is probably not the right thing to do to guide how to search down a tree.

**[1:49:42] Dwarkesh Patel:** Right. But I guess the crux comes down to the fact that in Go, you know that the MCTS is almost certainly better than your current policy, even though you haven't gotten, even though you haven't explored the end of any trajectory. And then in normal reasoning for LLMs or robotics, there's no way to just locally evaluate and improve your next move in a way that doesn't result in, in a way that's independent of actually like solving the problem.

**[1:50:10] Eric Jang:** No way is a strong word. I think lots of people have thought about how to try to apply MCTS or its kind of successors like mu zero to continuous control spaces. And I'm sure, you know, very cool research work is still ongoing to try to crack that problem. But yes, the seeming challenge right now is that like most problems in much higher dimensional, you know, action spaces or something that's combinatorially much bigger like language, they don't seem as amenable to the kind of discrete action selection heuristics as well as kind of game evaluation type stuff that Go does.

**[1:50:44] Eric Jang:** But that's not to say the idea of like, you know, thinking into the future along multiple parallel tracks might not give you some information about like which way to search, right? Like if you think about mathematics, I think mathematics often occupies a little bit more of like a logical search kind of procedure where you kind of can back up. You can kind of see like which paths seem good or not. There's more of a rigid structure there.

**[1:51:05] Eric Jang:** Whereas maybe like in a, you know, business negotiation or something, it's less of a tree and maybe, you know, something a bit different.

**[1:51:14] Dwarkesh Patel:** Okay, so we're now seated so I can ask you some more questions about Afligo and about AI research more generally. in 2021 Andy Jones had a paper called Scaling, Scaling Loss for Board Games and he basically anticipated inference compute or inference scaling by showing that you can trade off test time compute and training compute that is to say that you can spend more compute on the searching through the MCTS and if you do that you can get the equivalent performance as having spent more time training the model and so if you see this pattern you might think okay well with LLMs you might do something like that in the future.

**[1:51:51] Dwarkesh Patel:** In fact, that's what ended up happening. Okay, so what is a kind of fun exploration one could do now to explore other axes of scaling in toy settings, which will be important to understanding what AI development might be like in a few years?

**[1:52:06] Eric Jang:** Sure, yeah. I think that indeed test time scaling and reasoning and how it interacts with model size are quite profound when it comes to like how much needs to be actually done as explicit search versus how much can be packed into the forward pass of a neural network, right? And how does a forward pass of a neural network sort of learn how to do something that should be a sort of sequential and recursive step? That's quite interesting.

**[1:52:34] Eric Jang:** Yeah. So the Andy Jones scaling laws for board games paper is quite cool. There's another really nice result from that paper where he showed that not only can you predict scaling loss of the sort of LLM variety where as you increase parameters, you can decrease the amount of compute for search or vice versa. He also showed that you can actually predict how much compute is needed to solve a larger version of the board game, for example.

**[1:53:00] Eric Jang:** And so with Go, which can scale from three by three to infinitely sized Go board, you might actually be able to sort of revisit this question and try to reproduce whether this shows up. You know, I actually started this project with this sort of a motivation that like, does the bitter lesson or does our knowledge of scaling laws allow us to kind of execute a lot better on a sort of compute optimal Go bot? And can we kind of build a strong Go bot without all of the KataGo tricks, right?

**[1:53:25] Eric Jang:** Just by really focusing on the bitter lesson and the scaling laws. I have not been successful so far, but I think it's sort of a fact that like, usually when you want scaling laws to work, you want to be in the regime where the recipe already works and the data sets are good rather than trying to kind of figure out how to do scaling while also trying to figure out what the right data set are. So this is like the scientific understanding component in research often follows a step where you get something to work first and then you use that system to collect data that then helps you build a mental model of how things work such as scaling laws,

**[1:53:59] Eric Jang:** right? And so usually actually if you want to build a strong GoBot using scaling laws, you actually have to make a strong GoBot first and then use the scaling laws to kind of extrapolate a bit farther into the future.

**[1:54:08] Dwarkesh Patel:** Say more, just so I understand, first of all, you're saying scaling laws did not work or you could not, there was no scaling laws pattern that you could see in your robot?

**[1:54:17] Eric Jang:** Yeah, so a mistake I made initially when I had some bugs around how MCTS labeling was working was I would collect a bunch of data with an expert policy and then treat it as a supervised learning problem and try to identify scaling laws with expert data sets. You can indeed plot things that look kind of like this, but if you're in a regime where, you know, your policy is not working well, you might be just studying scaling laws on like bad data, right?

**[1:54:40] Eric Jang:** So just like one important implementation detail is that if you want to study a scaling laws problem, you kind of have to have a problem for which like the data is good, the architecture is good, and there's no bugs, and then like you solve it there. Ex ante, I wasn't able to like apply scaling laws to direct what to look at until, you know, I had the rest of the system working. And this sounds obvious. Like to researchers, of course, you want to have like a working bug-free system before you study skilling.

**[1:55:08] Eric Jang:** But just as a sort of advice for practitioners on like where I actually tripped up when I started this project was you don't necessarily want to kind of jump into the science of studying your man-made artifact before your man-made artifact is like interesting enough to be studied.

**[1:55:20] Dwarkesh Patel:** Speaking of compute, so if you can look at these charts of compute used to train the best AI model in the world over time going back 10 years. And it's a very smooth line in log space that is exponentially growing year over year. Except there's this huge aberration, and that aberration is off-label zero, which is trained on way more compute than any other AI model at the time. It was like three E23 flops. It's sort of comparable to like a Frontier LLM.

**[1:55:52] Dwarkesh Patel:** I mean, orders of magnitude off, but still. And so, yeah, the question is, especially with you being able to get something off and did you train it on your own?

**[1:56:01] Eric Jang:** I got a donation from Prime Intellect for about 10k and then I spent maybe the first 4k doing kind of exploratory research and then about 3k on the kind of final run. And then some of it

**[1:56:16] Dwarkesh Patel:** remaining for serving the model. Cool. Yeah, is there a sense that they were just did a bad job

**[1:56:21] Eric Jang:** training it if you can do it in 10k now? The compute required to be the first to do something is always much larger than the compute it takes to catch up. And it's the same story playing out in LMs, right? Like once someone else has done it, you could use tricks like distillation, you could use all sorts of like kind of crutches to kind of bootstrap your way to success. So with my own bot that I've hosted online, I actually used sort of best response training against the Katago models to kind of get a strong level performance.

**[1:56:49] Eric Jang:** And as a time of recording, I'm validating whether this can be, I can kind of do that first step, which is to do the tabula rasa. But importantly for research, you often want to start from a good in it. So the kind of simple thing I did first was train best response agents against Kotago. Yeah. AlphaZero team, they did not have any policy that they could train against, right? Because they were trying to do everything tabula rasa.

**[1:57:09] Eric Jang:** So, and being the first to do it means that you're prioritizing getting the thing working rather than like, let's say the most compute efficient possible implementation. So this actually plays out in robotics as well. Like if you look at the kind of frontier of large models trained for robotics, The scatter plot is all over the place and there isn't a very clean line the way that there is for frontier LLMs. And that is because the folks training these models often are not at the scale where every flop counts and they need to kind of squeeze out the performance of every single flop as the dominating deciding factor in pre-training.

**[1:57:42] Eric Jang:** Instead their focus is more like we want a certain capability to show up, so we optimize the training setup to kind of make it easy to derive that capability. And once you have that capability, well, invariably if you scale up the compute, you are forced to kind of make it compute efficient because this is like hundreds of millions of dollars we're talking about. But in the past when compute for experiments was kind of more plentiful or not accounted in a way that the researcher was really responsible for, then you kind of end up with people optimizing for things besides kind of being on the compute optimal pre-do frontier.

**[1:58:15] Eric Jang:** I see, like speed or something. Yeah, like time to result or just getting to work. I think the first AlphaGo, like, probably they had lots of compute and they didn't need to be, they didn't need to worry too much about making it the most compute optimal thing.

**[1:58:27] Dwarkesh Patel:** And how much of the improvements to compute efficiency are methods that did not exist as of 2017 versus things which they could have done in 2017, but...

**[1:58:35] Eric Jang:** Yeah, great question. So going into this project, I kind of knew in the back of my mind that, like, things always get easier to do over time. And I want to see, like, where is Goat given that, like, It didn't seem like there has been any major open source strong bot after Katago in 2020. And then reading the Katago paper, there's a lot of clever ideas. I was kind of wondering, okay, let's see if the bitter lesson has happened where a lot of these tricks just sort of go away because NVIDIA made faster GPUs.

**[1:59:02] Eric Jang:** And so roughly, where are we on that? So again, this is not a peer-reviewed claim. So this is just my preliminary vibe guess on what I've seen based on my own experiments. But it seems like architecture choices don't matter that much. Transformer versus ResNet. We're at the sort of speed of GPU where the size of the model is not so big that this really matters. You can actually simplify the setup quite a lot. So instead of doing a distributed asynchronous RL setup with replay buffers and pushers and collectors, you can kind of do a dumb synchronous thing where you'd like collect, you just train a supervised learning model, and then you collect again.

**[1:59:41] Eric Jang:** And so there's opportunities to simplify infrastructure. NVIDIA GPUs have indeed got faster. So whereas KataGo was trained on V100s, you can train on half the number of desktop Blackwell GPUs and it still works. And some of the auxiliary supervision objectives that KataGo developed aren't really necessary if you have a strong initialization. So if you're initializing against best response training against KataGo itself, then your own model actually needs none of the tricks that Kotago needs. Yeah, yeah.

**[2:00:12] Eric Jang:** So then the core thing is like, how can you get as quickly as possible to some strong opponents? And that matters a lot more than the specific architectural innovations. But there are still some nice compute multipliers. So I found that training on 9x9 boards was very nice for resolving endgame value functions. And then like if you can co-train that on an architecture that can transfer between 9x9 and 19x19, then you can really cut down the warm start time to learn that from scratch.

**[2:00:36] Eric Jang:** I think AlphaGo Zero, their plot was first 30 hours or so are spent basically catching up to the supervised learning baseline. And you can cut down that time a lot by kind of pre-training on a small board, and then like, you know, warm starting that into your 19 by 19 board play. There was some other stuff like, you know, varying the number of sims between episodes. This turns out to be not that sensitive actually, like you can kind of, you know, fix it or increase it.

**[2:01:04] Eric Jang:** Doesn't matter too much. But so anyway, it's kind of just nice from a scientific perspective, just revisiting like an old paper and seeing like what really

**[2:01:10] Dwarkesh Patel:** matters. This is a sort of tendential question, but why is it okay to have a buffer in Off-Fligo? Because every time I talk to any research here, they're telling me about how bad it is to be off policy. But then the way, and I even implement an intention of Off-Fligo 0 would work, is that most of the moves in a given backward step or in a batch of backward steps would be not among the ones that were made by the most recently trained model.

**[2:01:37] Dwarkesh Patel:** So why is that okay? Great question.

**[2:01:39] Eric Jang:** Yeah. And this gets into the sort of fundamental off policy versus on policy reinforcement learning kind of questions. So as you recall in MCTS, you take actions that you took and you relabel them to take different actions on the same states, right? So the off policy part here comes where what if you're relabeling states that your new policy would never visit, right? Like what's the point? You're kind of wasting capacity. And in the extreme limit, imagine your distribution of states in your training buffer are all states that you would never visit.

**[2:02:10] Eric Jang:** Then you're basically supervising them to take good actions on states you would never achieve, and therefore your policy can get really bad, right? So this is where off policy can really hurt AlphaGo. However, if you interpret this sort of from like the Dagger perspective, which is basically saying like a way to kind of correct yourself back to the optimal trajectory, given some data, what you kind of want in an algorithm like this is to have mostly states that you would visit, but then you have a small percentage or maybe a reasonable percentage of states in this kind of high dimensional tube around your optimal trajectories.

**[2:02:48] Eric Jang:** And any of those states are given a supervision target to kind of sort of funnel you back into your optimal trajectory. So maybe I can just draw quickly here. So in sort of a Dagger style setup, what your kind of optimal training data distribution is, is that here is your optimal states and actions. So this is like, you want to be in this state, you want to be in this state, you want to be in this state, and then you win here.

**[2:03:14] Eric Jang:** And then these are your optimal policy actions. So these are the things that you definitely want to train on. But to make it robust to disturbances, you want to make sure that if you happen to drift off into some other states, you can kind of funnel yourself back into... But why isn't this a fully general argument for off-policy training? This is actually why you want to do off-policy training sometimes. is that you don't want to have a compounding error where if you make a mistake, you don't have the data of how to return back to your optimal distribution.

**[2:03:43] Eric Jang:** And so optimal control does not really say too much about how to not accidentally get here because it's sort of making the assumption that once you learn the policy, you're gonna get it here. But in applications like robotics, like I don't know, a gust of wind blows you slightly off and then now you need to correct, right? Or the friction on one of your tires is kind of a little bit lower than the other wheel, and then now your car's drifting and you gotta correct it.

**[2:04:09] Eric Jang:** So these kind of things in more real environments often happen. Where like, actually there's a funny quote about chess and also Go. It's like, the problem with Go and chess is that the other player is always trying to do some shit. So things can kind of drift off, and you always want to be able to correct back to your winning condition. So your replay buffer really should have the states that your policy would visit, plus some distribution of states that you might drift to, and then how to return back to your optimal states.

**[2:04:42] Eric Jang:** Yeah. Now, if you take this to the extreme and you say, well, we don't have any of this data, and we're going to just be labeling with MCTS states that are so far away from our optimal behavior, like this bag of states over here, well, like now, yeah, I mean, like each of them gets MCTS label, and your policy learns how to take sort of the best possible action here, but you never get here. So like you're training your model on states you would never reach.

**[2:05:18] Eric Jang:** Like this is not there. So then this is a problem, right? And this is where off policy can really hurt. Yeah. So actually, as part of this project, I did try an experiment where I took a bunch of trajectories and to try to saturate the GPU as much as possible. What I did was I took random states from the data set and reran MCTS on just those states. So instead of playing a whole game where I'm doing MCTS on every move, I just ignore the sort of causality of moves and just pick random board states and I just label those with my current network.

**[2:05:50] Eric Jang:** And I might revisit old states that I've labeled before and relabel them again with my current network. And so in practice, this actually does work. You can actually say, let's take some states that are reasonable and constantly be relabeling them while we're training. And so this actually starts to converge on a very robotics like setup, which is very common, which is you have your data set of trajectories. And then you have something like a replay buffer pusher.

**[2:06:22] Eric Jang:** And these are off-policy, offline trajectories, right? So your replay buffer pusher pushes transition tuples to the replay buffer. And then you have some job that's kind of continuously And so in robotics, it's actually very common to use the sort of minimized TD error. So like your Bellman updater constantly is pulling things from here and trying to satisfy the QSA. So, and then from here you have your trainer, which is trying to fit the S to A, or fit the Q to the Q target.

**[2:07:23] Eric Jang:** So here you can think about this as a sort of planner, right? You revisit old states that you've been to, and you take your current model and you rethink, like, what could I have done better if I visited this? And so this is actually how kind of off-policy robotic learning systems are usually trained. These days there's a sort of simpler recipe, but like in the Google QtOp days we kind of did things like this. So what is the trainer?

**[2:07:48] Eric Jang:** Oh yeah, the trainer is you try to minimize QSA and QTarget.

**[2:07:57] Dwarkesh Patel:** Wait, can you explain the whole setup again? Like at the high level? Yeah. So you have your off-policy data that came from various policies.

**[2:08:04] Eric Jang:** You're constantly pushing transitions that you saw before to a replay buffer. And then you've got this thing called a Bellman updater, which basically replans, instead of this action, what action should I have taken at s to have a better value? And the way you enforce that is you try to minimize the TD error. So actually, given this, you have s prime, right? You compute q of s prime, and you find the action that should go with s prime that makes this q value as high as possible.

**[2:08:32] Eric Jang:** And then you add that to the reward here, and that gives you your actual target, right? So for this current S and A, your Q target is this. So now you have a, now you send back the Q target to this transition. So with this tuple, you pair with that a Q target. And then here on the trainer, you simply just use supervised learning and you minimize your current networks QSA with its target. Got it, okay.

**[2:09:01] Dwarkesh Patel:** So in the background, you're just like, hey, let me basically think through how valuable were all these actions actually?

**[2:09:07] Eric Jang:** Yeah. In a more optimal policy where you're trying to maximize this, what is the key target of this transition?

**[2:09:13] Dwarkesh Patel:** It's sort of like basically daydreaming.

**[2:09:14] Eric Jang:** Exactly. Yeah. You can think about it's like you're kind of going back in hindsight and being like, like, given what I've seen in the historical buffer, like, was there a better action I could have taken? Yeah. Now, the connection to Go here that I tried, and it was, you know, moderately successful, but too complex to kind of like open source was you replace this with like MCTS where instead of doing this kind of target network computation, you run MCTS on your transition, right?

**[2:09:46] Eric Jang:** So in this case, you have your state, your action, and then whether you want or not at the game. And actually, you can just toss these two. You don't care about these ones. You just take your state and you just plan MCTS to get your best policy, you know, pi on your current network, right? Not the network that took this action, but your current best policy network. You just rerun your search offline on these transitions. And if these are transitions that your policy can get to, then this actually acts as a very nice stabilizing effect.

**[2:10:21] Eric Jang:** And also, one other benefit is that you can kind of fully saturate your GPU better. because you're not like blocking on the go game to kind of like give you board states. You just simply search across all board states at any depth in peril. Yeah. So, and then here the trainer would be just, you know, predict the MCTS label as possible. So, again, like this kind of works and this is quite relevant in robotics where you're really, you just have a lot of offline data and you can't simulate things like MCTS.

**[2:10:47] Eric Jang:** But in practice, like it does run into the problem where, you know, like if the current model is looking at states that it would never reach, then it's kind of wasting capacity. And so you have to be a little bit careful here. So the on policy thing, and also much of RL has kind of converged to a much more on policy setup where they don't really try to like directly train on off policy data. At best, they use off policy data as a way to reduce variance, but not directly influence the objective.

**[2:11:13] Eric Jang:** I'm sorry, why have they converged to that? It's just more stable. Okay, yeah. Yeah, so you might use the off policy queue as a way to do advantage computation. like q minus like sum of q. That's kind of like your, or sorry, like sum of, like there's n actions and then, yeah. So like this is your value and then this is your kind of current q values. Your advantage for that action is like the average value minus your current one.

**[2:11:44] Eric Jang:** So like people can try to estimate q in an off policy way and then like just use advantage here. And then if there's a problem in these dynamics, it doesn't blow up your loss as much. And so in robotics, there's a kind of convergence towards more like using off policy data to just shape your rewards, but not actually be directly here.

**[2:12:03] Dwarkesh Patel:** I'm reminded now of our earlier conversation of why MCTS is so favorable as compared to the kind of reinforce or policy grading kind of thing LLMs do. And this might be totally wrong, but I wrote a blog post a few months ago about how RL, at least policy gradient RL, is even more inefficient than you might think. And so the inefficiency one thinks about naively is the fact that you have to roll out a whole trajectory in order to get any learning signal at all.

**[2:12:30] Dwarkesh Patel:** And so as these trajectories become longer and longer, as an agent has to, instead of just previously complete the next word in the sentence, it has to go instead to, hey, do two days worth of work to figure out if you even did this project correctly. the amount of information per flop has been decreasing. As you had to unroll two days' worth of thinking in order to see if you even did something correctly to like, did I implement this feature?

**[2:12:56] Dwarkesh Patel:** The amount of samples per flop has been decreasing. But so you can think of, you're trying to maximize as you're learning bits per flop, right? And this is, you can think of bits per flop as samples per flop times bits per sample. And what I just mentioned a second ago is that the samples per flop go down as RL becomes more and more along the horizon. But at least this kind of naive RL is also terrible from a bits per sample perspective.

**[2:13:39] Dwarkesh Patel:** And here's what I mean, at least compared to supervised learning. So early on in training, let's say you have a vocabulary size for an LLM that is 100K long. So there's 100K possible tokens that one could answer. And you have a totally untrained model. And you have a prompt like, the sky is. With supervised learning, what would happen is that the model would have some probability distribution over all the things it could say. there's a label that says actually the term here is blue.

**[2:14:13] Dwarkesh Patel:** And it would learn basically for cross-entropy loss exactly how far its distribution is from correctly saying blue. Now, if you were doing this through RL, you would say the model would try the sky is halicon. Nope, that's wrong. The sky is told. Nope, that's wrong. This is a totally untrained model, right? And so you would have to do this on the order of 100 ,000 times in order to just stumble on blue, then get some learning signal off of that.

**[2:14:42] Dwarkesh Patel:** So if you're in the supervised learning regime and you just get, you have your distribution of probabilities, you get told that it's blue and you figure out how far off you are, the amount you learn is a function of your pass rate. So like the further away you are from blue, the more you've learned to go towards blue using cross entropy loss. And so you can think of it as like your pass rate, your like prior probability of having said blue.

**[2:15:06] Dwarkesh Patel:** And as a function of that, like in supervised learning through cost entropy loss, you would learn negative log p, p being pass rate bits once you get this label. whereas in RL, if you're just randomly guessing shit and seeing if it works or not, that's just basically going to be the entropy of a binary random variable, which is...

**[2:15:36] Eric Jang:** And what's also tough here is that actually the distribution that you're sampling under is your policy's distribution. So it's like if your policy has no chance of sampling blue, then you will never get a signal.

**[2:15:48] Dwarkesh Patel:** Exactly. Right. So that's being modeled by the fact that your probability of sampling blue is extremely low. If you do sample it, you do learn as much as you would have learned in a supervised learning. In all other cases, like 99.99 % in an untrained model, you're just learning incredibly little from seeing halicon is not the correct word or told is not the correct word. And that's what happens most of the time. So you're just like, learn very little.

**[2:16:15] Dwarkesh Patel:** So if you try to graph, if you put on the x-axis your pass rate, and here you put the bits you're learning from a sample. If you have 0 % here, 50 % here, and 100 % here, so the end of trading, you're here. if you have supervised learning negative log pass rate would look something like this and then the binary random variable would look like this and this is depending on whether you're doing nats or bits yeah if you do bits it's like one right here at the peak this is like a coin flip you learn the most from a coin flip This is supervised learning.

**[2:17:10] Dwarkesh Patel:** This is RL. However, the problem is you spend most of training in this regime, right? Like in the low pass rate regime. And in fact, of how fast you're learning is a function, how many bits per sample you're getting. And you're getting very little signal here. if you chart the pass rate on a log scale, so you put the x-axis on a log scale, where like at the beginning of training with a vocab size of 100K, the pass rate is one over 100 ,000, then one over 10 ,000, one over 1 ,000, one over 100, and then, okay, what this graph looks like here, where supervised learning would look like this, and then RL, if you just basically crunch

**[2:18:06] Dwarkesh Patel:** what I just showed there, it would look like that.

**[2:18:11] Eric Jang:** Yeah, and arguably you spend all your time here. Exactly. Potentially never even getting a single success, right? Exactly. So it's a sort of depressing plot in the sense that once you're here, it's not at all obvious how you get to here. Yeah. Once you're here, you have something, but you actually, in many RL problems, spend all the time here. So there's a sort of question of like, how do you initialize so you're at least not at zero, but like at a non-zero pass rate.

**[2:18:37] Eric Jang:** One more thing I'd like to add about bits per sample that's very relevant to, you know, any kind of machine learning problem is that, and there's a connection to soft targets and distillation where if you have access to the logits, right, not just the one hot, like this is a sort of one hot token answer. If you have access to the soft targets, The entropy of this distribution is far, far higher than the one-hot. So there's actually way more information and bits per sample in a soft label.

**[2:19:10] Eric Jang:** So that's why distillation is so effective per sample, is that it's actually giving you way more information per sample.

**[2:19:16] Dwarkesh Patel:** Yeah, well, I wonder what the equation would be. But obviously it's...

**[2:19:19] Eric Jang:** It would just be the entropy of this distribution. So the entropy of this is zero. The entropy of this is like the entropy equation. And this is also why like, you know, AlphaGo is quite beautiful. In AlphaGo, you don't train the policy network to imitate the MCTS action, you train it to imitate the MCTS distribution. Interesting. But both of these are actually valid. And if you wanted to do a scientific experiment of like, how important are this kind of soft label, dark knowledge distillation, you can run an experiment where you retrain the policy network on the action MCTS selected rather than the software.

**[2:19:51] Dwarkesh Patel:** Interesting. Earlier, I was sort of stumbling around this intuitively. Why is this ability to do iterative search where you don't necessarily need to be able to win the game in the beginning? You just need to be able to improve your current policy. Why is that so powerful capability in learning as compared to how LLMs currently learn RL? And yeah, it's exactly this thing of this is considering your pass rate of the entire trajectory. I actually don't know a formal way to think about this.

**[2:20:24] Dwarkesh Patel:** Maybe you should help me out here.

**[2:20:25] Eric Jang:** Why is AlphaGo an elegant RL algorithm? So the major reason is that 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. And if you look at the actual implementation of AlphaGo, Every step of the way, there's actually no TD error learning or dynamic programming, at least explicitly. It's just supervised learning on a value classification as well as a policy KL minimization.

**[2:21:02] Eric Jang:** So it's just a supervised learning problem on improved labels. And so the training is very stable, right? You can train as big of a network as you want. You can kind of retrain this on the data set. Everything will just go stably. The infrastructure is very simple to implement as well. You don't need a complex distributed system to kind of keep everything on policy. At the end of the day, you're just saying like, I have some improved labels.

**[2:21:24] Eric Jang:** Let's retrain my supervised model on these targets. And so you're always in this beautiful regime where you're just trying to improve the policy, rather than escape this kind of like sort of local minima where every signal is flat all around you. So one way to draw the curve is like, if you draw the sort of win rate of an MCTS policy versus the raw network, let's say this dotted line is the raw network, the MCTS policy kind of looks like this.

**[2:21:50] Eric Jang:** And so every step of the way, this supervision signal is very clean. Right. You're never in a situation where, you know, the MCTS is kind of like giving you no signal. Yeah. Unless your MCTS distribution converges to exactly what your policy network brings.

**[2:22:06] Dwarkesh Patel:** Yeah, yeah, yeah. Okay, that's a great way to explain it. Cool. Okay, maybe we sit down and I ask some questions about automated research. Sounds good. One thing I really wanted to talk to you about is that you did a bunch of the research for this project through this kind of automated LLM coding assistant loop. And there's an idea that if you fully automated AI research, you could have some sort of singularity. Obviously, we're not there yet, but to the extent that we have early indications of what this process might look like, I am curious what your observations about what the AI is good at, what it's not good at, what you think about this scenario, its likelihood eventually, what

**[2:22:53] Dwarkesh Patel:** thoughts you have about this in general.

**[2:22:54] Eric Jang:** For sure, yeah. I think automated scientific research is one of the most exciting skills that the frontier labs are developing right now. And I think it's important for everyone who's doing any kind of research to get a good intuition of like what it can do now and what it can't and how might the sort of science process work in the future once we're having AIs automating a lot of this investigation. So in brief I mostly use Opus 4.6 and 4.7 throughout the working on this and what works is that the models can do a very good job of doing hyperparameter optimization.

**[2:23:28] Eric Jang:** So in the past people would kind of come up with a search base of hyperparameters like learning rate and you know weight decay and maybe how many layers are in your network and they would just kind of do a grid search or a sort of Bayesian hyperparameter optimization approach. And then it would find some tuned parameters. The kind of really cool thing that automated coding can do now is that it can search a much more open ended set of problems, right?

**[2:23:51] Eric Jang:** It can say like, well, I've identified that like the gradients are kind of small in this layer, so let me change it up here. Let me rewrite the code so the data loader has a new augmentation I came up with. Let's sort of try to find the best way to kind of fit the constraints of the optimization problem. And you end up with this much more flexible and kind of high level, almost like grad student like ability to just, you know, grind a performance metric.

**[2:24:15] Eric Jang:** And so this can squeeze out quite a lot of performance. You can, you know, on a fixed data set with a fixed time budget, improve perplexity by quite a lot on a sort of classification problem like LLMs or Go. And it is also fantastic now at basically executing any experiment, right? So I have a Claude skill that I wrote called experiment, where I give it a description of what I wanted to plot. And like I just described, here's the x axis I want, here's the y axis, answer this question for me.

**[2:24:43] Eric Jang:** And it'll go run off and do all the experiments, compile the plot, make a report, and suggest what might have caused it or so forth. So that's what works quite well today. And I think we can expect that these abilities get better in the future. But it's also kind of useful to know, you know, what is it not doing so well today? So on my blog version of this tutorial, I have a plot of basically all the kind of experiments I did grouped in a sort of tree where, you know, every node kind of represents a failed, successful, or sort of mixed experimental result.

**[2:25:11] Eric Jang:** And then from there, it branches off into a child where it's like the follow-on experiment. Occasionally, I'll kind of rabbit hole down a track like this off-policy MCTS relabeling, do a few experiments, and then realize it's probably not worth it. So then I'll kind of jump to a completely different track, right? And I call these kind of things like rows, right? So what I find is that current, you know, closed models that we can access, the public can access today, they don't seem to be that great at selecting what the next experiment should be in a given track.

**[2:25:39] Eric Jang:** And they don't seem to be able to kind of step back and do the lateral thinking of like, wait a minute, this track doesn't really make sense. Like, let's go back to sort of first principles and think about, you know, what the bottleneck might be or like what are we trying to achieve, right? And so often I had to catch infrabugs myself by prompting the right question to cloud to like investigate, you know, what is causing this discrepancy and then it'll answer the question.

**[2:26:02] Eric Jang:** I think with like, you know, mythos class models or mythos++ models coming online, maybe this just completely changes and these problems just fall to just improve skilling. But at the same time, I think there's a lot of like rich opportunity to develop RL environments that might incentivize this kind of lateral thinking. And so one of the motivations for setting up this Go environment was that I think that, you know, Go captures a lot of very interesting research problems, often overlapping with, you know, LLMs or robotics.

**[2:26:29] Eric Jang:** And yet it's like very quick to verify. The outer loop is ultimately like, does the agent do what I think it does? And you can kind of check the outcome of a Go game quite easily. And then the inner loop involves all this kind of like, you know, research engineering around distributed systems, predicting whether an idea is going to work or not, predicting the difference a particular modification to your training algorithm might make. And I think there's a rich library of subtasks and sub-environments that you can kind of train an automated scientist to work on with Go as a sort of outer verification loop that then once you acquire these skills, maybe you can apply them to like other

**[2:27:04] Eric Jang:** domains like biosciences or robotics.

**[2:27:07] Dwarkesh Patel:** Or automating AI research. Or automating AI research. Which is the real crux or the scary slash incredible thing of just making, AI is making future versions of AIs. And you're suggesting the outer loop here could just be your win rate

**[2:27:21] Eric Jang:** against KataGo, basically? That's one of them. I think there's a lot of deeper questions that one could tackle, right? So for example, let's say you have an idea on how to improve a scaling law compute multiplier. The outcome isn't necessarily like, I achieved the best GoBot ever. The outcome might just be like, can I predict what the win rate of my GoBot will be? Or can I predict the scaling law plots that emerge from my idea.

**[2:27:48] Eric Jang:** But then you can verify that you haven't kind of reward hacked anything by using a very verifiable game like Go on the outer loop.

**[2:27:53] Dwarkesh Patel:** I think there's a couple of interesting follow-on questions. There's questions on the inner loop and the outer loop. On the inner loop, there's a question of how locally verifiable any modification you might make is. That is to say, would you know whether something is actually improvement or degradation, some idea you try out? Would you know that if something isn't working as a result of a bug or is it the result of the idea itself being wrong?

**[2:28:20] Dwarkesh Patel:** Ilya was talking about why having, one of the reasons he thinks he's a good researcher is, he is a good researcher. One of the things he thinks makes him a good researcher is that he has intuition about, he has strong belief in what the correct idea is. And he is able to persevere through bugs and know which things are bugs versus mistakes in the fundamental idea based on his high level belief about this idea should work.

**[2:28:47] Dwarkesh Patel:** So therefore there has to be bug versus the other way around. Why don't we start with that question actually? Yeah. How locally verifiable are things which are good ideas?

**[2:28:56] Eric Jang:** Yeah, I think as in the case of the success story for deep learning, you can think about this as like a decades long idea that took a lot of faith to get it to work. And so 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 right and so like how do you design are all environments that maybe give you some feedback earlier and and I think this is a very tough open question that I don't have an answer to but but you know ultimately to play a very strong go bot you probably did need

**[2:29:33] Eric Jang:** to discover deep learning yeah right and so I think that like having a challenging game that cannot be you know cheated easily on the outer loop could be used as a sort of outer loop signal for something like discovering the principles of deep learning. Now, of course, to make it tractable, and this is where research tastes really matters. Like, you have to come up with ways to initialize your problems so that you don't solve a sort of very intractable problem, right?

**[2:30:00] Eric Jang:** Like, maybe you can leverage LLMs as a sort of universal grammar in the middle to kind of give you some sort of local feedback. Got it. The fact that LLMs are universal grammar means that they can kind of move at almost any level of the stack, right? They can think very locally as well as step back and think like in very broad steps. And I think that's where a lot of the lateral thinking ability of humans kind of come from.

**[2:30:24] Eric Jang:** Like how to know if the track that you're pursuing or the objective that you're pursuing is not right and you should be asking a different question.

**[2:30:30] Dwarkesh Patel:** The other question is how stackable local improvements are in the attempt to get to a better result on the outer loop. I've heard rumors that at some AI labs, the thing that has gone wrong is that people will individually pursue good ideas, but those don't end up stacking well. And so the training run falls because of some weird interaction between two seemingly good ideas and having a single top-down vision of how things should work is very important.

**[2:30:56] Dwarkesh Patel:** Having worked at different AI labs and also playing around with, I guess, parallel agents trying different ideas, what is your sense of how parallelizable AI innovation is?

**[2:31:07] Eric Jang:** Yeah, great question. I think the research taste for executing well on the bitter lesson is that you need to know how much the bitter lesson can buy you and how much is too much to ask for at any given moment. Of course, in the fullness of time, compute kind of is the single most important determinant on how things work. And it's almost like inevitable that as you scale up energy and compute and parameters, intelligence will just fall out of that.

**[2:31:38] Eric Jang:** And that's super beautiful, super profound. No algorithmic detail really matters beyond that. But in present day, we don't have infinite compute and parameters and arbitrarily good initialization. So we have to come up with like heuristics that kind of give us that. But these heuristics are probably somewhat redundant. So that's probably why you see this effect where like a lot of these compute multipliers don't necessarily stack, is that like they might have some correlated benefit. And then, you know, three years down the line when the NVIDIA GPUs have gotten even stronger, maybe they stack even less well, right?

**[2:32:11] Eric Jang:** Like maybe like at any given point in time, the sort of benefit of any given compute multiplier is transitory, which is what I sort of suspected with the Katago paper. Like there was many algorithmic ideas kind of applied. And then you can see that like with, you know, modern Blackwell GPUs and ADA class GPUs that are much better than the sort of V100 grade GPUs that that paper used. You can see that like some of these algorithmic tricks to speed up convergence just don't matter so much compared to something else.

**[2:32:38] Eric Jang:** And I think that's a matter of taste in the present time.

**[2:32:41] Dwarkesh Patel:** Yeah, interesting. How about the outer loop? How verifiable for making AI smarter? With Go, you do have this outer loop of win rate against the best open source model out there. And even there, as you were saying, there are other outer loops of did you discover a new phenomenon, which is actually very hard to, if you didn't know scaling laws were important, if you're back in, when was Chinchilla or Kaplan scaling laws released? Like 2019. Yeah, so if you're back in 2015, would you, there's not an automated procedure one can easily imagine imagine of knowing which paper is the scaling loss paper versus which is just like another random plot.

**[2:33:21] Dwarkesh Patel:** And so that even in the go case is hard to verify outer loop. And the whole idea of an outer loop is to have like some backstop on improvement. But let alone for general AGI, where of course we have a bunch of these benchmarks, but there's a problem that like we know the things we can measure and we improve on the things we can measure. but we care about this broader ability to do economically useful work, which is, at least until you automate everything, not super easy to measure.

**[2:33:54] Dwarkesh Patel:** So yeah, there's a question of, okay, how good is the outer verification loop for AI self-improvement, and does that matter?

**[2:34:01] Eric Jang:** Yeah. I'm going to give a non-rigorous argument, but one that I kind of intuitively believe, which is that DeepMind, the AI research lab, they started as a sort of focus on games, right? They kind of used games as their outer loop. And then the researchers learned from experience of solving games. And then now they're working on LMs. And presumably there was some positive transfer from their time working on games and like Atari and Go and StarCraft that now helps them make good LMs.

**[2:34:31] Eric Jang:** I assume that there's positive transfer in some regard, whether it's coding or general research ability or project management. All these things kind of probably help them do well. And so if that's the case, why wouldn't it also be true for automated AI researchers? Like they should be able to positively transfer experience tackling quick to verify, quick to iterate on environments to something more ambitious and economically useful like, you know, automating drug discovery or so forth.

**[2:35:00] Dwarkesh Patel:** I mean, I don't know. Isn't the issue with, historically, until Gemini 3 or whatever, been a couple of years ago people were saying, look, Google isn't catching up in LLMs because they're too tied to the old approach. And yeah, there's gains, but there's also ways in it which actively hinders you. So it's actually not obvious to me that there's like...

**[2:35:27] Eric Jang:** The jury's still out, right? I think like who knows if the, you know, let's say currently Google's doing quite well. Who knows if the initialization on training on games is ultimately going to hobble their ability to be the winner in the long term. It's hard to say for sure. And likewise, who knows if the seeming late start was really just them kind of pre-training for longer on how to scale up TPUs. They invested all their tech tree in getting TPUs to be good, which seemed not that useful in the short term, but then in the long term it becomes maybe like a...

**[2:35:59] Eric Jang:** So it's even hard for humans to reason about what the optimal research strategy should be. even with the data we have today.

**[2:36:07] Dwarkesh Patel:** Yeah, yeah. Cool. Okay, we should let people know how they can find out more about this project, whether to fork it themselves, whether to check out your blog post. We're doing an excellent job explaining many of these ideas. Where do people go next?

**[2:36:20] Eric Jang:** Great, yeah, so my website is evjeng.com. There's a blog post that kind of links to an interactive version of this tutorial. And on my GitHub, which is the username is just Eric Chang, there's a auto-go repo that people can fork and reproduce the training.

**[2:36:36] Dwarkesh Patel:** Yeah. And I also highly recommend people check out this blog post, As Rocks May Think, which we touched on some of the ideas in this conversation, but it's this grander, you know, thesis of what happens when you have thinking as a primitive in...

**[2:36:50] Eric Jang:** Computer science.

**[2:36:51] Dwarkesh Patel:** Exactly. Right. And so I highly recommend people check out that blog post as well.

**[2:36:54] Eric Jang:** Yeah. And I encourage the audience to think about the relationship between thinking and go, via MCTS and search and how it relates to LMs, I think there's something quite profound there. And probably underexplored just because Go has been relatively underexplored compared to the boom in LMs. It's not to say that I think we should have trees in our LMs, but there is some very interesting duality between them. And you can actually do a lot of research on Go, MCTS, and reasoning with very small budgets.

**[2:37:24] Dwarkesh Patel:** So that's very exciting. Cool. Awesome, Eric. Thanks for doing this. It's an honor to be on the podcast.
