AI Wiki中文/EN

Behavior cloning: copying an expert one decision at a time

行为克隆

Treat imitation as supervised learning of expert state–action pairs, see why a learner with zero training error can still crash, state the Ross–Bagnell T²ε bound with its conditions, and watch coverage and averaging of demonstrations decide what the copy does on a synthetic lane-keeping task.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

Copy what the expert did in each situation

Behavior cloning teaches a machine a skill by copying an expert. You record what the expert saw and what the expert did, then train an ordinary predictor to output the same action for the same input. For example, record a person steering a car and train a network to map each camera image to a steering angle. Definition

The appeal is simplicity. Behavior cloning (BC) needs no reward signal and no trial and error. It turns a control problem into supervised learning: fitting inputs to labelled outputs. The main alternative, inverse reinforcement learning, instead tries to recover the reward that explains the expert’s choices. BC versus IRL Background

The classic example is ALVINN, a 1988 neural network that steered a van called NAVLAB. It looked at a small camera image and a laser range image and chose how sharply to turn. It was trained on simulated road images and then drove a 400 m path in the woods at half a metre per second. ALVINN

The catch comes when the copy drives on its own. Its small mistakes move it to places the expert never went. The demonstrations give no advice for those places, so the copy can make more mistakes there. Errors pile up. This is called compounding error, and it is the main subject of this article. Compounding errors

This article builds on imitation learning, which compares BC with an interactive method on a two-lane task. Here we go deeper into BC itself: its recipe, its losses, ALVINN, and the worst-case bound on its cost, including what the bound does not say. We also show why it matters which states the demonstrations cover, and why averaging demonstrations can produce an action nobody took. The interactive fix is the subject of DAgger.

The recipe, the cost bound, and the averaging trap

This section writes BC as a supervised problem, states Ross and Bagnell’s bound on how much its cost can grow, and shows what squared loss does to mixed demonstrations.

The recipe

Osa and coauthors describe BC in four steps. Collect a set of expert demonstrations. Choose a policy representation, meaning the family of functions that map states to actions (a table, a linear model, a neural network). Choose an objective that measures how far the policy’s actions are from the demonstrated ones. Then optimise that objective on the demonstrations. Algorithm 1 A policy is just the rule that picks an action in each state.

They name two design choices as central. The first is the surrogate loss: how to score the difference between demonstrated and produced behaviour. “Surrogate” means a stand-in that is easy to optimise, since the real goal is good task performance, not low loss. The second is the regression method, which must be flexible enough for the task but still trainable. Design choices, §3.2

Osa and coauthors also separate two kinds of BC. Model-free BC learns the policy directly, usually in one pass. It is hard to apply to underactuated systems, robots with fewer motors than ways to move, which cannot follow an arbitrary path. Model-based BC learns or uses a model of the system’s dynamics. It can handle underactuation, but learning the model is often hard and needs iteration. Model-free versus model-based

Why it is not ordinary supervised learning

Ross and Bagnell write the problem with a few symbols. The expert policy π∗\pi^* is deterministic: it always takes the same action in the same state. The task lasts TT steps. Each step has a cost C(s,a)C(s,a) between 0 and 1, and lower total cost is better. The state distribution dπtd_\pi^t says how often policy π\pi is in each state at step tt. Notation Notation

BC picks the policy that best matches the expert on the expert’s own states:

π^=arg⁡min⁡π∈Π Es∼dπ∗[ℓ(s,π)]\hat\pi=\arg\min_{\pi\in\Pi}\ \mathbb{E}_{s\sim d_{\pi^*}}\big[\ell(s,\pi)\big]

In words: among the allowed policies Π\Pi, choose the one π^\hat\pi whose average loss ℓ\ell is smallest, where the average is taken over states ss drawn from where the expert goes, dπ∗d_{\pi^*}. The loss ℓ\ell can be the 0-1 loss (1 if the action differs from the expert’s, 0 otherwise) or a squared or hinge loss. Eq. (2)

The total cost of a policy over TT steps is written as follows. Cost Cost

dπ=1T∑t=1Tdπt,J(π)=∑t=1TEs∼dπt[Cπ(s)]=T Es∼dπ[Cπ(s)]d_\pi=\frac1T\sum_{t=1}^{T}d_\pi^{t},\qquad J(\pi)=\sum_{t=1}^{T}\mathbb{E}_{s\sim d_\pi^{t}}\big[C_\pi(s)\big]=T\,\mathbb{E}_{s\sim d_\pi}\big[C_\pi(s)\big]

In words: dπd_\pi is the state distribution averaged over the TT steps, and J(π)J(\pi) is the expected sum of per-step costs, which equals TT times the average per-step cost. Here Cπ(s)C_\pi(s) is the expected cost of acting with π\pi in state ss.

