← Research

Technical Report · Self Model Research · Rung 1

The Planner Hides the Model

Why control cost is the wrong instrument for measuring sample efficiency in model-based control

Abstract

We set out to measure how much interaction data a learned forward model needs before it can control a pendulum, and initially found no relationship at all: models trained on 50 samples controlled as well as models trained on 5000. We show this null result was an artifact of two separable causes, and that neither is about the model.

First, single-rollout evaluation is noise-dominated; averaging over 45 rollouts per condition removed a spurious non-monotonicity but left the curve flat. Second, and more consequentially, a random-shooting planner cannot exploit model improvements — held-out prediction error fell 8× across the sweep while control cost did not move. Replacing random shooting with the cross-entropy method improved control at every sample size (14–36%) and produced a statistically significant sample-efficiency trend for the first time (−0.512 ± 0.174 cost per decade of data, p = 0.0032).

A third change, predicting state deltas rather than absolute next states, improved held-out prediction 2.6–3.9× and control a further 14–28%, with 4 of 7 sample sizes separating at non-overlapping 95% confidence intervals. We report a model-free SAC reference for calibration. The practical conclusion is that control cost conflates model quality with planner capacity, and a model-based sample-efficiency curve measured without a separate model-quality probe is uninterpretable.

1Introduction

Figure 0 — What each measurement can and cannot see
random data 50 – 5000 forward model 4→64→64→3 planner 20-step horizon environment 200 steps accumulate cost ‖s − [1,0,0]‖² trainscores plans actionstate prediction error control cost — sees model AND planner
Figure 0. The conflation at the heart of this report. Held-out prediction error probes the model in isolation; control cost is a property of the model and planner jointly. A flat control curve is therefore consistent with two incompatible worlds — a model that is not improving, or a planner that cannot exploit one that is — and cannot distinguish them.

Model-based control is widely motivated by sample efficiency: a learned dynamics model should extract more control performance per unit of environment interaction than a model-free policy. Verifying that claim requires measuring control quality as a function of training-set size — a sample-efficiency curve.

This report documents what happened when we measured such a curve carefully on a minimal system. The curve did not appear. Recovering it required fixing the measurement and then the planner, and the sequence of failures is more informative than the final numbers: at each stage the natural interpretation of the data was wrong, and only a separate probe of model quality distinguished the possibilities.

The central methodological point is simple but easy to miss in practice. Control cost is a property of the system, comprising the learned model and the planner that uses it. A flat control-vs-data curve is consistent with two very different worlds: the model is not improving with data, or the model is improving and the planner cannot convert that improvement into better actions. These demand opposite responses, and control cost alone cannot distinguish them.

2Setup

Environment and objective

All experiments use Gymnasium's Pendulum-v1. The observation is [cos θ, sin θ, θ̇] and the action is a scalar torque in [-2, 2]. Torque limits are too weak to lift the pendulum directly, so a working controller must pump energy over several swings.

We score control with the squared distance from the upright, motionless target, averaged per step over a 200-step episode:

cost(s) = ‖s − [1, 0, 0]‖² episode score = mean over 200 steps

Zero is perfect. Roughly 16 corresponds to unstructured flailing; 2–3 is strong control. Every control number in this report is on this scale.

Forward model

A three-layer MLP (4 → 64 → 64 → 3, ReLU) trained with Adam (lr 10⁻³) for 1000 full-batch epochs. Training data is a single pool of transitions collected under uniformly random torques; models at each sample size are trained on independently drawn subsets of that pool. In the delta parameterisation (Section 6) the target is s' − s and the predicted next state is s + f(s, a).

Planners

Random shooting samples 300 uniform 20-step action sequences, scores each by rolling it through the model and summing cost, and executes the first action of the best sequence. CEM maintains a Gaussian over 20-step action sequences (initialised at mean 0, std 1), and for 5 iterations samples 100 sequences, keeps the 10 lowest-cost elites, and refits the Gaussian to them; it executes the first action of the final mean. Both re-plan every step.

Evaluation protocol

Each condition trains 3 independent models and evaluates each over 15 episodes, giving 45 rollouts per point. All conditions face an identical set of 15 start-state seeds, a common-random-numbers scheme that removes start-state variance from between-condition comparisons. We report the mean of per-model means, the standard deviation across all rollouts, and standard errors from the pooled rollouts.

