Planning, Control, and Policy Evaluation › Model Exploitation and Policy Ranking

Michael BrenndoerferAugust 3, 202610 min read
World Models HandbookAll chapters
Part 11 of 12Evaluation and Understanding
Chapter 64Planning, Control, and Policy Evaluation › Model Exploitation and Policy Ranking
Reading section 5 of 9 · Model Exploitation and Policy Ranking · 10 minSection 5 of 9 · 10 min

Book contents

Section 5 of 9 · 10 min read

Planning, Control, and Policy Evaluation › Model Exploitation and Policy RankingOne section · Sections in this chapter5 / 9 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Model exploitation occurs when action selection favors trajectories whose predicted value is spuriously high because of model errors. A planner can prefer such trajectories without knowing that its predictions are wrong. This is a possible failure mechanism, not an inevitable property of every optimizer. Our fitted model has region-dependent prediction errors, but the measured comparisons below show pessimistic return estimates and no PD ranking reversal. They therefore do not demonstrate optimistic exploitation in this toy. They show how to measure return-prediction gaps and policy-selection fidelity without assuming that a failure must appear.

Selection can create optimism even when individual estimates are unbiased. For fixed candidate values and integrable, conditionally unbiased score errors, the expected selected score overstates the selected candidate's true value by a nonnegative amount; it can be zero. In an equal-value example with independent identically distributed scale-family noise, expected maximum error grows with candidate count and noise scale. Correlated errors, unequal true values, and candidate composition can change that behavior. These conditions distinguish the optimizer's curse from an unconditional claim that more search worsens control.

Several mechanisms can contribute to a return-prediction discrepancy:

  • Dynamics error: f^(s,a)≠f(s,a)\hat f(s, a) \ne f(s, a) in the region the planner visits.
  • Reward-model error: r^(s,a)≠r(s,a)\hat{r}(s, a) \ne r(s, a) even if the dynamics are perfect.
  • Objective misspecification: the reward the planner optimizes is not the reward the environment's evaluation uses.

These are possible mechanisms, not an exact additive decomposition. Horizon truncation, changed feedback trajectories, planner randomness, and finite evaluation samples also affect what is compared. Different remedies address different mechanisms: improve relevant dynamics data or model class, check reward predictions, or align objectives. The toy uses the same specified reward everywhere and pairs planner streams, but this does not uniquely decompose the remaining discrepancy.

At a fixed position, −(p2+v2)-(p^2+v^2) discourages speed while −(p2−v2)-(p^2-v^2) rewards it. Accurate dynamics alone do not align those opposite objective preferences. In our experiments, r^=r\hat r=r; the MPC lookahead horizon still differs from the 30-step evaluation horizon.

Possible mitigations have different assumptions. PETS (Chua et al., 2018) propagates uncertainty from probabilistic ensembles through trajectory sampling; it is not an explicit ensemble-disagreement reward penalty. MOPO (Yu et al., 2020) uses uncertainty-penalized rewards in an offline model-based learning setting. Ensemble averaging can reduce unshared estimation variation, but shared errors can remain. State-conditioned action or state-action support constraints can restrict unsupported queries; marginal action bounds alone do not guarantee supported states. Shorter rollouts, terminal value estimates, and feedback replanning are other options, each requiring evaluation in its own setting.

Bootstrap resampling is one way to diversify ensemble fits, as in PETS. A terminal value estimate approximates reward beyond the rollout horizon instead of explicitly simulating every later step. Relative to executing one fixed open-loop plan, replanning performs a new search at each observation and therefore adds planning calls.

A penalty can sacrifice useful actions if uncertainty is miscalibrated or its scale is poorly chosen. An ensemble can agree on an incorrect prediction. A support constraint can exclude a useful unseen action. A shortened horizon can miss delayed reward, and a terminal value model can inherit training blind spots. Fresh observations let replanning react to discrepancies but do not guarantee correction of model error. These are mitigations to test, not safety certificates.