Notice the mismatch. BC is trained on states from dπ∗d_{\pi^*}, but its cost J(π^)J(\hat\pi) is paid on states from dπ^d_{\hat\pi}, its own distribution. In ordinary supervised learning the test inputs come from the same distribution as the training inputs, independent of the predictions. Here the learner’s actions decide its next inputs. Abstract Osa and coauthors list this as one of three ways imitation differs from supervised learning. The second is structure in the answer, such as joint limits, smoothness and coherent multi-step plans. The third is the high cost of examples: resetting a physical system to retry is costly or even infeasible. They add that the expert’s body may differ from the robot’s. Three differences, §1.3 Machine learning calls a train–test mismatch of the inputs covariate shift; see domain adaptation. Covariate shift

The T²ε bound

Ross and Bagnell’s Theorem 2.1 bounds how bad BC can get. Theorem 2.1 Ross, Gordon and Bagnell restate it for any surrogate loss that is an upper bound on the 0-1 loss. Theorem 2.1 restated

Es∼dπ∗[1{π^(s)≠π∗(s)}]≤ϵ ⟹ J(π^)≤J(π∗)+T2ϵ,Jtight=(1−Tϵ) J(π∗)+T2ϵ\mathbb{E}_{s\sim d_{\pi^*}}\big[\mathbf 1\{\hat\pi(s)\neq\pi^*(s)\}\big]\le\epsilon\ \Longrightarrow\ J(\hat\pi)\le J(\pi^*)+T^2\epsilon,\qquad J_{\text{tight}}=(1-T\epsilon)\,J(\pi^*)+T^2\epsilon

In words: suppose the cloned policy disagrees with the expert on at most a fraction ϵ\epsilon of the expert’s states. Then its total cost is at most the expert’s cost plus T2ϵT^2\epsilon. The second formula is the cost of a specially built bad case, which shows the bound cannot be improved in general.

The conditions matter, so here they are in one place:

  • each per-step cost is between 0 and 1;
  • the expert is deterministic;
  • ϵ\epsilon is the 0-1 error (or an upper-bounding surrogate) measured on the expert’s state distribution, averaged over the TT steps, not on the learner’s own states.

The authors’ intuition is short. Once π^\hat\pi errs, it can reach states the expert never visited. In the worst case it then pays the maximum cost 1 on every remaining step. Intuition Here is our own rough sketch of where T2T^2 comes from, not the authors’ proof. The chance that π^\hat\pi has already deviated by step tt is at most the sum of its per-step error rates so far. That sum is at most TϵT\epsilon. A deviation can cost up to 1 on each of up to TT steps, so the extra cost is at most T⋅TϵT\cdot T\epsilon.

Compare ordinary supervised learning. With independent test inputs, a classifier with error rate ϵ\epsilon makes about TϵT\epsilon mistakes in TT predictions: linear in TT. BC loses this because each input depends on earlier predictions. Ross, Gordon and Bagnell put it as a classifier that “can make as many as T²ε mistakes”. Introduction Introduction

What the bound does and does not say

The bound is a worst-case upper bound. Ross and Bagnell state that it is tight: one can construct a system, a cost and a policy with error ϵ\epsilon whose expected cost is exactly (1−Tϵ)J(π∗)+T2ϵ(1-T\epsilon)J(\pi^*)+T^2\epsilon. Tightness remark Example cited The construction and the proof are in their supplementary material, which we did not read; we rely on the main-text statements. Ross, Gordon and Bagnell also cite an earlier sequence-prediction example by Kääriäinen whose expected mistakes grow as T2T^2 for small ϵ\epsilon. Footnote 1

So the bound says that, in general, nothing better than quadratic growth can be promised for BC. It does not predict that every BC policy’s cost grows as T2T^2. A given policy on a given task may do much better. Ross and Bagnell add that BC can still have quadratic regret even on friendlier systems. In those systems one wrong action raises the expert’s remaining cost by at most a constant kk, and their interactive forward-training method is linear in TT. Favourable case, §3

Losses, and the averaging trap

The quadratic loss, the squared difference between predicted and demonstrated action, is the most common choice. Osa and coauthors show that minimising it is the same as maximum likelihood under Gaussian noise, where the demonstrated action equals fθ(x)f_\theta(x) plus bell-shaped noise. They list the absolute (ℓ1) loss and weighted quadratic losses as alternatives. Eqs. (3.3)–(3.12)

arg⁡max⁡θ E[log⁡p(y∣x,θ)]=arg⁡min⁡θ E[(y−fθ(x))2],arg⁡min⁡c E[(a−c)2∣s]=E[a∣s]\arg\max_\theta\ \mathbb{E}\big[\log p(y\mid x,\theta)\big]=\arg\min_\theta\ \mathbb{E}\big[(y-f_\theta(x))^2\big],\qquad \arg\min_{c}\ \mathbb{E}\big[(a-c)^2\mid s\big]=\mathbb{E}[a\mid s]

