Robotics
← Roadmap/Learning

Imitation Learning

Learning from demonstrations — BC, DAgger, diffusion policies.

Progress0/5 questions

Prerequisites

Why it matters in robotics

Imitation learning — training a policy from demonstrations — is the dominant paradigm behind today's real-robot manipulation and vision-language-action policies. Naive supervised training on demonstrations suffers from a mismatch between the situations the policy was trained on and the situations it encounters once it's acting on its own, causing small errors to compound over a task; a range of techniques address this by refining how demonstrations are collected and how actions are predicted, especially when a single instant could reasonably be followed by more than one correct next move. These ideas underpin many current real-robot systems, alongside practical concerns like collecting demonstrations via teleoperation.

What to study

  • Behavior cloning as supervised learning, and why covariate shift causes compounding errors that grow with the task horizon.
  • DAgger and interactive imitation: aggregating expert labels on the learner's own state distribution to break the i.i.d. assumption.
  • Action chunking and temporal ensembling (ACT) to reduce compounding error, and diffusion/flow policies for multimodal action distributions.
  • How imitation learning underpins modern VLA policies (OpenVLA, pi-0) and the practicalities of demonstration collection via teleoperation.

Where to study

Cheatsheet

Symbols used below

πθ\pi_\thetalearned policy
π\pi^*expert policy
TTtask horizon (timesteps)
ϵ\epsilonper-step probability of a policy mistake

Behavior cloning

Supervised learning on expert (state, action) pairs: minimize Esπ[(πθ(s),π(s))]\mathbb{E}_{s \sim \pi^*}\big[\, \ell(\pi_\theta(s), \pi^*(s))\big].

It only sees states the expert visits. Once πθ\pi_\theta makes a small error and drifts to a state the expert rarely visited, it has no training signal there — errors compound and worst-case regret grows like O(ϵT2)O(\epsilon T^2) with the horizon.

Covariate shift

The training distribution (expert's state visitation) and the test-time distribution (the learned policy's own state visitation) diverge as soon as πθπ\pi_\theta \ne \pi^* — this mismatch, not a lack of model capacity, is the core failure mode of naive BC.

DAgger

Interactive imitation breaks the mismatch: roll out the current πθ\pi_\theta, query the expert for the correct action on the states it actually visits, aggregate those labels into the dataset, and retrain.

Because training data now comes from the learner's own distribution, regret grows linearly in TT instead of quadratically — at the cost of needing a queryable expert online rather than a fixed offline dataset.

Action chunking

Predicting a short sequence of future actions per inference step (instead of one action at a time) and blending overlapping chunks at execution time (temporal ensembling) smooths the trajectory and reduces how often compounding error gets a chance to accumulate, without needing an online expert.

Multimodal actions

A single instant can have more than one reasonable next move (go left or right around an obstacle). Averaging those modes under an MSE loss produces an invalid action in between them.

Diffusion and flow-matching policies model the full action distribution instead of its mean, so they can represent and sample from genuinely multimodal behavior.

Demonstration collection

Real-robot demonstrations are usually gathered via teleoperation (joystick, VR controller, or a kinesthetic/leader-follower rig). Teleop data quality — smoothness, coverage of recovery behavior, consistency across operators — directly bounds how good any imitation-learned policy can be.

 Behavior cloningDAggerDiffusion / flow policy
Data sourceFixed offline expert demosOnline expert queries on learner statesFixed offline expert demos
FixesNothing — baselineCovariate shiftMultimodal actions
Regret vs. horizonO(ϵT2)O(\epsilon T^2)O(ϵT)O(\epsilon T)Same as BC unless combined with DAgger
RequiresJust logged dataA queryable expert at train timeMore inference compute (iterative denoising)

Application focus

Select an application above.

Practice questions (5)