For the return-prediction comparison, run the same controller implementation in learned and true dynamics from identical initial cases. Each case reconstructs its planner stream with seed 110+i110+i before both runs. Model-closed-loop return uses predicted states as controller inputs and as reward arguments; true-closed-loop return uses reference states. This is not the planner's local HH-step candidate score. Even the controller that plans with true dynamics is evaluated inside the learned outer simulator for its model-predicted point below.

In[15]:
Code
comparison_set = [
    ("PD (kp=4,kd=3)", pd_policy),
    (
        "MPC learned H=10,K=64",
        make_mpc_factory(learned_step_batch, 10, 64),
    ),
    (
        "MPC oracle  H=10,K=64",
        make_mpc_factory(true_step_batch, 10, 64),
    ),
]

pred_vs_actual = []
for name, policy in comparison_set:
    actual = evaluate_policy(true_step_batch, policy, S0_eval)
    predicted = evaluate_policy(learned_step_batch, policy, S0_eval)
    pred_vs_actual.append(
        {
            "name": name,
            "actual_mean": float(actual.mean()),
            "actual_std": float(actual.std()),
            "predicted_mean": float(predicted.mean()),
            "gap": float(predicted.mean() - actual.mean()),
        }
    )
Out[16]:
Console
policy                      model-predicted     actual      gap
PD (kp=4,kd=3)                       -3.704     -3.588   -0.116
MPC learned H=10,K=64                -4.932     -4.612   -0.319
MPC oracle  H=10,K=64                -5.080     -4.731   -0.349

All three return estimates are pessimistic in the paired run. PD predicts about −3.704-3.704 and earns −3.588-3.588, a gap of −0.116-0.116. Learned-model MPC predicts −4.932-4.932 and earns −4.612-4.612, a gap of −0.319-0.319. True-dynamics MPC predicts −5.080-5.080 in the learned outer simulator and earns −4.731-4.731 in the reference environment, the largest negative gap here, about −0.349-0.349. These are model-closed-loop discrepancies, not evidence of optimistic exploitation or a unique causal decomposition.

The scatterplot compares true-environment and model-closed-loop mean return. Above the equality diagonal would mean optimism; all three points are below it. Streams are reconstructed before each paired run, while feedback trajectories and therefore chosen actions may still diverge between the two outer simulators.

Out[17]:
Visualization
Scatter plot of model-predicted return against true return for PD and MPC controllers, compared to a y=x line.
Model-closed-loop versus true-environment mean return for three controller implementations on the same 20 cases with reconstructed paired planner streams. Every point is below equality, indicating pessimistic estimates. True-dynamics MPC has the largest negative gap, about 0.349 return units. Feedback trajectories can still diverge between outer simulators; these are descriptive discrepancies, not a unique decomposition of model error.

Every point is below the equality diagonal. True-dynamics MPC has the largest negative discrepancy in this paired evaluation. Reporting only these model-predicted scores would understate the observed returns, so the useful lesson is to measure the discrepancy rather than assume optimism.

The diagonal is exact agreement between the two mean-return estimates. Departure measures return-prediction discrepancy; three policy points are not a full distributional calibration study.

The fixed candidate set tests scoring and ordering without adaptively generating candidates from model scores. Selecting the highest predicted score can still create selection optimism; fixing the set does not remove every selection effect. Good ordering on this finite set supports good selection within it, not on unseen policies. Poor ordering can compromise selection, but it does not prove that adding candidates or changing search cannot improve actual return.

In[18]:
Code
candidate_kps = [1.0, 2.0, 3.0, 4.0, 6.0, 8.0]
candidate_kds = [0.5, 1.5, 2.0, 3.0, 4.0, 5.0]
candidates = [
    (f"PD kp={kp},kd={kd}", lambda _seed, kp=kp, kd=kd: make_pd_policy(kp, kd))
    for kp, kd in zip(candidate_kps, candidate_kds)
]