In words: the left part says fitting by squared error is fitting the most likely Gaussian model, where yy is the target action, xx the input and fθf_\theta the predictor. The right part says the single number cc that minimises the squared error to the demonstrated actions aa in state ss is their average, the conditional mean. The left part is from Osa and coauthors (their eqs. 3.7–3.9). The right part is a standard result that we add. Osa and coauthors note it only in passing, saying that squared-loss fitting gives the mean of the training samples. ℓ1 versus ℓ2, p. 51

Here is the one-line reason for the right part, in our words. Expand E[(a−c)2∣s]\mathbb{E}[(a-c)^2\mid s] as the variance of aa plus (E[a∣s]−c)2(\mathbb{E}[a\mid s]-c)^2; only the second term depends on cc, and it is zero when cc equals the mean.

The averaging is harmless when demonstrations scatter around one good action. It is a trap when there are several good actions. The imitation learning article mentions the standard case in one line: if half the drivers pass an obstacle on the left and half on the right, the average is straight ahead. The formula above says why, and Part 4 of the example and Exercise 2(c) put numbers on it. Demonstrations with more than one good answer are called multimodal. ALVINN met a version of this at road forks, where its output could point two very different ways and the steering oscillated. Forks One fix is a policy that outputs a distribution with several peaks, such as a Gaussian mixture, or a discretised action distribution.

A synthetic lane-keeping test

This section trains a BC policy on a toy lane-keeping task, measures how its cost grows with the horizon, compares the result with the bound, and tries two variations. The program is an original synthetic simulation, numpy only, with fixed seeds. The learner is a lookup table, not a neural network, and there is no real vehicle. The numbers illustrate the mechanism and the bound, not real driving.

The car’s state is its sideways offset yy from the lane centre, in metres, and its sideways velocity vv. Each step, the offset grows by the velocity, and the velocity changes by the steering action plus a little random noise (standard deviation 0.02). There are five steering actions: −0.1, −0.05, 0, 0.05 and 0.1. If ∣y∣|y| exceeds 1, the car has crashed. A crash is permanent and costs 1 on that step and every later one, so each step’s cost lies between 0 and 1, as Theorem 2.1 requires. JJ is therefore the expected number of crash-steps per episode.

The state space is cut into a 20 × 20 grid of cells. The expert picks the action closest to −(0.3yc+0.8vc)-(0.3y_c+0.8v_c), where (yc,vc)(y_c,v_c) is the centre of the current cell. So its action is constant within each cell. The learner is a table with one entry per cell, filled by majority vote over the demonstrations. In cells it never saw, it goes straight. That default stands for a learner with no information about unseen states.

import numpy as np

# Synthetic lane-keeping toy for behaviour cloning (no real vehicle, images or data).
# State: lateral offset y (m) and lateral velocity v (m/step).
#   y[t+1] = y[t] + v[t],   v[t+1] = v[t] + u[t] + w[t],   w ~ N(0, 0.02^2)
# Actions u: 5 steering values. |y| > 1 is a crash: absorbing, cost 1 on that step and on
# every later step, so the per-step cost lies in [0, 1].
# The state is cut into a 20 x 20 grid of cells (0.1 m in y, 0.05 m/step in v).
# Expert: the action closest to -(0.3*y_c + 0.8*v_c) at the centre (y_c, v_c) of the cell,
# so it is constant on each cell and a table can copy it exactly.
# Learner: lookup table over cells, fitted by majority vote; unseen cells default to u = 0.
ACTIONS = np.array([-0.1, -0.05, 0.0, 0.05, 0.1])
Y_EDGES = np.linspace(-1.0, 1.0, 21)
V_EDGES = np.linspace(-0.5, 0.5, 21)
NB = 20


def index(y, v):
    iy = np.clip(np.digitize(y, Y_EDGES) - 1, 0, NB - 1)
    iv = np.clip(np.digitize(v, V_EDGES) - 1, 0, NB - 1)
    return iy, iv


def cell(y, v):
    iy, iv = index(y, v)
    return iy * NB + iv


def expert(y, v):
    iy, iv = index(y, v)
    yc, vc = Y_EDGES[iy] + 0.05, V_EDGES[iv] + 0.025
    return np.argmin(np.abs(ACTIONS[None, :] + (0.3 * yc + 0.8 * vc)[:, None]), axis=1)


def fit_table(cells, labels):
    counts = np.zeros((NB * NB, ACTIONS.size))
    np.add.at(counts, (cells, labels), 1)
    table = np.full(NB * NB, 2)
    seen = counts.sum(axis=1) > 0
    table[seen] = np.argmax(counts[seen], axis=1)
    return table, seen


