What it is used for

MuZero is used for sequential decision problems where the dynamics of the environment are unknown or not available as a perfect simulator. Tree-based planning methods had long been hugely successful at chess and Go because there the game rules are fully available to simulate inside a computer. In real-world problems, the dynamics governing the environment are usually complex and unknown, so no such simulator exists. The MuZero paper shows another path: the agent learns its own model from experience, then plans inside that model.

In its paper, MuZero was tested in two worlds of opposite character. The first world is the 57 Atari video games, the canonical test environment for artificial intelligence, rich in images, where model-based approaches had historically struggled. The second world is Go, chess, and shogi, Japanese chess, which demand precise and sophisticated lookahead. In both worlds MuZero was given no knowledge of the rules or dynamics behind them.

How to use it

The way MuZero works can be read as three jobs carried out by one model together. The first job turns an observation, for example an image of the Go board or the Atari screen, into a hidden state, a compact internal picture. The second job steps forward inside that internal picture: given a hidden state and a hypothetical action, it produces the next hidden state together with the reward of that step. The third job reads the hidden state and predicts the good action and the value of that position.

On top of the model runs a tree search, an exploration of many hypothetical action sequences to choose the next real action, in the form the paper calls Monte Carlo tree search. Because the model can be rolled forward repeatedly inside the agent's head, the agent can try out many hypothetical futures before acting for real. After acting and seeing the result, the model is trained so that its predictions of reward, action, and value match better what actually happened and what the better search found.

One thing the paper stresses: the hidden state does not have to describe the true state of the environment, and it does not have to be usable to reconstruct the observation. It is free to take whatever form is useful for predicting those three quantities. The paper puts it, word for word: "Intuitively, the agent can invent, internally, the rules or dynamics that lead to most accurate planning."

Real examples

None of the following examples was invented for this article. All three are recorded in the primary paper written by its own researchers, and their figures are the results that paper reported in its time.

The first example is the test on the 57 Atari games. The paper reports that MuZero achieved a new state of the art of its time for mean and median normalized score across all 57 games of the Arcade Learning Environment, outperforming R2D2, the previous best model-free method, in 42 out of 57 games, and outperforming SimPLe, the previous best model-based approach, in all games. A second version retrained by reanalysing old experience, called MuZero Reanalyze, achieved a 731 percent median normalized score with 200 million frames of experience per game, compared to 192 percent for IMPALA, 231 percent for Rainbow, and 431 percent for LASER.

The second example is board games. At Go, chess, and shogi, MuZero matched the superhuman performance of AlphaZero, the algorithm that was supplied with the game rules, even though MuZero itself was given no knowledge of those rules. Its search in board games used 800 simulations for each move, the same as AlphaZero used.

The third example shows how cheaply its search can run. At the game Ms. Pac-Man, the paper reports that MuZero still learned an effective policy and improved rapidly even when its training search used only 6 simulations per move, fewer than the number of available actions. With more simulations, its performance jumped significantly higher.

Practitioner level

For practitioners, the three jobs of the MuZero model carry official names in the paper, and those names are kept as they are here. The representation function turns the sequence of past observations into the root state. The dynamics function steps from one hidden state to the next following a hypothetical action, while predicting the reward of that step. The prediction function reads the hidden state and outputs the policy, the distribution over recommended actions, and the value of that position. All three are trained jointly end to end with one objective: accurately predicting policy, value, and reward, including at hypothetical steps that have not actually happened.

In the paper's experiments, the model was trained by imagining 5 steps ahead, written as K equals 5. The number of search simulations differed by world: 800 simulations for each search in board games, and 50 simulations in Atari, because its action space is much smaller. Its tree search is a Monte Carlo tree search similar to AlphaZero's search, generalized to allow for single agent domains and intermediate rewards, not only final win or loss outcomes.

One practical finding of the paper concerns adding search time. At Go, adding simulations improved performance markedly. At Atari, the improvements due to planning were much less marked and performance plateaued at around 100 simulations, which the authors suggest may be because of greater model inaccuracy. Even with a single simulation, MuZero performed well, suggesting that the raw policy had internalised the benefits of search during training.

Expert level

The core idea of MuZero at the expert level is to separate the model from any duty to imitate the environment. Older model-based approaches generally learned to reconstruct the observations or the true state of the environment, so most of the model's capacity was spent on details irrelevant to decisions. MuZero instead models only the quantities planning uses directly, and its hidden state carries no semantics of environment state at all; it is simply the internal state of the model, whose sole purpose is to predict future policies, values, and rewards accurately.

In the paper's formulation, at each time step the model predicts three quantities for each hypothetical step: the policy, the probability of the next action; the value function, the expected discounted reward accumulated from that step; and the immediate reward of that step. Training matches all three at once: the policy is matched to the improved policy produced by tree search, the value is matched to played outcomes bootstrapped from the search estimate at a later step, and the reward is matched to the reward actually observed. Final outcomes in board games are treated as rewards at the final step, taking the values win, draw, or lose.

MuZero's place in its family is stated by the paper itself. It is model-based reinforcement learning, and it combines two strengths that previously ran separately: high-performance planning, which reigned in board games, and model-free learning, which reigned in visually rich games. The paper's closing states that MuZero matched the superhuman performance of high-performance planning algorithms in their favoured domains, logically complex board games such as chess and Go, and outperformed the state-of-the-art model-free reinforcement learning algorithms of its time in their favoured domains, the visually complex Atari games, without requiring any knowledge of the game rules or environment dynamics. The wider family relations, including the place of reinforcement learning itself, are covered in the reinforcement learning article.

Limits and risks

The first limit is attached to the learned model: planning is only as good as the model's predictions. The paper itself records that at Atari, where model inaccuracy is greater, the benefit of adding search plateaued quickly; the agent plans inside a picture it invents itself, and when that picture is off, a tidy plan can still lead to a bad result.

The second limit is the compute cost and the scale of the reported experiments. The paper's results come from large-scale training on specialised hardware, with searches of hundreds of simulations for every move in board games; those figures are the standing the authors reported in 2020, not a promise that the same results are easy to reach on other problems or other hardware.

The third limit is the coverage of its worlds. All results the paper reports lie in game environments that are fully or almost fully observed and behave in a clear-cut way after an action is taken. The paper's own closing frames application to real-world problems as a path that may open, not as a result already proven, and this article follows that frame.