SandHouse
Pages and contents

Efficient Zero V2

https://arxiv.org/pdf/2403.00564v2 2024

Problem

Model-based reinforcement learning can greatly improve sample efficiency by learning an environment model and planning with imagined transitions rather than relying entirely on real interaction. However, existing approaches have important tradeoffs. EfficientZero achieves strong sample efficiency in discrete domains such as Atari but its MCTS procedure does not scale naturally to large or continuous action spaces. Methods such as TD-MPC support continuous control but can require large numbers of imagined trajectories during planning.

Another problem arises from replaying old experience. In sample-efficient RL, the policy can change substantially while the same limited dataset is reused many times. Multi-step TD targets from an old trajectory therefore contain rewards generated by an outdated behavior policy. EfficientZero V2 addresses both problems: it introduces an efficient tree-search method that works in continuous action spaces and a search-based value target that reevaluates old states using the agent's current model and policy.

Method

Learned Latent Model

EfficientZero V2 inherits the basic MuZero/EfficientZero architecture. An observation ot is first mapped into a latent state:

st=H(ot)

A dynamics model predicts the next latent state and reward given an action:

s^t+1,rt=G(st,at)

Two additional heads predict the policy and state value:

pt=P(st)
vt=V(st)

The important point is that G does not attempt to reconstruct the next observation. It learns latent dynamics useful for reward prediction and planning.

At interaction time, the learned model is used to simulate possible action sequences. Search produces an improved action and improved policy/value targets, which are then used to train the neural networks.

Training Objective

The model is trained jointly using reward, policy, value, and latent temporal-consistency objectives:

Lt=Ξ»1LR(ut,rt)+Ξ»2LP(Ο€t,pt)+Ξ»3LV(zt,vt)+Ξ»4LG(st+1,s^t+1)

Here ut is the observed environmental reward, while Ο€t and zt are policy and value targets produced by planning.

The latent dynamics are trained with a temporal consistency objective rather than observation reconstruction:

LG(st+1,s^t+1)=Lcos(sg⁑(P1(st+1)),P2(P1(s^t+1)))

where sg denotes stop-gradient. The idea is that the predicted latent successor should agree with the representation produced when the actual next observation is encountered.

The model is unrolled for several imagined transitions during training:

L=1lunrollβˆ‘i=0lunrollβˆ’1Lt+i

This teaches the latent dynamics to remain useful across multiple recursive predictions.

Search as a Policy Improvement Operator

Instead of treating the learned policy pt as the final policy, EfficientZero V2 treats tree search as a policy improvement operator.

The desired property is

q(s,aSβˆ—)β‰₯𝔼a∼pt[q(s,a)]

where aSβˆ— is the action selected by search.

Thus the action produced by planning should have at least as much estimated value as simply sampling from the current policy.

The improved search result is then distilled back into the policy network. For a target search distribution Ο€t :

LP(pt,Ο€t)=𝔼aβˆΌΟ€t[βˆ’log⁑pt(a)]

For high-dimensional continuous actions, the selected best action can instead be used directly:

LP(pt,aSβˆ—)=βˆ’log⁑pt(aSβˆ—)

The learning loop is therefore approximately

policy→search with model→improved policy→distill into policy

Rather than learning only from environmental rewards, the policy repeatedly learns from a planning procedure that is intended to improve upon its current behavior.


EfficientZero used conventional MCTS, which becomes expensive when the action space is large.

EfficientZero V2 instead builds on Gumbel search. For a discrete policy with logits, the Gumbel-Max trick selects

A=arg⁑maxa⁑[g(a)+logits⁑(a)],g(a)∼Gumbel⁑(0)

Gumbel-Top-k extends this to efficiently select several candidate actions without replacement.

Search then spends its simulation budget evaluating these candidate actions rather than expanding the entire action space.


To extend this idea to continuous control, the policy is represented by a Gaussian distribution.

At the root node, the algorithm samples two groups of candidate actions:

AS=[AS1,AS2]

where AS1 is sampled from the current policy pt , while AS2 comes from a broader prior ptβ€² .

In practice, ptβ€² is a flattened version of the current Gaussian policy. The second set therefore introduces actions that the current policy considers less likely and increases exploration.

Search selects