Planner vectorisation

Both planners evaluate all candidate sequences as one batch rather than in a Python loop, a ~120× speedup that makes averaged evaluation tractable (roughly 9 hours to 5 minutes). We verified the batched random-shooting planner selects an identical action to the original per-candidate implementation when handed the same candidate set, across 5 trials to a tolerance of 10⁻⁵.

3The naive measurement fails

Our first measurement trained one model per sample size and evaluated each with a single 200-step rollout. The result was not merely noisy but actively misleading, appearing to show that less data produced better control.

SamplesCost (1 rollout)Cost (45 rollouts)
200016.0188.106 ± 0.698
10006.0147.816 ± 0.748
5004.7677.815 ± 0.605
2004.0979.487 ± 0.742
1007.0718.128 ± 0.556
504.0478.275 ± 0.544
Table 1. Single-rollout evaluation versus 45-rollout averaging, random-shooting planner. The single-rollout column suggests 50 samples outperform 2000 by 4×. Averaging shows all conditions are statistically indistinguishable; the 16.018 was one unlucky episode.

With 45 rollouts per point, the non-monotonicity disappears entirely and every adjacent pair overlaps at 95% confidence. A weighted regression of cost on log₁₀(samples) finds no significant slope. The measurement is now trustworthy and reports no effect of training data on control quality across a 100× range.

4Isolating model quality

A flat control curve admits two explanations. To separate them we measured the forward model directly, with no planner in the loop: hold out 1000 transitions never used for training, and report one-step prediction MSE on them.

Figure 2 — Held-out one-step prediction error
0.00010.0010.0150002000100050020010050training samples (log, decreasing →)held-out MSE (log)direct next-statedelta
Figure 2. Prediction error on 1000 never-trained-on transitions, measured in next-state space for both parameterisations so the numbers are comparable. Both curves fall monotonically with data — an 8.1x range for direct — while Figure 1's random-shooting curve stays flat over the same models. That mismatch is what identified the planner as the bottleneck. The identity baseline (predict no change, 0.1118) sits above the plotted range.
SamplesTest MSEvs. identityControl cost
50000.000549203.7×7.391 ± 0.650
20000.000611183.0×8.106 ± 0.698
10000.000624179.1×7.816 ± 0.748
5000.000655170.6×7.815 ± 0.605
2000.001101101.5×9.487 ± 0.742
1000.00163968.2×8.128 ± 0.556
500.00442925.2×8.275 ± 0.544
Table 2. Held-out one-step prediction error against control cost, same models. Prediction improves monotonically by 8.1× across the sweep with tight error bars; control cost does not move. The identity baseline (predicting no change) scores 0.111757, so every model — including the 50-sample model — has learned substantial dynamics.
Diagnosis

Model quality varies substantially with data, and control quality does not respond. The 50-sample model predicts 8× worse than the 5000-sample model yet controls indistinguishably. This is only possible if the controller is failing to convert model accuracy into better actions. The bottleneck is the planner.

The mechanism is straightforward in hindsight. Random shooting draws 300 samples from a 20-dimensional continuous action space, an essentially negligible fraction of it, so the arg-min over those candidates is close to a random selection regardless of how well the model scores them. A better model produces better scores for candidates that were never good enough to matter.

5A planner that can exploit the model

We replaced random shooting with CEM, holding the models, start states, and every other component fixed. Because the random seeds and draw order are unchanged, this trains the identical 21 models and evaluates them from the identical 15 start states: a controlled A/B on the planner alone.

Before running the sweep we verified CEM is in fact the stronger optimiser on this objective. Across 20 states on a trained model, CEM achieved lower predicted plan cost than random shooting on 20 of 20, reducing mean predicted cost from 219.5 to 188.3. Its final mean sequence scored 188.3 against the best sampled elite at 185.0, confirming that collapsing elites to their mean loses little here.

