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
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:
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.
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.
| Samples | Cost (1 rollout) | Cost (45 rollouts) |
|---|---|---|
| 2000 | 16.018 | 8.106 ± 0.698 |
| 1000 | 6.014 | 7.816 ± 0.748 |
| 500 | 4.767 | 7.815 ± 0.605 |
| 200 | 4.097 | 9.487 ± 0.742 |
| 100 | 7.071 | 8.128 ± 0.556 |
| 50 | 4.047 | 8.275 ± 0.544 |
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.
| Samples | Test MSE | vs. identity | Control cost |
|---|---|---|---|
| 5000 | 0.000549 | 203.7× | 7.391 ± 0.650 |
| 2000 | 0.000611 | 183.0× | 8.106 ± 0.698 |
| 1000 | 0.000624 | 179.1× | 7.816 ± 0.748 |
| 500 | 0.000655 | 170.6× | 7.815 ± 0.605 |
| 200 | 0.001101 | 101.5× | 9.487 ± 0.742 |
| 100 | 0.001639 | 68.2× | 8.128 ± 0.556 |
| 50 | 0.004429 | 25.2× | 8.275 ± 0.544 |
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.
| Samples | Random shooting | CEM | Improvement |
|---|---|---|---|
| 5000 | 7.391 ± 0.650 | 5.853 ± 0.326 | 20.8% |
| 2000 | 8.106 ± 0.698 | 5.300 ± 0.298 | 34.6% |
| 1000 | 7.816 ± 0.748 | 5.552 ± 0.432 | 29.0% |
| 500 | 7.815 ± 0.605 | 5.461 ± 0.247 | 30.1% |
| 200 | 9.487 ± 0.742 | 6.032 ± 0.296 | 36.4% |
| 100 | 8.128 ± 0.556 | 6.063 ± 0.206 | 25.4% |
| 50 | 8.275 ± 0.544 | 7.090 ± 0.380 | 14.3% |
| trend / decade | not significant | −0.512 ± 0.174 | p = 0.0032 |
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.
| Samples | MSE direct | MSE delta | Gain | Cost direct | Cost delta | Gain |
|---|---|---|---|---|---|---|
| 5000 | 0.000549 | 0.000148 | 3.70× | 5.853 | 4.318 | 26.2% |
| 2000 | 0.000611 | 0.000155 | 3.93× | 5.300 | 4.028 | 24.0% |
| 1000 | 0.000624 | 0.000185 | 3.36× | 5.552 | 4.438 | 20.1% |
| 500 | 0.000655 | 0.000224 | 2.92× | 5.461 | 4.715 | 13.7% |
| 200 | 0.001101 | 0.000391 | 2.81× | 6.032 | 4.365 | 27.6% |
| 100 | 0.001639 | 0.000626 | 2.62× | 6.063 | 5.033 | 17.0% |
| 50 | 0.004429 | 0.001624 | 2.73× | 7.090 | 5.159 | 27.2% |
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.
| Env steps | Cost | 95% CI |
|---|---|---|
| 500 | 8.708 | [7.819, 9.597] |
| 1000 | 6.693 | [6.220, 7.167] |
| 2000 | 12.803 | [12.438, 13.168] |
| 5000 | 4.361 | [2.739, 5.983] |
| 10000 | 2.508 | [2.149, 2.868] |
| 20000 | 2.384 | [2.053, 2.714] |
| 50000 | 2.321 | [2.010, 2.632] |
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
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.
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.
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.
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.
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.
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
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.
- Rung 1The Planner Hides the Model (this report)
- Rung 2A Wrong Model Is Worse Than None
- Rung 3Surprise Has a Signature
- Rung 4The Margin Was Rigid
- Rung 5An Arc of Elimination
- Rung 6The Quiet Body
- Rung 7Why Prediction Error Falls When the Body Changes