def rollout(table, n_ep, T, seed, wide=False):
    # table=None runs the expert. Returns mean cost, visited cells, expert labels and the
    # learner's error rate on the states it visited itself.
    rng = np.random.default_rng(seed)
    if wide:
        y, v = rng.uniform(-0.8, 0.8, n_ep), rng.uniform(-0.2, 0.2, n_ep)
    else:
        y, v = rng.normal(0.0, 0.1, n_ep), np.zeros(n_ep)
    crashed = np.zeros(n_ep, dtype=bool)
    cost = np.zeros(n_ep)
    cells, labels, mistakes, steps = [], [], 0, 0
    for t in range(T):
        a = expert(y, v) if table is None else table[cell(y, v)]
        live = ~crashed
        cells.append(cell(y[live], v[live]))
        labels.append(expert(y[live], v[live]))
        mistakes += np.sum(a[live] != labels[-1])
        steps += live.sum()
        y_next = y + v
        v_next = v + ACTIONS[a] + rng.normal(0.0, 0.02, n_ep)
        y = np.where(crashed, y, y_next)
        v = np.where(crashed, v, v_next)
        crashed |= np.abs(y) > 1.0
        cost += crashed
    return cost.mean(), np.concatenate(cells), np.concatenate(labels), mistakes / max(steps, 1)


# 1) Behaviour cloning from 5 expert demonstrations of 100 steps
_, C, L, _ = rollout(None, 5, 100, 1)
table, seen = fit_table(C, L)
print("1) BC from 5 expert episodes x 100 steps")
print(f"   labels = {C.size}, cells seen = {seen.sum()} of {NB * NB}, "
      f"training error = {np.mean(table[C] != L):.4f}")

# 2) Cost versus horizon, and the bound J(pi) <= J(pi*) + T^2 * eps (Ross and Bagnell 2010)
print("2) Expected crash-steps J versus horizon T (2000 test episodes each)")
print("   T     J(expert)  J(BC)     J(BC)/T  eps_E    J*+T^2*eps_E  eps_own(BC)")
for T in (25, 50, 100, 200, 400):
    j_exp, C_exp, L_exp, _ = rollout(None, 2000, T, 100 + T)
    eps_e = np.mean(table[C_exp] != L_exp)
    j_bc, _, _, eps_own = rollout(table, 2000, T, 100 + T)
    print(f"   {T:<5d} {j_exp:9.3f}  {j_bc:8.3f}  {j_bc / T:7.4f}  {eps_e:.4f}  {j_exp + T * T * eps_e:12.2f}  {eps_own:.4f}")

# 3) Same label budget, demonstrations started away from the lane centre (recovery data)
_, C2, L2, _ = rollout(None, 5, 100, 1, wide=True)
table2, seen2 = fit_table(C2, L2)
print("3) BC from 5 expert episodes started at y ~ U(-0.8, 0.8), v ~ U(-0.2, 0.2) (500 labels)")
print(f"   cells seen = {seen2.sum()} of {NB * NB}")
for T in (100, 400):
    j1 = rollout(table, 2000, T, 100 + T)[0]
    j2 = rollout(table2, 2000, T, 100 + T)[0]
    print(f"   T = {T}: J(BC, centred demos) = {j1:.3f}, J(BC, spread demos) = {j2:.3f}")

# 4) Two demonstrators pass an obstacle on opposite sides: squared loss averages them
demo = np.array([+1.0] * 50 + [-1.0] * 50)
print("4) Bimodal demonstrations (+1 = pass left, -1 = pass right), 50 each")
print(f"   least-squares constant prediction = {demo.mean():.2f} (steers straight at the obstacle)")

Part 1 trains BC on 5 expert episodes of 100 steps: 500 labels. They visit only 14 of the 400 cells, all near the lane centre. The training error is 0.0000: the table copies the expert perfectly on every state it was shown.

Part 2 tests the same table at five horizons, with 2000 test episodes each. ϵE\epsilon_E is BC’s 0-1 error on fresh expert runs, the quantity in Theorem 2.1. ϵown\epsilon_{\text{own}} is BC’s error on the states it visits itself.

TJ(expert)J(BC)J(BC)/Tε_EJ* + T²ε_Eε_own
250.0000.5260.02110.01308.150.0696
500.0002.7450.05490.008220.430.0578
1000.0009.2090.09210.005454.300.0419
2000.00032.7060.16350.0046182.700.0353
4000.000102.7100.25680.0039621.400.0297

Four things stand out. First, zero training error, yet BC crashes, while the expert never crashes in these runs. Second, the cost per step, J(BC)/T, rises from 0.0211 to 0.2568. Cost grows faster than the horizon, which is the compounding the theory describes. Third, the bound holds in every row but is loose: at T=100T=100 it allows 54.30 and BC pays 9.209. It is a worst-case guarantee, not a forecast.