aSβˆ—=arg⁑maxa∈AS⁑q(s,a)

Because the candidate set contains samples from the current policy,

q(s,aSβˆ—)β‰₯1|AS1|βˆ‘a∈AS1q(s,a)→𝔼a∼pt[q(s,a)]

as |AS1| grows.

This provides the policy-improvement argument for continuous action spaces.

The candidate actions are evaluated using Sequential Halving. Poor actions are progressively removed and the remaining simulation budget is concentrated on increasingly promising actions. Non-root nodes use fewer candidate actions, allowing the same simulation budget to search deeper trajectories.

Search-Based Value Estimation

Replay creates an important off-policy problem. Suppose an old trajectory contains

st,at,rt,st+1,…

generated by an old policy. A conventional multi-step target uses those historical rewards even if the current policy would behave very differently from that state.

EfficientZero V2 instead reevaluates the old state using the current model and current policy.

During tree search, simulation n generates an imagined trajectory with depth H(n) . Its value estimate is

V^n(s0)=βˆ‘t=0H(n)Ξ³tr^t+Ξ³H(n)V^(s^H(n))

The Search-Based Value Estimate (SVE) averages estimates produced across the search simulations:

V^S(s0)=1Nβˆ‘n=1NV^n(s0)

The intuition is that an old state from the replay buffer can be reconsidered according to what the current agent would do, instead of relying entirely on what an old behavior policy actually did.

This makes previously collected experience more reusable as the policy changes.

Model Error and the Mixed Value Target

Search-based value estimation introduces another problem: its quality depends on the learned dynamics model.

Errors in

s^t+1,r^t,V^(s^t)

can accumulate along imagined trajectories. The paper derives an error bound showing that SVE error depends on transition, reward, and terminal-value prediction errors.

This is especially problematic early in training, when the model is inaccurate.

EfficientZero V2 therefore does not always use SVE. It constructs a mixed value target:

Vmix={βˆ‘i=0lβˆ’1Ξ³iut+i+Ξ³lvt+learly training or very recent dataV^S,otherwise

Early in learning, or for fresh experience, it trusts real observed rewards through a multi-step TD target.

For older replay data, once the model is better trained, it uses search-based value estimation to avoid relying on trajectories generated by obsolete policies.

So the tradeoff is roughly

real trajectory target↔current-model search target

depending on which source of error is expected to be smaller.

Efficient Planning

A major practical contribution is achieving useful planning with relatively few model simulations.

Instead of exhaustively searching actions, the learned policy proposes promising regions of action space and Gumbel search selectively allocates computation among those candidates.

In the reported continuous-control experiments, EfficientZero V2 uses roughly 32 imagined latent states for planning in settings where TD-MPC2 uses thousands of predicted states through MPPI.

Thus the learned policy and planner help each other:

policy narrows search→search improves policy→better policy narrows future search

This repeated search-and-distillation cycle is one of the central ideas behind MuZero-style algorithms.


EfficientZero V2 still depends heavily on the quality of its learned latent dynamics. Search can only improve decisions when imagined rewards and transitions are sufficiently accurate, and the paper's SVE analysis explicitly shows that model error can amplify value-estimation error. This is why the authors fall back to real multi-step TD targets early in training. Tree search also adds inference-time computation compared with directly executing a learned actor. Although the experiments span Atari and many DMControl settings, the paper does not demonstrate the algorithm on genuinely open-ended environments or real-world robotics; broader real-world evaluation is left as future work. The reported advantage over competing methods also becomes smaller as the interaction budget increases, suggesting that its largest benefit is specifically in the limited-data regime.

EfficientZero V2 belongs to the MuZero family. MuZero introduced planning over learned latent dynamics without reconstructing the environment, while EfficientZero added self-supervised temporal consistency to dramatically improve sample efficiency. Gumbel MuZero provides the policy-improvement-oriented search procedure used as the basis here, while Sample MuZero previously extended sampled tree search toward continuous actions. TD-MPC/TD-MPC2 instead perform short-horizon planning using model predictive control, while Dreamer/DreamerV3 learn policies through trajectories imagined in a latent world model rather than performing tree search at every decision. EfficientZero V2's main contribution is combining a MuZero-style latent model with computationally efficient continuous-action search and reanalysis of replay states using the current model and policy.