TL;DR
Tree search is very strong when the rules of the environment are known, as in chess or Go. Real problems rarely come with those rules, and learning a full simulator of pixels is expensive and wasteful. MuZero learns a compact model that predicts only the three things planning needs: the reward, the policy, and the value. It then runs a tree search inside that model, so it never has to reconstruct what the world looks like.
Where you'll see it: in the planning agents that learn their own environment model, for example in board games where the agent is never given the rules, and in Atari, where the paper reports results for 57 games.
Intuition
Plan in a space that only has to be useful
Think of a chess player who does not remember the board in full detail. What they remember is what matters for the next few moves: which pieces are under threat, how valuable each position feels, and which moves look promising. Their internal picture is a summary built for deciding, not a photograph of the board.
MuZero works the same way. It turns the observation (the Go board, or the last few Atari frames) into a hidden state. A second function takes a hidden state and a hypothetical action and produces the next hidden state and the reward for that step. A third function reads a hidden state and outputs a policy (which action looks good) and a value (how good the position is). Planning happens entirely on hidden states. The model is never asked to draw the next screen.
Why does this matter? A model trained to reproduce pixels spends its capacity on detail that does not change the decision, such as the exact texture of the background. Planning on pixels is also computationally impractical at scale. MuZero's hidden states are free to contain whatever helps prediction, and nothing forces them to be a faithful copy of the environment. The paper puts it this way: the agent can invent, internally, the rules or dynamics that lead to the most accurate planning.
flowchart LR O[Observations o_1 to o_t] --> H[Representation h] H --> S0[Hidden state s_0] S0 --> F[Prediction f: policy and value] S0 --> G[Dynamics g with action a_k] G --> SK[Hidden state s_k and reward r_k] SK --> F
Search as the teacher
A neural network that predicts policies and values is fast but imperfect. A search that looks ahead with the network's help is slower but more accurate. MuZero trains the network to match the search. The policy target is the search's visit distribution, and the value target is a discounted sum of observed rewards with the search's value at the end. Each time the search improves on the network, the network is pushed toward the improvement. This is the same policy-iteration loop that AlphaZero uses, extended to cases where the rules are not given.
The math
The model
The model has three learned functions, all parameterised by . Let be the observations so far and a hypothetical sequence of actions.
- Representation maps the observations to a root hidden state: .
- Dynamics maps a hidden state and an action to a reward and the next hidden state: .
- Prediction maps a hidden state to a policy and a value: .
Here is a distribution over actions, is a scalar estimate of future return, and is an estimate of the immediate reward. The dynamics function is the only place where time moves forward inside the model. The paper's version is deterministic.
The targets
Each training position has three targets, taken from real experience:
- The policy target is the search distribution recorded at that step, proportional to visit counts at the root.
- The reward target is the reward the environment actually emitted.
- The value target is an -step return that bootstraps from the search value:
Here is the discount factor, is the observed reward, and is the search value steps later. In board games, the discount is 1 and the only reward is the final outcome, , or , and the target bootstraps to the end of the game. In Atari the paper uses and a discount of .
The loss
Training unrolls the model for hypothetical steps from a sampled position. The loss sums three terms over every unrolled step, plus a weight penalty:
The reward term is only meaningful for , since no reward is predicted at the root. The paper scales each head's loss by so that the gradient size does not depend on how far it unrolls. The whole model, , and , is trained jointly by backpropagation through time.
Worked examples
Take , , and suppose the environment gave rewards and . The search at step returned a value .
- Write the formula: .
- Substitute the reward: .
- Substitute the discounted second reward: .
- Compute the discounted search value: .
- Add the terms: .
The target mixes real rewards from the past with the network's own search estimate of the future. The value head is trained to output at position , not and not . The paper uses this form so that long episodes and intermediate rewards can be handled, which AlphaZero's terminal-outcome targets do not cover.
Take . Sample one position from the replay buffer and unroll the model over the next five actions.
- Apply the representation function once: gives .
- Apply the dynamics function times: gives , along with rewards .
- Apply the prediction function to each of . That is calls.
So one sample costs one encoder call, five dynamics calls and six prediction calls. Each dynamics call is cheap compared with the representation function, since it works on hidden states rather than raw observations. The count of calls is what matters here. This is the step that makes the model usable for planning: the search only ever calls and , never after the root.
Experimental results
The paper reports two broad results. In board games, MuZero matched the superhuman performance of AlphaZero on Go, chess and shogi, even though it was never given the rules. In Go it slightly exceeded AlphaZero. The board-game networks used 800 simulations per move. The paper says that for these games it followed the same UCB constants, Dirichlet exploration noise and simulation count as AlphaZero.
In Atari, the paper reports a new state of the art on the 57 games of the Arcade Learning Environment. The main agent used 50 simulations per move, and it beat the model-free R2D2 agent in 42 of 57 games. On the paper's Atari table, MuZero reaches a median of 2041.1% and a mean of 4999.2% of human score, compared with R2D2 at 1920.6% and 4024.9%. The table also lists 20 billion frames for MuZero against 37.5 billion for R2D2, so the comparison is not frame-matched. A second, sample-efficient variant called MuZero Reanalyze reaches a median of 731.1% with 200 million frames per game, against 431% for LASER and 231.1% for Rainbow in the same table.
The paper also studies how much planning matters. In Atari, performance rises with the number of simulations per move and plateaus at about 100 simulations, even though the network was trained at 50. With a single simulation, the agent still plays well by choosing moves from the policy network alone. In Ms. Pacman, the paper reports that training with only 6 simulations per move, fewer than the 8 available actions, still produced an effective policy.
Tradeoffs and failure modes
| Situation | What goes wrong | Better choice |
|---|---|---|
| The rules are known and cheap to simulate | MuZero adds a model to learn with no gain | [[alphazero |
| The environment is stochastic | The paper's dynamics are deterministic, so the model cannot represent randomness | A model that can represent stochastic transitions (the paper's model does not) |
| The model is wrong far from the data | Search exploits model errors; the paper notes that planning helps less in Atari than in Go, perhaps because of model inaccuracy | Limit search depth, or train on the real trajectories more often |
| Compute is tight at decision time | Each simulation makes network calls, and the paper's Atari gains flatten past about 100 simulations | Fewer simulations, or the policy network alone |
| No reconstruction loss | Hidden states need not match the true state, so they are hard to inspect | Accept that the model is a planner, not a simulator for humans |
Because the hidden state is trained only to predict reward, policy and value, the model can learn to ignore details that do not matter for those quantities. The same freedom makes it hard to say what the state means.
History
The paper builds on AlphaZero, which had already shown that a network trained from search targets could master Go, chess and shogi. Before MuZero, the paper's own survey places two lines of model-based work. One predicts pixels or latent states that can reconstruct the observation. The other, which includes the predictron and value prediction networks, learns models that are trained only to predict value or reward. MuZero sits between them: it predicts value, reward and policy, and it does not reconstruct observations. The arXiv preprint dates from November 2019.
Check yourself
QuestionWhat are the three functions of MuZero's model, and what does each one output?Show answer
The representation function maps the past observations to a root hidden state . The dynamics function maps a hidden state and an action to an immediate reward and the next hidden state . The prediction function maps a hidden state to a policy and a value . Planning uses and on hidden states, and only the root uses .
QuestionWith , , rewards , , , and search value , what is ?Show answer
Apply . The terms are , , , and . The sum is .
QuestionWhy does MuZero train the hidden state without requiring it to reconstruct the observation?Show answer
Reconstruction would force the model to spend capacity on details that do not change the decision, such as background texture, and it would make planning in pixel space expensive. The model is trained only so that its predicted reward, policy and value match the observed reward, the search policy and the bootstrapped value target. Any hidden state that makes those predictions accurate is acceptable, so the model can use a more compact representation.
QuestionWhy might MuZero help less in Atari than in Go, according to the paper?Show answer
The paper suggests that greater model inaccuracy in visually complex Atari environments limits the benefit of search. Search amplifies whatever the model gets right, and it also amplifies errors. In Go, the model is more accurate, so longer searches keep improving play.
QuestionA training sample uses unroll steps. How many calls does it make to each of the three functions?Show answer
The representation function is called once. The dynamics function is called five times, for steps through . The prediction function is called six times, once for each of through .
Sources
- Schrittwieser et al. (2019), Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model: https://arxiv.org/abs/1911.08265
- Silver et al. (2017), Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm (AlphaZero): https://arxiv.org/abs/1712.01815
- Wikipedia, MuZero: https://en.wikipedia.org/wiki/MuZero