Knowing When to Stop Thinking: A Dissection of Expected Free Energy as a Test-Time Compute Controller for Latent World-Model Planning

Tong Zhang · Zhiyuan Shi · Yun Peng · Tao Xie
Fudan University · Peking University
WebsiteGitHubArxiv

Imagine a robot looking at a room and a goal image. Before it moves, it imagines several possible futures, chooses the more promising actions, and refines them. Another round of planning may discover a better route. It may also discover a mistake in the robot’s own model and exploit it. The difficult question is when another round of thinking is still useful.

This work studies expected free energy as a controller for that decision. Its central experiment separates three things that are often bundled together: choosing a candidate action, deciding how long to refine it, and learning from the transition that actually happens. The separation reveals where adaptive computation works, where uncertainty helps, and why an improving internal objective can conceal worsening behavior.

A better imagined future can produce a worse action

A learned world model predicts how the scene will change under an action sequence. A planner can optimize that prediction without executing every candidate in the real environment. This makes repeated refinement attractive: sample possible actions, predict their consequences, keep the best candidates, and sample again around them.

The prediction remains an approximation. With enough optimization, the planner may find actions whose predicted outcomes look excellent precisely because the model is inaccurate there. The cost then falls for the wrong reason. A stopping rule that observes only this cost has no direct access to the consequences of executing the selected action.

Success and model-cost trajectories across planning depths
Recorded DINO-WM evaluations expose two regimes. PushT reaches a success plateau. On Wall, mean success peaks at 57.6% at iteration 11 and falls to 35.6% at iteration 30 while predicted cost continues to decrease. Five seeds and 50 starts per seed support these curves.

The distinction changes the objective of a compute controller. On a plateau, stopping late wastes computation. After a peak, stopping late can also choose a worse action. These two costs require different stopping signals, even when their optimization traces look similarly well behaved.

Three decisions, three experimental interventions

Expected free energy connects preferred outcomes with information seeking. In our operational objective, goal distance is the pragmatic signal and variation across stochastic predictions supplies a disagreement signal. The experiment asks what each signal does when assigned a specific job.

Separate roles for candidate scoring, stopping and online adaptation
Candidate scoring selects among imagined futures. Stopping allocates refinement iterations. Online adaptation changes the predictor using newly observed transitions. Each intervention is tested separately.

Keeping these roles apart matters. An uncertainty reward may make sense when an observation can improve a model. With a frozen predictor, visiting an uncertain outcome does not itself update the predictor. Conversely, avoiding uncertainty can help action selection yet leave the dynamics required for the task completely unlearned.

Inside the planning loop

The primary planner uses the cross-entropy method. At each refinement iteration, it samples action sequences from a Gaussian proposal, predicts their terminal latent representations, retains a low-cost elite set, and refits the proposal. Once planning stops, it executes the first action block, receives a new image, and plans again.

Image encoding, sampling, prediction, elite selection and a separate online update branch
The upper branch refines actions using a fixed predictor. The lower branch updates the predictor with actual transitions, replay and a parameter anchor. Frozen and shuffled-target controls test whether the update learns useful dynamics.

For a candidate sequence a, the scoring rule is:

Cβ(a) = P(a) − β U(a)

P is the squared distance between the mean terminal prediction and the goal representation. U is the spread of terminal predictions across stochastic rollouts. A positive β rewards disagreement; a negative β penalizes it. At β = 0, scoring follows predicted goal distance. Disagreement is a measurable uncertainty proxy, rather than a calibrated estimate of posterior information gain.

Here “model cost” means the predicted task objective being minimized. It is not the price of a model call, GPU time, or a monetary compute charge. Refinement depth is the separate measure of planning effort.

A stopping signal that can be inspected

The controller smooths the mean elite cost and monitors relative descent. If improvement stays below a threshold for a patience window, it stops. A minimum depth allows the proposal to establish itself; a fixed cap prevents unbounded refinement.

qn = (En−1 − En) / max(|En−1|, 10−8)

The primary LeWM configuration uses 300 candidates and 30 elites, horizon 5, action block 5, and a cap of 30 refinements. The stall threshold is 0.01, with patience 2, minimum depth 3, and an exponential moving-average coefficient of 0.5. The same settings are used across TwoRoom, PushT, Cube and Reacher.

Elite-cost descent and adaptive refinement traces
Cost descent provides an instance-dependent allocation signal. The controller can spend more iterations on a solve that continues to improve and stop earlier when recent progress stalls.

The criterion detects insufficient recent improvement. It does not certify convergence of the action distribution, correctness of the learned dynamics, or safety of the chosen action. Those are separate properties.

Where stopping saves work

On plateau-shaped tasks, the primary controller uses less depth while reaching mean success close to fixed-depth references. Best-elite stopping, which monitors the best candidate rather than the elite mean, is also competitive and often stops earlier.

LeWM controller comparisons: success (%) and mean refinement depth
EnvironmentBest fixedElite-mean stallBest-elite stall
TwoRoom90.0 @ 3088.0 @ 22.089.3 @ 9.3
PushT88.4 @ 3087.2 @ 28.387.3 @ 15.3
Cube67.3 @ 1063.3 @ 28.163.3 @ 15.8
Reacher72.0 @ 3074.7 @ 22.374.0 @ 9.3

