How much behavior cloning is DAgger worth?
Behavior cloning is the simplest way to imitation learn a policy: collect expert demonstrations and train a policy to predict the expert’s action in each state, as ordinary supervised learning. But this is susceptible to distribution shift: the policy only ever sees the states the expert visited, so a small mistake that lands it somewhere unfamiliar can lead to compounding errors. DAgger fixes this with on-policyness: you roll out the current policy, have the expert label the states the policy actually reaches, add those to the dataset, and train a fresh policy. The downside is that you need the expert on call throughout training, labeling states picked by a policy that may be half-trained and acting strangely.
How many behavior cloning labels does DAgger buy? To find this exchange rate, I created a top-down 2D racing task. The code is in this GitHub repo.
The car is a kinematic bicycle1: the left and right front wheels are lumped into a single steerable wheel and the left and right rear wheels into a single fixed wheel, spaced by a wheelbase L that influences the yaw rate. The car drives at a constant speed on random tracks2 2-8 m wide. A pure-pursuit expert follows the track’s centerline3, and the learner (a 2x64 MLP) sees 9 distance rays4 and the current wheel angle. Behavior cloning trains on 200-step expert rollouts; DAgger spends the same labels over up to 10 rounds (a round is a cycle of “let the current policy drive, have the expert label what it saw, retrain”5). Each strategy is scored on the share of cars that finish a lap of an unseen test track. The exchange rate R(p) is behavior cloning labels ÷ DAgger labels needed to reach crash-free rate p.
As you’d expect, the gap widens as the track narrows (narrower track -> less room for recovery if the learner veers off the centerline). On 8 m tracks, both behavior cloning and DAgger reach 100% by 10k labels. R at 95% crash-free is 21 on 3 m tracks, 43 on 2.75 m, and undetermined at 2.5 m and narrower, as behavior cloning never reaches that crash-free rate:

Smoothing the crash-free rate curves into monotonicity with isotonic regression6 and interpolating performance in log-space between budgets, we get this exchange rate curve:

This gap grows with horizon T. But a little DART-style collection noise erases most of the gap7:

Steering noise of 0.005 of full lock (about 3 mm of drift) brings R to 2-5 on every width, and 0.2 to about 1:

DAgger theory predicts that cumulative disagreement with the expert grows quadratically in the horizon T for behavior cloning but linearly in T for DAgger. But we only somewhat observe this, even charging crashed cars the maximum loss for the rest of the drive, as is standard in theory — at collection noise 0, the exponent for behavior cloning seems somewhat higher than that for DAgger, especially at larger budgets, but its growth isn’t cleanly quadratic:


Also, 0.005 is a tiny amount of noise to result in such a large performance improvement for behavior cloning. The DART explanation for why noising expert data helps is that it cheaply simulates the states a behavior cloning learner wanders into. But here, noise 0.005 barely moves the expert’s states. Comparing each noisy expert rollout with the noise-free one from the same start, the median gap is just 0.22-0.33% of the track’s half-width, and the 95th percentile 0.5-0.8%. That’s about 3-8 mm on these tracks. By contrast, noise-0 behavior cloning on its own 3 m laps reaches 0.36 of the half-width at the 95th percentile. So, the noisy data covers essentially none of the states that behavior cloning drifts into.
What gives?
Rather than the classic T² compounding drift of behavior cloning, most of the exchange rate gap here is due to causal confusion: behavior cloning copies the wheel angle. Without noise, the observed wheel angle is the expert’s previous command, and copying it matches the label about as well as behavior cloning does on held-out data.8 This leads to a feedback loop where a steering error persists step to step (an example loop described in Spencer et al., 2021: “At train time, the robot learns that the previous action (Brake) accurately predicts the current action almost all the time. At test time, when the learner mistakenly chooses to Brake, it continues to choose Brake, creating a bad feedback cycle that causes it to diverge from the expert.”).
Injecting steering noise means that the current wheel angle is not exactly the expert’s previous action, so copying the wheel angle quickly stops paying off:

The principled fix of dropping (or jittering) confounded inputs9 (from, e.g., ChauffeurNet) works just as well as noising expert data (which can be impractical in real settings, because it can lead the expert into dangerous states) — behavior cloning with only the distance rays for input (or with the rays and a jittered wheel angle for input) achieves a crash-free rate competitive with DAgger in effectively all settings:

A satisfying window into the mechanism is that behavior cloning with nonconfounded inputs learns to correct when placed off-center on a straight stretch of a track:

So, how much behavior cloning is DAgger worth? In this top-down car racing sim, with nonconfounded inputs, about as many labels as you’d give DAgger: no on-call expert required.
-
Interview question: in what order should you train a fresh DAgger policy — should minibatches go round 0 followed by round 1 and so on, and within each round, step 0 followed by step 1 and so on? Answer: each fresh network should be trained on minibatches that are a random mix of steps from different rollouts, different tracks, and different rounds. This is because training in order would hurt: consecutive steps of a rollout are nearly identical, so feeding a rollout from step 1 to step n would give the network batch after batch of almost the same example, so its gradients would point in nearly the same direction for long stretches. It would also overfit to whichever rollout it saw most recently and forget earlier ones: training order really matters in neural network training, SGD wants each batch to look like a random sample of the whole dataset, and this is no different in DAgger. ↩
-
In other words, this racing task meets the two conditions under which Wen et al., 2020 show that the “copycat problem” arises in imitation policies accessing past observations: “(i) expert actions over time are strongly correlated, and (ii) past expert actions are easily recovered from the observation history”. ↩
-
Not needed for DAgger, as it turns out, because it is automatically immune to the confound: the observed wheel angle is the learner’s previous command, not the expert’s. So, copying it doesn’t predict the label. ↩