arXiv:2610.40356cs.ROOct 2026

Manuscript Offprint

arXiv:2610.40356

JEDI: Joint-Embedding Demonstration Compression for In-Context Imitation Learning

Jiazhao Liang, Zhewen He, Shuaihang Yuan, Hao Huang, Yi Fang

Jiazhao Liang 1∗^{1*} Zhewen He 2∗^{2*} Shuaihang Yuan 2^{2} Hao Huang 2^{2} Yi Fang 2^{2}

1^{1}New York University Tandon School of Engineering, Brooklyn, NY 11201, USA

2^{2}NYUAD Center for Artificial Intelligence and Robotics (CAIR) and Embodied AI and Robotics (AIR) Lab, New York University Abu Dhabi, Abu Dhabi 129188, UAE

Human demonstrations

Figure

JEDI

predictive compression

compress each demo

into latent slots

independently, cached

demo N

more demonstrations

Robot rollout

policy

flow matching

slots are trained

to predict the

next keyframe

Figure

Real-world tasks from human-hand demonstrations

inset: human-hand demonstration · main: robot rollout

Figure

Stack cups

Paper roll on holder

Fruit to basket

Cube to drawer

Cubes to box

Figure 1: Many demonstrations, compressed by prediction. JEDI compresses each demonstration independently into k latent slots, which are cached and trained to predict the next keyframe of the query episode; a flow-matching policy attends to the slots and acts on the robot. Top: human demonstrations of one task, their compression, and keyframes of the resulting robot rollout. Bottom: five real-world tasks executed from human-hand demonstrations (inset: demonstration; main: robot rollout).

Abstract

In-context imitation learning (ICIL) adapts robot policies through test-time demonstrations, but long multimodal trajectories constrain how many examples fit in context. We ask what a compressed demonstration should preserve. We propose JEDI, which compresses demonstrations into latent slots trained to predict query episode's next-stage keyframe in a frozen video-JEPA space. Task and process counterfactuals help the slots preserve execution details, while the predictor selects demonstrations from a bank. Post-training with keypoint tokens enables human-hand conditioning on robots. Experiments on LIBERO and real robots show that JEDI supports many-shot context; LIBERO objective controls show improved success and demonstration following over action-only compression. These findings support query-future prediction as a training objective for preserving execution-relevant information in compressed demonstrations.

1 Introduction

In-context learning lets a language model adapt to a new task from examples in its prompt, without weight updates (Brown et al., 2020). In-context imitation learning (ICIL) extends this ability to robot manipulation: at test time a policy receives demonstrations of an unseen task configuration and executes it without fine-tuning (Fu et al., 2025; Vosylius and Johns, 2025; Ding et al., 2026). Its scope is unseen objects, arrangements and goals composed of motion primitives seen in training.

The bottleneck is the context itself. A demonstration is a multi-view sensorimotor trajectory spanning hundreds of control steps and still takes thousands of tokens after subsampling, so current ICIL policies typically use only one or two demonstrations, while transformer policies degrade

∗^{*}Equal contribution.

when prompts exceed the lengths seen during training (Yoo et al., 2026). Compression alleviates this cost: ContextFlow compresses each demo with perceiver-style compressors (Ding et al., 2026), but its compressor is trained only through the action loss and is evaluated with a single demonstration.

This leaves open what a demonstration compressor should retain. Pooled task embeddings (James et al., 2018; Jang et al., 2022) are inexpensive but retain little beyond the intent of the task, whereas the full sensorimotor context retains the stage-dependent detail that control needs, at a cost linear in the number of demonstrations (Li, 2026). Language models face the same question: prompts are compressed into gist tokens (Mu et al., 2023) or by autoencoding (Ge et al., 2024), and in the many-shot regime such compressors can underperform the simple baseline of using fewer shots (Khatri et al., 2025). A compressor's training objective, not only its architecture, decides what is kept.

We argue that a compressor should retain the information that allows the policy to anticipate the next stage of its own episode, and propose JEDI (Joint-Embedding Demonstration compression for In-context imitation learning). JEDI compresses each demonstration into k latent slots, from which a predictor forecasts the query episode's next-stage keyframe in the embedding space of a frozen video JEPA, V-JEPA 2.1 (Assran et al., 2025; Mur-Labadia et al., 2026). Because most of a future frame is predictable from the current one, a counterfactual term requires the prediction to be worse when the slots come from a demonstration of another task, or of the same task performed differently. The slots therefore carry the process of the demonstration, such as object order and grasp height, and not only its task identity. Each demonstration is compressed independently, so its slots can be cached and reused, and a policy can attend to many demonstrations (Figure 1).

At test time the query’s future is unknown, but the bank demonstrations’ futures are known. We score each demonstration by how well its slots predict the others’ keyframes, extending predictive selection of language-model in-context examples to embodied demonstrations (Rubin et al., 2022).

Success rate alone does not reveal what a policy uses from its context. We adapt the analysis of in-context learning in language models, which separates recognizing a task from learning it (Min et al., 2022; Pan et al., 2023), and the paired-context protocol recommended for ICIL (Li, 2026): on the same checkpoints we swap demonstrated goals and, separately, vary the process at a fixed endpoint. Across these tests, predictive compression keeps stage-dependent detail that action-only compression loses and follows swapped demonstrations 40.8 points more often ( §4.5§4.5).

Our contributions are as follows. (1) Predictive compression. A per-demonstration compressor is trained with a demonstration-conditioned predictive objective in a frozen video-JEPA space, together with task and process counterfactuals (§3). After policy training, these predictively pretrained, frozen slots achieve 75.4% success (§4.4). (2) Predictive demonstration selection. The predictor decides which demonstrations to place in context based on its prediction error. To separate the effect of which demonstrations are chosen from how many are used, we compare all methods at the same number of demonstrations (N). Across three seeds, this selection beats random choice and, when the demonstration pool is diverse, also beats image-based retrieval (§3.6, §4.3). (3) Post-training with human-hand demonstrations. Keypoint-based post-training supports human-hand context on a dual-arm platform, without test-time weight updates (§3.7, §4.7). (4) Language and demonstrations. JEDI follows the demonstrations where the instruction is silent and the instruction where it is explicit, more reliably than action-only compression on LIBERO-Order (§4.6).

References (27)