Fourth, the error on BC’s own states is 5 to 8 times its error on the expert’s states. At T=100T=100 the ratio is 0.0419/0.0054≈7.80.0419/0.0054\approx7.8. This is the distribution shift made visible. ϵE\epsilon_E itself falls as TT grows, because long expert runs spend more time near the centre, where the table is right.

A quick hand check of the T=100T=100 bound: 1002×0.0054=54.0100^2\times0.0054=54.0. The program prints 54.30 because it uses the unrounded error, about 0.00543.

Part 3 keeps the budget at 500 labels but starts the 5 expert episodes spread across the lane, with yy between −0.8 and 0.8 and vv between −0.2 and 0.2. These demonstrations include recoveries from off-centre states. They cover 35 cells instead of 14. The cost at T=100T=100 drops from 9.209 to 6.550, and at T=400T=400 from 102.710 to 84.672. Pomerleau made the same point in 1988: the network must also be shown how to get back to the centre after a mistake. Recovery examples Better coverage helps, but it does not remove the problem.

Part 4 gives 50 demonstrations of +1 (pass left) and 50 of −1 (pass right) for the same observation. The best constant under squared loss is their mean, 0.00: straight at the obstacle.

Where behavior cloning falls short

This section lists what BC cannot do on its own and what the example does not show.

Demonstrations cannot cover everything. The learner will meet states the expert never visited, and supervised accuracy says little about them. Osa and coauthors note that collecting demonstrations in all situations is infeasible, so corrections must focus on the states that matter. Errors cascade, §3.4.3 For huge spaces, BC must rely on generalization. They note that Go has more than 1017010^{170} board configurations. Go, p. 57

Offline accuracy is a poor test. A held-out set of demonstrations comes from the expert’s distribution, so it measures ϵE\epsilon_E, not closed-loop behaviour. In Part 2, ϵE\epsilon_E is 0.0054 at T=100T=100 while the error on the learner’s own states is 0.0419. Evaluate by letting the policy run. A model that memorises demonstrations can also suffer ordinary overfitting.

Averaging hurts multimodal tasks. Squared-loss regression returns the conditional mean, which can be an action no demonstrator took. Choose a policy class that can represent several good actions.

The bound needs its conditions. It assumes costs in [0, 1], a deterministic expert and ϵ\epsilon measured on the expert’s distribution. It is a worst-case statement. It neither predicts the cost of your policy nor excludes much better behaviour.

Accounts of ALVINN differ. The 1988 NIPS paper reports training on 1200 simulated road images. Training data Osa and coauthors’ survey describes ALVINN as trained on collected pairs of camera images and steering commands, and says it drives off the road quickly. ALVINN in the survey We report the two accounts separately and do not merge them. Ross and Bagnell also quote a sentence on ALVINN straying from the road and cite Pomerleau’s ALVINN paper in NIPS, dated 1989 in their reference list. We did not find that wording in the NIPS proceedings version we read, so we do not quote it. That version makes the related point about recovery examples.

The example is a toy. The learner is a table that goes straight in unseen cells. A neural network would generalise differently and might do better or worse. The numbers show the mechanism, not how often real BC systems crash.

Exercises

