DL0121 Open-Loop vs Closed-Loop Validation

Explain why open-loop validation metrics (e.g., MSE on offline trajectories) often fail to correlate with closed-loop success rates in physical robotics or driving environments.

Answer

Open-loop evaluation replays a logged trajectory and asks the policy to reproduce the expert action at states the expert visited, with ground-truth history fed back in at every step, so each prediction error is scored and then discarded. Closed-loop execution feeds every error into the next observation, so the policy’s own state distribution drifts off the demonstration manifold and errors compound: the classic behavior-cloning result turns a per-step error \epsilon into an excess cost of up to T^2 \epsilon over a T-step episode, a bound that is already vacuous for a 200-step driving episode at \epsilon = 0.01. Two further effects break the correlation before compounding even starts. MSE is mean-seeking: its minimizer is the conditional mean \mathbb{E}[a \mid s], and averaging the two valid modes of “swerve left or swerve right around the obstacle” produces a straight-line action that is optimal under the metric and a collision in the world. And metric mass is not risk mass: most logged frames are trivial lane-following, so average displacement error is dominated by how well a model extrapolates its own velocity, which is why an MLP fed only ego status with no perception input at all scored competitively on nuScenes open-loop L2 while being worthless as a planner.

(1) Covariate Shift: open loop measures the loss under d_{\pi^*}, the expert’s state distribution, while success is determined under d_{\pi}, the policy’s own induced distribution; the two diverge as soon as the policy acts.
(2) Compounding Error: teacher forcing caps the deviation at one step’s worth of error, whereas rollout integrates it, giving the quadratic-in-horizon gap that a single-step regression number cannot express.
(3) Mode Averaging: a squared-error objective on a multimodal action distribution returns an interpolation of the modes, which is frequently the one infeasible action available.
(4) Long-Tail Mismatch: safety outcomes are decided by a fraction of a percent of frames (cut-ins, occluded pedestrians, contact-rich grasps), and those frames contribute almost nothing to a dataset-averaged MSE.
(5) Non-Reactive Logs: logged agents never yield, brake, or negotiate, so open loop cannot score any behavior whose correctness depends on how the world responds to the ego.
(6) Shortcut Exploitation: ground-truth history leaks the answer; extrapolating the logged ego velocity minimizes displacement error without any scene understanding, and that shortcut vanishes the moment the policy controls its own history.

Two panels: left shows a logged expert trajectory with short prediction-error arrows at each sampled state and the state reset to the log after every step; right shows the same per-step error accumulating into a rollout that curves away from the dashed expert reference into off-distribution states

Figure 1: Open-loop scoring resets the policy onto the logged state after every prediction, so a bounded per-step error stays bounded; closed-loop rollout feeds each error into the next observation, and the visited states leave the training distribution where the policy has no guarantees at all.

The theory is unusually clean here. Ross and Bagnell showed that supervised imitation with per-step loss \epsilon under the expert distribution admits an excess cost that grows as T^2 \epsilon, because a mistake at step t can put the agent in a state where it makes mistakes for all remaining T - t steps; on-policy correction such as DAgger restores the linear T \epsilon rate precisely by collecting labels on d_{\pi}. The practical consequence is that ranking two policies by offline \epsilon tells you almost nothing about their closed-loop ordering, since the multiplier between them differs by a factor of T and depends on recovery behavior that the offline data never contains. Codevilla and colleagues measured this directly on vision-based driving models and found offline prediction error to be a weak predictor of on-road driving quality, and the nuPlan and NAVSIM benchmarks were built specifically because open-loop leaderboard position stopped tracking closed-loop driving score.

Mathematical Formulation:
\epsilon = \mathbb{E}_{s \sim d_{\pi^*}}\left[\ell(s, \pi(s))\right]
J(\pi) - J(\pi^*) \leq T^2 \epsilon
\lVert d_{\pi} - d_{\pi^*} \rVert_1 \leq 2 T \epsilon
\pi_{\mathrm{mse}}(s) = \mathbb{E}[a \mid s]
\pi_{\mathrm{mse}}(s) = 0.5 a_L + 0.5 a_R

Where:

  • \epsilon is the offline per-step error that an open-loop MSE actually reports, and \ell is the per-state surrogate loss (squared action error, displacement error).
  • \pi is the learned policy, \pi^* the expert, and J the closed-loop episode cost, with per-step cost bounded in [0, 1].
  • d_{\pi^*} and d_{\pi} are the state distributions induced by the expert and by the policy; open loop samples the first, deployment samples the second.
  • T is the episode horizon in control steps, the multiplier that an offline metric never sees; the bound becomes vacuous once T^2 \epsilon \geq T.
  • a_L and a_R are two equally valid expert modes (pass left, pass right) at the same state s; their MSE-optimal average drives straight into the obstacle.
  • Required condition for the bounds: the offline data is drawn from d_{\pi^*} with no on-policy correction, which is exactly the assumption behind pure behavior cloning.
Log-scale chart of excess closed-loop cost against episode length T for a fixed per-step error of 0.01: the offline metric is a flat line at 0.01, on-policy correction grows linearly as T times epsilon, and behavior cloning grows quadratically as T squared times epsilon

Figure 2: A single offline number \epsilon is consistent with wildly different closed-loop outcomes, because the horizon T is the multiplier and it is invisible to the metric; on-policy data collection is what changes the exponent from 2 to 1.

PropertyOpen-loop replayClosed loop, log-replay agentsClosed loop, reactive agents or hardware
States visitedExpert distribution onlyPolicy distribution, but in a world frozen to the logPolicy distribution with a world that responds to it
Error feedbackNone; state is reset each stepEgo error compounds; other agents do not reactFull two-way feedback including other agents
Typical metricAction MSE, ADE/FDE, L2 at 1/2/3 sRoute completion, collision rate, comfort sub-scoresTask success rate, interventions per kilometer or per trial
Cost per evaluationOne forward pass per frame, fully parallel, secondsSequential rollout, hundreds of scenarios, minutes to hoursHighest; wall-clock hardware time or heavy sim agents
Main blind spotRecovery, mode collapse to the mean, ego-status shortcutsFalse collisions from behind, merges and nudges scored unfairlySim-to-real gap in sensing, or low statistical power on real hardware

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *