What to Follow in In-Context Imitation Learning

OPTIC: Object-or-Position Tests for In-Context imitation learning

Xianjie Dai1,* Li Mi2,* Ahmad Mouri Zadeh Khaki1 Kyunghwan Choi1 Mohamed Elhoseiny3 Heye Huang1,† Jian Ding3,†
1KAIST 2ETH Zurich 3KAUST
*Equal contribution †Corresponding authors
KAIST ETH Zurich KAUST

What to Follow?

A demonstration shows both the object the robot handles and its position. When the two cues diverge in a new scene, an in-context imitation learning (ICIL) policy must decide which one to follow.

A demonstration picks up the carrot from slot A. In the new test scene the carrot lies in slot B and a mushroom in slot A: following the object selects the carrot, following the position selects the mushroom.

The demonstration picks up the carrot from slot A. In the new scene, following the object selects the carrot; following the demonstrated position selects the mushroom at slot A.

Motivation

ICIL allows a robot policy to perform a task in a new scene following a demonstration, without updating its weights. In common evaluations, however, the object and position cues are mostly aligned between the demonstration and the new scene, so a success does not show which one the policy followed. We introduce OPTIC, a benchmark that tells the two cues apart, and use it to evaluate six ICIL policies, both end-to-end and optimization-based, on placement, pouring, and insertion tasks, each at three generalization levels.

The OPTIC Benchmark

The target scene and its correct action stay fixed; only the demonstration changes. In the Object-follow test the demonstration shares only the object, in the Spatial-follow test only the position, and in the Match test both, as in most current evaluations. Training pairs are built the same three ways from the same recorded episodes, giving Object specialists, Spatial specialists, and Match models.

Training pairings (Object, Spatial, Match) and evaluation settings (Object-follow, Spatial-follow, Match tests)

Three task suites define the object and the position differently. Each is tested at three generalization levels: L1 keeps the training conditions, L2 introduces unseen appearances, combinations, or colors, and L3 unseen shapes, routes, or socket positions.

Three task suites (Placement, Pouring, Insertion), each at three generalization levels

Evaluated policies: ICRT, ICLR, BPP, ContextFlow, and Instant-Fold (end-to-end), IMOP (optimization-based), and GPT-Policy (zero-shot VLM agent).

Results

Trained on Match pairs, policies follow the position

Across the six trained policies, Spatial-follow success keeps 93.7% of the Match success, while Object-follow success keeps only 1.7%: every end-to-end Match model scores zero in the Object-follow test. The zero-shot GPT-Policy, in contrast, follows the object.

Policy Suite 1 Placement Suite 2 Pouring Suite 3 Insertion
MatchSpatialObject MatchSpatialObject MatchSpatialObject
ICRT 77.257.80.0 66.766.70.0 77.877.80.0
ICLR 76.757.80.0 66.766.70.0 80.082.20.0
BPP 66.163.90.0 68.971.70.0 95.095.00.0
ContextFlow 62.260.60.0 68.968.30.0 68.372.20.0
Instant-Fold 63.354.40.0 66.765.60.0 55.657.80.0
IMOP 76.732.223.3 52.254.40.0 71.168.30.0
GPT-Policy† 99.40.099.4 100.00.083.3 98.30.097.2
Success (%) of the Match models in the Match, Spatial-follow, and Object-follow tests, averaged across generalization levels. Highlighted: the higher of Spatial and Object. †Zero-shot.

Re-pairing changes what a policy follows

Re-pairing the same recorded episodes, without new data or architectural changes, shifts which cue a policy follows. Following the object is much harder to learn: excluding IMOP, Object specialists average 19.6% in the Object-follow test, against 68.4% for Spatial specialists in the Spatial-follow test.

Policy Spatial specialists Object specialists
MatchSpatialObject MatchSpatialObject
ICRT 67.066.90.0 2.72.821.4
ICLR 63.863.50.0 5.45.418.8
BPP 78.577.30.0 6.15.628.0
ContextFlow 70.869.90.0 4.44.019.0
Instant-Fold 64.264.10.0 5.95.110.7
IMOP 66.562.40.1 56.10.446.3
Success (%) averaged across levels and the three suites, mean over three training runs. Highlighted: the test that shares the cue of the training pairing. Per-suite results are in the paper.

One model can hold both abilities

Re-pairing yields one specialist per cue. Can a single model hold both abilities and follow whichever cue it is told to? We compare three signals that tell a single model which cue to follow.

Mode token
An extra input in the context: follow the object, or follow the position.
The unified models reach nonzero success in both tests, where their Match models score zero in the Object-follow test. On average, ICRT and ICLR outperform their Match models, while BPP and Instant-Fold perform worse.
Language
A task description that names the target, e.g. “insert the plug into the cyan socket at the top”.
ContextFlow reaches 68.3% in the Object-follow test on average, against 19.0% for its Object specialist.
Two demonstrations
The cue the two demonstrations share is the one to follow.
ICRT and BPP both outperform their Match models on average (Suites 1 and 2); BPP by 7.0 points.

Mode tokens can enable both abilities in one model but are not always effective, while language, which names the target directly, complements the demonstration and reduces the ambiguity in what to follow.

Videos

Match model and re-paired specialists

ICRT at L2, the same target scene in each suite; only the demonstration and the model change. Real time.

One model with both abilities

Rows: mode token (ICRT, Suite 3), language (ContextFlow, Suite 3) and two demonstrations (ICRT, Suite 1). Each row keeps its model and its L2 target scene across the two tabs; the demonstrations follow the test. Real time.

BibTeX

@article{optic,
  title   = {What to Follow in In-Context Imitation Learning},
  author  = {Dai, Xianjie and Mi, Li and Mouri Zadeh Khaki, Ahmad and Choi, Kyunghwan and Elhoseiny, Mohamed and Huang, Heye and Ding, Jian},
  journal = {arXiv preprint},
  year    = {to be added}
}