Planning with Learned Dynamics

Once an agent has a learned model, it can use the model to imagine possible futures before acting. A delivery robot can compare a shortcut through a crowded corridor with a slower route around it. A recommender can estimate whether showing one item now will make later interactions better or worse. A game-playing agent can search several moves ahead instead of reacting only to the current position.

This is the central appeal of model-based RL: it can turn data into reusable experience. The agent does not need to execute every candidate action in the real world. It can plan, evaluate, and sometimes train on imagined rollouts generated by the learned dynamics.

Planning horizon

How far should the agent imagine?

Pick a rollout horizon for a delivery robot choosing between a quick shortcut and a slower known route.

Horizon

3 steps

Useful lookahead

68%

Trust left

76%

Delayed consequences revealed68%
Compounded model error24%
Real-world trust budget76%

Deployment note

Often a practical planning range when the model is refreshed with real data.

The agent can compare nearby consequences without pretending the model is perfect.

Model-based deployment is a horizon decision: more imagination can reveal delayed effects, but it also amplifies model error.

The planning loop repeatedly feeds predicted states back into the model:

s^t+k+1=fθ(s^t+k,at+k)\hat{s}_{t+k+1}=f_\theta(\hat{s}_{t+k},a_{t+k})

A candidate action sequence can then be scored by predicted reward and final value:

G^t=∑k=0H−1γkr^t+k+1+γHV(s^t+H)\hat{G}_t=\sum_{k=0}^{H-1}\gamma^k\hat{r}_{t+k+1}+\gamma^H V(\hat{s}_{t+H})

The horizon HH controls how far the agent imagines. A larger HH can reveal delayed consequences, but it also gives errors more time to compound. If the model is a little too optimistic about a slippery turn, the first imagined step may be only slightly wrong. Ten imagined steps later, the plan may rely on a trajectory the real robot cannot follow.

Equation walkthrough

Score an imagined plan

Click each term to see how a model-based agent scores a candidate action sequence.

=+()

Imagined return

model-based score for a candidate plan

This is the return the agent estimates by rolling the learned model forward from time t. The hat marks it as model-imagined, not directly observed.

Terms

The equation mixes short imagined rewards with a value estimate for everything beyond the rollout horizon.

Modern model-based systems often respond with a deliberately modest use of imagination. Model predictive control replans after each real step instead of committing to a long open-loop plan. MBPO-style methods use short model rollouts, often only a few steps, to create extra training data without asking the model to predict far into unfamiliar futures. Ensembles and uncertainty penalties can downweight plans that pass through states the model does not understand.

This matters when deploying RL systems because the planner will search for loopholes in its internal world. If a supply-chain model underestimates delays, the policy may route inventory through fragile paths. If a simulator omits actuator latency, a robot policy may look elegant in simulation and unstable on hardware.

Equation walkthrough

MBPO keeps imagination short

Click each term to see how short-horizon model rollouts improve sample efficiency while limiting model bias.

=for

Short horizon

stop after a few steps

The short horizon limits compounding error, then learning returns to real data.

Short imagined rollouts can add useful training data without asking the learned model to stay accurate far into the future.

Planning vs learning

Two ways to use imagined futures

Choose how the agent uses its learned model.

Evaluate hypothetical futures

Current state
Candidate actions
Imagined outcomes
Choose action

Planning uses the learned model for lookahead. The agent asks what might happen under different actions before committing in the real environment.

Planning acts through lookahead; learning updates pi or V from imagined experience.
⚠

Compounding Error

Each imagined state becomes the input to the next prediction. A small one-step error can change the next input distribution, which creates larger errors, which create stranger inputs. Long rollouts are most dangerous when the policy enters states the model rarely saw during training.

ℹ

Uncertainty-Aware Planning

Good model-based RL requires uncertainty-aware planning.

What to do about it:

  • Short imagined rollouts (MBPO)
  • Latent planning (MuZero, Dreamer)
  • Regularization so plans stay realistic
  • Real data refresh → correct the model often
Checkpoint

Why can short imagined rollouts be more reliable than long imagined rollouts?