Figure 1 — Control cost across three system configurations
4681050002000100050020010050training samples (log, decreasing →)control costrandom shooting + directCEM + directCEM + delta
Figure 1. Control cost versus training-set size, 45 rollouts per point, whiskers are 95% CIs. Random shooting (amber) is flat: no relationship between data and control. CEM (blue) lowers cost at every size and produces a significant downward trend. Delta targets (teal) lower it further. Identical models and start-state seeds across all three.
SamplesRandom shootingCEMImprovement
50007.391 ± 0.6505.853 ± 0.32620.8%
20008.106 ± 0.6985.300 ± 0.29834.6%
10007.816 ± 0.7485.552 ± 0.43229.0%
5007.815 ± 0.6055.461 ± 0.24730.1%
2009.487 ± 0.7426.032 ± 0.29636.4%
1008.128 ± 0.5566.063 ± 0.20625.4%
508.275 ± 0.5447.090 ± 0.38014.3%
trend / decadenot significant−0.512 ± 0.174p = 0.0032
Table 3. Random shooting versus CEM on identical models and start states. CEM improves control at every sample size and produces a significant downward trend where random shooting produced none. Improvement is smallest at 50 samples (14.3%), consistent with a better planner mattering most when there is a better model to exploit.
A note on significance testing

Only 2 of 21 pairwise comparisons separate at non-overlapping 95% confidence intervals, and no adjacent pair does. An adjacent-pairs-only test would have declared this curve flat. Gradual degradation leaves each neighbouring step inside the noise while distant sizes separate; the trend is significant because all seven points lean the same way, not because any two are individually distinguishable. We report all pairs plus a weighted trend fit for this reason.

6Delta parameterisation

Predicting s' − s rather than s' is standard practice in model-based RL. We evaluated it here as a single-variable change, holding architecture, optimiser, epoch budget, planner and evaluation fixed. Prediction error is measured in next-state space in both parameterisations — the delta model's output is added back onto the input state before scoring — so the two numbers are directly comparable rather than being measured on targets of different magnitude.

SamplesMSE directMSE deltaGainCost directCost deltaGain
50000.0005490.0001483.70×5.8534.31826.2%
20000.0006110.0001553.93×5.3004.02824.0%
10000.0006240.0001853.36×5.5524.43820.1%
5000.0006550.0002242.92×5.4614.71513.7%
2000.0011010.0003912.81×6.0324.36527.6%
1000.0016390.0006262.62×6.0635.03317.0%
500.0044290.0016242.73×7.0905.15927.2%
Table 4. Delta versus direct next-state prediction, both measured in next-state space. Prediction improves 2.6–3.9× and control 14–28% at every sample size. Four of seven sizes (5000, 2000, 200, 50) separate at non-overlapping 95% CIs on control cost. The trend strengthens slightly to −0.498 ± 0.157 per decade (p = 0.0015).

This is the only intervention in the study that improved control by improving the model, and it partially revises the conclusion of Section 4. The planner was the dominant bottleneck under random shooting; with CEM in place, model quality visibly matters again. The two findings are complementary rather than contradictory: bottlenecks are ordered, and fixing one exposes the next.

The effect on sample efficiency is substantial. The delta model at 50 samples (control 5.159) outperforms the direct model at 5000 (5.853), and on prediction, delta-at-50 beats direct-at-200.

7Model-free reference

For calibration we trained SAC (Stable-Baselines3 defaults) on the same environment, scored through the identical evaluation loop — same cost function, same 200-step episodes, same 15 start-state seeds — by injecting its deterministic policy in place of the planner. Three independent training runs, evaluated at checkpoints.

Figure 3 — Model-free reference
24681012145001k2k5k10k20k50kenvironment steps of training (log)control costmodel-based band (4.03–4.72, from 50–5000 samples)SAC (model-free)
Figure 3. SAC on the same environment, scored through the identical evaluation loop. The spike at 2000 steps reproduced on all three seeds and is the entropy-driven exploration phase; the wide interval at 5000 reflects two of three seeds destabilising transiently. SAC enters the model-based band at roughly 2600–5000 steps and converges to 2.321, better than the model-based system's best of 4.028.
Env stepsCost95% CI
5008.708[7.819, 9.597]
10006.693[6.220, 7.167]
200012.803[12.438, 13.168]
50004.361[2.739, 5.983]
100002.508[2.149, 2.868]
200002.384[2.053, 2.714]
500002.321[2.010, 2.632]
Table 5. SAC on Pendulum-v1, scored on the model-based cost metric. The 2000-step spike reproduced on all three seeds and is SAC's entropy-driven exploration phase. The 5000-step interval is wide because two of three seeds destabilised transiently there.