These exercises cover the main failure, a hand calculation, a misreading of the bound and method choice.

  1. In the example, BC has training error 0.0000 and still averages 9.209 crash-steps per 100-step episode. Explain why, without equations.

    Answer: Training error is measured on the states in the demonstrations. Five expert runs visit only 14 of 400 cells, the ones near the centre. Noise sometimes pushes the learner into a cell it never saw. There it goes straight, its velocity persists, and it drifts into more unseen cells until it crashes. The expert, from the same state, would have corrected. Accuracy on the expert’s states (ϵE=0.0054\epsilon_E=0.0054 at T=100T=100) says little about accuracy on the learner’s own states (0.0419).

  2. (a) Use the T=100T=100 row to compute the Ross–Bagnell bound and compare it with the measured JJ. (b) If ϵ\epsilon stayed at 0.0054, what would the bound be at T=200T=200? (c) At one observation, 60% of demonstrations say +1 and 40% say −1. What does a squared-loss constant predictor output?

    Answer: (a) J∗+T2ϵ=0+1002×0.0054=54.0J^*+T^2\epsilon=0+100^2\times0.0054=54.0. The program prints 54.30 because it uses the unrounded ϵ≈0.00543\epsilon\approx0.00543. The measured J=9.209J=9.209 is well below. (b) 2002×0.0054=216200^2\times0.0054=216, four times larger for twice the horizon. (c) The conditional mean, 0.6×1+0.4×(−1)=0.20.6\times1+0.4\times(-1)=0.2: a weak steer that neither group of demonstrators chose.

  3. A colleague says: “The bound says cost grows as T2T^2, so doubling the horizon always quadruples BC’s cost.” Use the table to correct this.

    Answer: The bound is an upper bound, tight only for a constructed worst case. Measured JJ goes from 9.209 to 32.706 (×3.55\times3.55) when TT goes from 100 to 200, and from 32.706 to 102.710 (×3.14\times3.14) from 200 to 400. The ratio falls as more episodes crash: a crashed episode pays at most 1 per step, so JJ can never exceed TT. Also ϵE\epsilon_E itself changes with TT. The bound guarantees that cost cannot exceed J∗+T2ϵJ^*+T^2\epsilon. What it shows is that, unlike independent supervised learning, nothing better than quadratic can be promised for BC in general.

  4. Choose between plain BC, BC with more diverse demonstrations, DAgger, and inverse RL or RL, and justify: (a) a simulated planner can label any state cheaply; (b) you have a fixed log of human driving and no further access to the driver; (c) two equally good strategies exist, pass left or pass right; (d) the task’s rewards are known and a simulator allows trial and error.

    Answer: (a) An interactive method such as DAgger: the expert can label the learner’s own states, which attacks the distribution shift directly. Interactive setting (b) BC is what is possible. Widen coverage if you can (spread starts lowered JJ from 9.209 to 6.550 in the example) and evaluate in closed loop, not only on held-out logs. If the log has rewards, offline RL is an option. (c) BC with a multimodal policy class, such as a mixture or a discretised action distribution, rather than squared-loss regression, which averages to 0.00 in the example. ALVINN oscillated at forks. (d) Inverse RL or reinforcement learning, possibly initialised by BC. Osa and coauthors summarise AlphaGo’s policy network as first trained by supervised imitation on 30 million positions from the KGS Go server and then improved by self-play. AlphaGo summary

History and further reading

This section traces where BC came from, how the compounding-error analysis arose, and where to read next.

Osa and coauthors list early supervised imitation in action–state space: Widrow and Smith (1964), Chambers and Michie (1969) and Pomerleau’s ALVINN. We did not read the first two and know them only from this survey. Early studies, §3.4.1

ALVINN is described in Pomerleau’s NIPS 1988 paper. The network had three layers. Its inputs were a 30 × 32 video “retina” (960960 units, using the blue colour band for road contrast), an 8 × 32 laser range retina (256256 units) and one road-intensity feedback unit. That makes 960+256+1=1217960+256+1=1217 inputs. They fed 29 hidden units and 46 output units. Architecture Of the outputs, 45 encode turn curvature, with the centre unit meaning straight ahead. The 46th is a road-intensity feedback unit whose value is fed back to the input on the next image. The training target was a “hill” of activation over nine units, centred on the curvature that would bring the vehicle to the road centre 7 m ahead. At test time the most active unit set the steering. Output coding

Pomerleau trained ALVINN on 1200 simulated road snapshots with varied positions, lighting and noise. After 40 epochs it chose a curvature within two units of correct about 90% of the time on new simulated images. Training He already anticipated two of the issues above. Training on real images on the fly needs enough variety, and the network must be shown how to recover. At forks the output could split two ways. Discussion Training on simulation and running on a real vehicle is the subject of sim-to-real transfer.

The formal analysis came two decades later. Ross and Bagnell’s 2010 paper stated the T2ϵT^2\epsilon bound and its tightness, with the proof and the tight example in a supplement we did not read. It also proposed two interactive remedies, forward training and SMILe. Reductions Ross, Gordon and Bagnell’s 2011 paper introduced DAgger, which collects expert labels on the learner’s own states and gives bounds linear or near-linear in TT on some problem classes. These methods need an expert who can be asked during training, such as a person teleoperating a robot. Interactive methods DAgger Details are in DAgger; human demonstration collection is in teleoperation.

For a long, careful survey, read Osa and coauthors’ Chapter 3, which covers losses, model-free and model-based BC, and teacher–student interaction. Chapter 3 Linear policies fitted by least squares are the simplest case; see linear regression. Learning from fixed logs with rewards is offline RL, and the decision-process language behind the notation is in Markov decision processes. Large demonstration collections and newer policy classes are covered in robot datasets, diffusion policy and vision–language–action models.

Make a prediction, then check

A behavior-cloning policy has 0-1 error ε = 0.0054 under the expert's state distribution, horizon T = 100, per-step costs in [0, 1], and the expert's cost is 0. Which statement about its expected total cost J is correct?

Choose one answer

Learning objectives

  • Write behavior cloning as supervised learning under the expert's state distribution, name its design choices (policy representation, surrogate loss, model-free or model-based), and explain why squared loss averages multimodal demonstrations into an action no demonstrator took.
  • State Ross and Bagnell's bound J(π̂) ≤ J(π*) + T²ε with its conditions (costs in [0, 1], ε is the 0-1 error under the expert's state distribution), evaluate it by hand, and explain why it is a tight worst-case upper bound rather than a prediction for every policy.