Each seed contains 50 episodes. Seed counts differ between some methods, so these means are descriptive comparisons. The fixed reference is selected from the evaluated depth grid. Iteration reductions imply fewer imagined transitions when candidate count, horizon and rollout count remain fixed; they are not an end-to-end latency measurement.

Success versus mean depth for alternative stopping rules
Threshold sweeps show the trade-off between success and refinement depth. Different cost statistics can follow a plateau; geometric rules can be sensitive to thresholds. The evaluated rules do not reliably recover Cube’s earlier peak.

Disagreement is not automatically useful exploration

The next experiment keeps the model frozen and changes the disagreement weight. At larger positive weights, rewarding disagreement reduces success in all four environments. At β = +10, losses range from 3.5 to 54.7 percentage points. At β = +50, the range is 13.0 to 78.1 points. Each cell uses 100 matched seeds and 50 episodes per seed with four stochastic rollouts.

Success and paired changes across disagreement weights
The full disagreement-weight experiment reports both mean success and paired changes from β = 0. Reward and penalty use the same stochastic scoring procedure, including dropout at the zero-weight baseline.

A penalty helps at selected task and weight combinations. Reacher gains 2.38 and 3.34 points at β = −20 and −50; Cube gains 1.44 and 1.88 points at −20 and −10. Stronger penalties also hurt: TwoRoom loses 13.4 points at −50. A single preference for either optimism or pessimism does not explain every task.

Goal distance and disagreement have different magnitudes, so raw β may hide a scaling issue. A magnitude-normalized grid tests that possibility. The larger positive weights still hurt, although this normalized grid uses one seed per setting and has a narrower evidential scope than the main weight experiment.

Magnitude-normalized disagreement-weight response
Matching the scale of goal cost and disagreement does not remove the larger-positive-weight failure. The normalized sweep is exploratory, with one seed per nonzero setting.

Missing dynamics require learning, not just caution

Consider a goal that lies in a region the model never saw during training. Penalizing uncertainty may encourage the agent to avoid that region, but avoidance cannot reach the goal. We create this situation by removing TwoRoom training episodes that enter a required corner.

The intervention includes a volume-matched random-removal control, a checkpoint matched on initial frozen success, and shuffled-target updates. These distinguish the location of missing data from simply having fewer examples or a weak starting model.

Success (%) on the independently trained coverage-hole sample
UpdateHole e3Hole e5Success-matchedFull-data e2
Frozen37.244.037.270.8
Online56.062.834.876.4
Shuffled targets46.455.638.080.8

Online updates recover 37.6% and 48.0% of the coverage deficit for the two hole checkpoints, relative to their volume-matched references. The advantage over shuffled updates is 9.6 and 7.2 points. The same advantage does not appear in the success-matched and full-data controls. Correctly paired observations matter in this specific missing-dynamics setting.

Updating the model and spending more time optimizing inside it therefore answer different problems. Lower prediction loss on recently observed transitions also does not guarantee higher task success. The control conditions are necessary to distinguish a useful update from generic optimization activity.

The same stopping idea, different planner families

The stopping statistic is tested beyond the primary latent CEM planner. Across 19 TD-MPC2 tasks, it retains 98.9% of the best-grid return on average at mean depth 3.8. On DINO-WM PushT, fixed-depth and adaptive stopping both reach mean success 0.852; the adaptive rule uses depth 26.44 instead of 30.

Cross-family results for learned visual world-model planning
Transfer tests include tasks with a plateau and tasks whose success falls after a peak. A planner family can contain both regimes, so its name alone does not tell us whether cost-based stopping will help.

On DINO-WM Wall, cost-only halting runs to depth 29.04 and reaches success 0.364, close to the full-budget 0.356 rather than the earlier 0.576 peak. More stochastic rollouts can improve scoring, but they also change computation per iteration. A five-rollout fixed-depth setting reaches 0.508 at depth 30; this is not an early-stopping result.

What the separation tells us

The useful result is a map of when each intervention can work. Stopping can reduce computation when task success plateaus. A disagreement penalty can change action selection in useful ways at selected weights. Online updates can learn dynamics absent from the training distribution. None substitutes for the other two.

The failure case is equally informative. Two tasks can expose the same internal cost trajectory yet require different stopping depths because their real consequences differ. A controller reading only cost must make the same choice for both. Protecting performance after a peak requires connecting prediction progress to executed outcomes.

This changes how adaptive-compute systems should be evaluated. Plot external success over depth alongside internal cost. Compare candidate scoring and stopping under matched per-iteration work. Test model updates with interventions and controls. A curve that converges inside the model is only the beginning of that evaluation.

Experimental scope

These figures and tables come from the paper released on 20 October 2026. Start and goal samples may overlap world-model training data. Some controller comparisons use unequal seed sets, and shared transfer thresholds were not selected on an independent held-out set. Disagreement is a proxy, the normalized grid is exploratory, and the idealized stopping argument does not directly prove a guarantee for receding-horizon execution. The article presents the published experimental scope; subsequent experiment batches are not included here.