SAC reaches the model-based system's performance band (~4.0–4.7) at roughly 2600–5000 environment steps, and converges to 2.321 — better than the model-based controller's best of 4.028. The comparison should be read as regime-dependent rather than as a winner: the model-based system attains 4.028 from 2000 samples of purely random data, where SAC at 2000 steps is at 12.803 and not yet a working controller; given 10× more interaction, SAC is better.

Two asymmetries should be noted. SAC is scored on a cost function it does not optimise (it maximises Pendulum's native reward), a mild handicap. Conversely, the sample comparison ignores that CEM expends roughly 10,000 model rollouts per control step at test time: the model-based system trades compute for samples.

8Discussion

The headline methodological result is that a model-based sample-efficiency curve should not be reported without a separate model-quality probe. In this study the control curve was flat while prediction error moved by 8×, and the correct response (change the planner) is the opposite of what the flat curve naively suggests (collect more data, or conclude the task saturates early).

The prediction curve also revealed a plateau invisible in the control data: from 5000 down to 500 samples, held-out MSE barely moves (0.000549 to 0.000655). Roughly 500 samples appear to saturate what this architecture extracts from random-action pendulum data, so the top half of the sweep could not have separated under any planner. That is useful information for designing the next experiment, and it is only available from the model probe.

Finally, the ordering of bottlenecks matters for interpretation. Two of our three interventions (averaging, CEM) fixed things that were not the model; the third (delta targets) fixed the model and was the largest single gain. A study that had tried delta targets first, under random shooting, would likely have measured a much smaller effect and drawn the wrong conclusion about its value.

9Limitations

1

Single environment. All results are from Pendulum-v1. The claim that control cost conflates model and planner is general, but the specific magnitudes are not, and we have not shown the pattern reproduces on higher-dimensional systems.

2

Fixed epoch budget. Every model trains for exactly 1000 full-batch epochs regardless of dataset size, so large-data models receive the same gradient budget spread over 100× more data and are the least converged. This compresses the high-data end of every curve and is the most likely reason 5000 samples rarely beat 2000. We left it fixed to change one variable at a time; scaling epochs with n or training to a validation threshold would likely steepen the curves.

3

The trend is real but weak. Only 1–2 of 21 pairwise comparisons separate individually. Significance derives from the consistent direction of all seven points, not from any pair being distinguishable. Raising evaluation episodes from 15 to ~40 would roughly halve the error bars.

4

Three model seeds per point. Adequate for the aggregate trend, but insufficient to characterise model-to-model variability, which later work on this system found to be substantial at small sample sizes.

5

Random-action data only. Every model trains on uniformly random torques, which explore the upright region poorly. Iterative data collection would likely change the curves materially and is the obvious next step.

6

One planner family. CEM with a fixed 20-step horizon and 100 candidates. We have not established whether 4.0 is a model limit or a planner limit; a stronger optimiser might extract more from the same models.

10Conclusion

Measured naively, this system showed no sample-efficiency curve. Measured properly, it shows a significant one (−0.498 ± 0.157 cost per decade of data, p = 0.0015), but only after the planner was strong enough to exploit the model and the model was parameterised to predict deltas. Mean control cost improved from 8.15 to 4.36 across the study without any change to the model architecture, training data, or environment.

The transferable lesson is diagnostic rather than architectural: when a model-based control result is flat, measure the model separately before concluding anything about data.

11Reproducibility

# both model-based experiments (~9 min)
python3 sample_effeciency.py

# prediction-only (~0.5 min) / control-only (~8.6 min)
python3 sample_effeciency.py --experiment prediction
python3 sample_effeciency.py --experiment control

# model-free reference (~26 min)
python3 sac_baseline.py

# planner equivalence check
python3 test_planner_equivalence.py

# delta vs direct, side by side
python3 compare_delta.py

All runs are seeded from a single master seed. Set PREDICT_DELTA = False to reproduce the direct-parameterisation results. Per-condition results are written to JSON alongside the figures. Package versions: gymnasium 1.3.0, torch 2.13.0+cpu, stable-baselines3 2.9.0.

Self Model Research
  1. Rung 1The Planner Hides the Model (this report)
  2. Rung 2A Wrong Model Is Worse Than None
  3. Rung 3Surprise Has a Signature
  4. Rung 4The Margin Was Rigid
  5. Rung 5An Arc of Elimination
  6. Rung 6The Quiet Body
  7. Rung 7Why Prediction Error Falls When the Body Changes