Prerequisites & connections

Explore related knowledge →

References

  1. ALVINN: An Autonomous Land Vehicle in a Neural Network — NIPS 1988 proceedings
    Dean A. Pomerleau · 1988
  2. Efficient Reductions for Imitation Learning — AISTATS 2010, scoped
    Stéphane Ross; J. Andrew Bagnell · 2010
  3. A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning — scoped conference paper
    Stephane Ross; Geoffrey Gordon; Drew Bagnell · 2011
  4. An Algorithmic Perspective on Imitation Learning — Foundations and Trends in Robotics 7(1–2), arXiv v1, scoped
    Takayuki Osa; Joni Pajarinen; Gerhard Neumann; J. Andrew Bagnell; Pieter Abbeel; Jan Peters · 2018
  5. Sim-to-Real Transfer in Deep Reinforcement Learning for Robotics: a Survey — arXiv v2, scoped
    Wenshuai Zhao; Jorge Peña Queralta; Tomi Westerlund · 2020

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Claude · 2026-12-03 · Independent AI check (Claude subagent, not the author; not a human or expert review). Research was done by a separate research subagent (facts.md) and the prose by a writer subagent. No Gemini style edits were logged for this topic in gemini-edits-016a.json, so I did the D012 readability pass on the intuition section myself in both languages. I ran example.py with the pinned interpreter (numpy 1.26.4); its output is byte-identical to example.stdout.txt, both python blocks are byte-identical to example.py, and every number in the prose, table, exercises and quiz matches the output (ratios 5.35–7.76, ×3.55 and ×3.14, 100²×0.0054 = 54.0 versus the printed 54.30, 0.6−0.4 = 0.2). I re-derived the display equations and the conditional-mean argument. I fetched the sources myself and extracted text with pdftotext: Pomerleau's NIPS 1988 ALVINN paper (architecture, 46th output = road-intensity feedback unit, hill values, 1200 simulated snapshots, 40 epochs, ~90%, Chevy van NAVLAB, 1/2 m/s, 400 m, on-the-fly/recovery passage, fork oscillation; the 'when driving for itself' sentence is not in it); Ross & Bagnell 2010 pp. 661–664 (Theorem 2.1 with 'Proof in Supplementary Material', the intuition, the tightness remark citing the supplement and Kääriäinen, §3 u_i/k discussion and 'still have quadratic regret', teleoperated robot, reference list entry 'Pomerleau (1989) ... In NIPS'); Ross, Gordon & Bagnell 2011 pp. 627–629 (abstract/§1 'as many as T²ε mistakes', §2 notation with C in [0,1], eq. (2), Theorem 2.1 restated for surrogates that upper-bound the 0-1 loss, footnote 1, the (1−Tε)J(π*)+T²ε example); Osa et al. arXiv v1 printed pp. 10–11, 48–51, 54–57, 62–64 (three differences, resets 'too costly or even infeasible', embodiment, covariate shift, Algorithm 1 and design choices, quadratic loss and Gaussian likelihood, the ℓ1 paragraph on p. 51, model-free versus model-based, ALVINN account 'drives off the road quickly', 30 million KGS positions, more than 10^170 configurations); Zhao et al. §II-F (BC versus IRL). I did not read Ross & Bagnell's supplementary material (the proof and tight example), which the article says, nor Widrow & Smith, Chambers & Michie or Silver et al. (Osa's summary only, labelled). I compared zh and en section by section, checked that all wiki links point to published topics (unpublished neighbours such as dagger, sim-to-real, teleoperation, robot-datasets, diffusion-policy and vision-language-action stay inline code), that the source ID set matches across languages, and that prerequisites and related IDs exist in src/data/catalogue.txt. I also compared the article with the published imitation-learning article: it does not reuse that article's two-lane example or its exercises; the left/right obstacle illustration, which that article mentions in one line, is now explicitly framed as built on it.

  • The example was rerun with the pinned interpreter and matches example.stdout.txt byte for byte; both code blocks equal example.py; every number in the prose, table, exercises and quiz matches the output.
  • The T²ε bound was checked against the papers: costs in [0, 1], deterministic expert, ε the 0-1 (or upper-bounding surrogate) error under the expert's state distribution; the article calls it a worst-case upper bound, tight only for a constructed example, with the proof and example in the unread supplement.
  • ALVINN's numbers match the NIPS paper; the NIPS account (training on simulated images) and Osa et al.'s account (collected image–steering pairs, drives off the road quickly) are kept separate; the 'when driving for itself…' sentence is not quoted.
  • zh and en compared section by section: same claims, definitions, numbers, exercises, answers and caveats; unpublished topics appear only as inline code, never as links.

Source locations checked:

  • ALVINN: An Autonomous Land Vehicle in a Neural Network — NIPS 1988 proceedings · NeurIPS proceedings PDF pp. 305–313 read in full. p. 305: abstract (3-layer back-propagation network, camera and laser range inputs, trained on simulated road images). p. 306: architecture (30×32 video retina, blue band; 8×32 range retina; feedback unit; 1217 inputs; 29 hidden; 46 outputs; 45 curvature units; target hill centred on the curvature reaching the road centre 7 m ahead). p. 307: hill values 0.10 … 1.00 … 0.10; training on simulated images (logistics of real data). p. 308: 1200 snapshots, random activation of the feedback input early in training, 40 epochs, ~90% within two units; NAVLAB. p. 309: 1/2 m/s, 400 m path, comparison with the ALV group's 1 m/s. pp. 309–311: representations. p. 311: on-the-fly training needs variability and recovery examples. p. 312: fork oscillation; range data not necessary for reasonable performance. p. 313: references. The 'when driving for itself…' quotation used by Ross & Bagnell is NOT in this proceedings version, although their reference list cites this same NIPS paper as 'Pomerleau (1989)'. pp. 306–307 also: the 46th output is the road-intensity feedback unit, recirculated to the input.
  • Efficient Reductions for Imitation Learning — AISTATS 2010, scoped · pdftotext (plus UTF-8 extraction to confirm the dropped ε glyph) of the PMLR PDF. p. 661: abstract (compounding errors, quadratic regret), §1 (ALVINN, O(T²) vs O(T)). p. 662: §1 end (interactive setting, teleoperated robot), §2 notation (π* deterministic, C ∈ [0,1], e(s,a), d_π^i, d_π, J = T E[C_π]), §2.1 (π̂ = argmin under d_π*, Theorem 2.1 J ≤ J(π*) + T²ε, intuition, tightness (1 − Tε)J(π*) + T²ε citing the supplement and Kääriäinen). p. 663: §3 forward training, Theorem 3.1, Algorithm 3.1, u_i, bound J ≤ J(π*) + T·mean(ε_i u_i), worst case ≤ T²ε̄, imitation-loss case u_i = 1, k-bounded case kTε̄. p. 664: favourable cases still quadratic for the traditional approach; §4 SMILe start, Lemmas 4.1–4.2. p. 665: Algorithm 4.1 (skimmed). NOT read: rest of p. 665 onward, experiments, supplementary material.
  • A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning — scoped conference paper · Official PMLR PDF. For this topic: p. 627 abstract and §1 ('as many as T²ε mistakes'); p. 628 §2 notation (C bounded in [0,1], J = Σ_t E_{d_π^t}[C_π]), surrogate loss ℓ (0-1, squared, hinge), eq. (2) supervised approach, Theorem 2.1 restated, footnote 1 (Kääriäinen's example bounded by T²ε, Θ(T²) for small ε); p. 629 Ross & Bagnell's example J(π̂_sup) = (1 − Tε)J(π*) + T²ε, §2.2–2.3. Full reading recorded under dagger (pp. 627–632).
  • An Algorithmic Perspective on Imitation Learning — Foundations and Trends in Robotics 7(1–2), arXiv v1, scoped · pdftotext of arXiv v1, printed pages (PDF = printed + 7). p. 10: §1.3 three differences from supervised learning, resets, embodiment. p. 11: covariate shift / domain adaptation; relation to RL. p. 46: ch. 3 opening (BC definition), §3.1. p. 48: Algorithm 1, §3.2 design choices. pp. 49–50: quadratic loss eqs. (3.3)–(3.9) Gaussian ML equivalence, weighted/Mahalanobis (3.10)–(3.11), ℓ1 (3.12). p. 54: model-based BC costs, §3.4 opening, Table 3.1. p. 55: §3.4.1 early studies, ALVINN description (camera–steering pairs; 'drives off the road quickly' — Osa's wording), Table 3.2. p. 56: Pomerleau recovery quotation, i.i.d. violation. p. 57: Go > 10^170 configurations, AlphaGo 30 million KGS positions then self-play. pp. 59–60: §3.4.3 errors cascade, i.i.d. violated, corrections focused on relevant states. NOT read: p. 47, pp. 51–53, chapters 2, 4–5. Added by the independent checker: p. 51, the ℓ1-loss paragraph (ℓ2 minimisation gives the mean of the training samples, ℓ1 the median), cited for the conditional-mean remark; the rest of pp. 51–53 still not read.
  • Sim-to-Real Transfer in Deep Reinforcement Learning for Robotics: a Survey — arXiv v2, scoped · p. 3 §II-F only for this topic: BC learns observation-to-action mappings from demonstrations; IRL estimates a reward. Full reading recorded under sim-to-real.

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.