ranking_data = []
for name, policy in candidates:
    actual = evaluate_policy(true_step_batch, policy, S0_eval).mean()
    predicted = evaluate_policy(learned_step_batch, policy, S0_eval).mean()
    ranking_data.append(
        {"name": name, "actual": float(actual), "predicted": float(predicted)}
    )


def pairwise_agreement(pred, true):
    n = len(pred)
    concord = 0
    discord = 0
    for i in range(n):
        for j in range(i + 1, n):
            dp = np.sign(pred[i] - pred[j])
            dt = np.sign(true[i] - true[j])
            if dt == 0:
                continue
            concord += int(dp == dt)
            discord += int(dp != dt)
    return concord, discord

Pairwise agreement is the fraction of pairs (i,j)(i,j) with yi≠yjy_i\ne y_j for which sign(pi−pj)=sign(yi−yj)\mathrm{sign}(p_i-p_j)=\mathrm{sign}(y_i-y_j), where pip_i is the predicted mean and yiy_i the measured reference mean. A predicted tie on non-tied truth counts as disagreement. If no true-score pair is eligible, the fraction is undefined and the code reports NaN. Selection regret is max⁡iyi−yi^\max_i y_i-y_{\hat i}, with i^=arg⁡max⁡ipi\hat i=\arg\max_i p_i and first-index tie breaking. It is nonnegative for this finite set, not a gap to the globally optimal policy. Equality of finite-sample means is a numerical tie convention, not proof of equal population returns.

Out[19]:
Console
Candidate set: 6 PD controllers (six zipped kp/kd pairs)
  PD kp=1.0,kd=0.5   model=  -4.701  actual=  -4.475
  PD kp=2.0,kd=1.5   model=  -3.847  actual=  -3.741
  PD kp=3.0,kd=2.0   model=  -3.676  actual=  -3.569
  PD kp=4.0,kd=3.0   model=  -3.704  actual=  -3.588
  PD kp=6.0,kd=4.0   model=  -3.635  actual=  -3.516
  PD kp=8.0,kd=5.0   model=  -3.613  actual=  -3.491

Pairwise ranking agreement: 1.000  (concordant 15, discordant 0)
Best true policy:           PD kp=8.0,kd=5.0
Model-selected policy:      PD kp=8.0,kd=5.0
Selection regret (finite-set): 0.000

For these six zipped PD gain pairs, all 15 eligible pairs are concordant, agreement is 1.000, and both score lists select kp=8,kd=5k_p=8,k_d=5. Finite-set regret is 0.000. This run demonstrates the diagnostic without producing a ranking failure. It does not establish order preservation outside this candidate set or the fixed evaluation cases.

The fixed candidate set can now be plotted directly, with the true best and model-selected points marked.

The scatter plot below places each PD candidate at its true return on the horizontal axis and its model-predicted return on the vertical axis. A star marks the best true candidate and an X the model-selected candidate. The two marks coincide in this run because the model selects the true best candidate. Their horizontal separation would measure finite-set selection regret if the selected candidates differed; here that regret is zero.

In[20]:
Code
candidate_pred = np.array([r["predicted"] for r in ranking_data])
candidate_true = np.array([r["actual"] for r in ranking_data])
# Ties in argmax are broken by the first candidate index.
best_true = int(np.argmax(candidate_true))
best_pred = int(np.argmax(candidate_pred))
Out[21]:
Visualization
Predicted versus true returns for fixed PD candidates, best and selected marked.
True versus model-predicted mean return for six fixed PD controllers. The star and X coincide because the model selects the same candidate as the true environment: agreement is 1 across all 15 non-tied pairs and selection regret is zero. Departures from the diagonal are return-prediction errors, not evidence of ranking reversals. This run illustrates the diagnostic without demonstrating a ranking failure.