arXiv(opens in a new tab)cs.ROOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.06843

Recursive Video In-Context Learning for Agentic Robot

Wenrui Bao, Xinxin Liu, Bingxin Xu, Yuzhang Shang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

LLM agents that orchestrate frozen vision-language-action (VLA) policies improve across episodes through text memory, which records what the agent did but not how the task is done. A demonstration video shows it, but fits poorly into an agent's context. The full video slows every turn, fixed keyframes lose the contact detail that decides whether a grasp holds, and what the agent needs shifts from the task's structure while planning to the frames around each contact. We introduce Recursive Video In-Context Learning (RV-ICL), a training-free method that turns a demonstration into a hierarchy the agent navigates rather than a prompt it receives. The hierarchy is built from the sub-events of the demonstration, such as grasps and releases. Its levels grow finer, from keyframes of the whole task to phases, moments and short clips, and are exposed through read-only tools. The agent reads the coarse levels before planning. During execution it re-enters the hierarchy whenever a step needs more detail and loads only the clip of its current sub-goal. One demonstration per task is enough. Built on RPent, RV-ICL raises success from 92.6% to 96.5% on LIBERO-PRO and from 86.7% to 95.8% on LIBERO-Plus.

1 Introduction

Large language models (LLMs) are increasingly deployed as the deliberative layer of robot systems. They decompose instructions, localise objects, and call learned visuomotor policies for the contact-rich steps they cannot perform analytically (Ahn et al., 2022; Liang et al., 2023; Huang et al., 2022). Recent agentic harnesses push this design further. HarnessVLA (Zhang et al., 2026c), released as the RPent framework, exposes a frozen VLA as one retryable primitive among a few analytic ones. A coding agent orchestrates them and improves across episodes through text memory: recipes, lessons and failure rules. Under distribution shift, this design outperforms end-to-end VLAs by a wide margin.

How far the agent can improve, however, is bounded by what text can record. The agent writes its memory from its own execution traces, so the memory describes its calls and their outcomes rather than the task itself. It can record that a grasp failed, but not what a successful execution looks like: which object is taken first, from which side the hand approaches, how high the object is lifted, when the gripper opens. Such knowledge is spatial and temporal, and it is hard to put into words.

What is hard to put into words is easy to show: a video of the task captures all of it, frame by frame. Such a video is also cheap to obtain. A human demonstration only requires recording a person actually performing the task, with no action labels or other annotation. Large models can learn from demonstrations placed in their context, in text (Brown et al., 2020) and with interleaved images (Alayrac et al., 2022). This suggests letting the agent watch a demonstration of its task, much as a person watches a how-to video before trying something new.

But in what form should the video enter the agent’s memory? The obvious answers fail for three reasons. (i) Length. A demonstration spans hundreds of frames, and the agent re-reads its whole context at each of its tens to hundreds of turns. Long contexts also degrade how well models use their content (Liu et al., 2024). (ii) Resolution. A few keyframes are affordable, but they drop the frames around each contact, which decide whether a grasp holds or a placement registers. (iii) Timing. What the agent needs changes over the episode: the task’s structure before it acts, and the frames around a particular contact once it reaches that step. No fixed presentation of the video can satisfy all three constraints at once.

∗^{*}Corresponding author.

(a) Demonstration hierarchy "put the yellow and white mug in the microwave and close it"

Figure

(b) Recursive access in one episode

Figure 1: Overview of RV-ICL on a task from the LIBERO-10 suite of LIBERO-PRO. The agent receives one demonstration of the task as a hierarchy (a) and consults it while solving the same task in a new layout (b). (a) The hierarchy has four levels: L0L_{0} event-driven keyframes (thin lines mark their time), L1L_{1} phases between grasps and releases, L2L_{2} moments around each sub-event, and L3L_{3} 20-frame clips, here of the first grasp. (b) The tool calls of one solved evaluation episode (consecutive calls grouped, robot actions in grey, re-entries in orange). The agent reads L0−L2L_{0}-L_{2} while planning and loads clips only during execution. Each re-entry loads the clip of the current sub-goal: the grasp, the release or the closing of the door.

Since each moment of the episode calls for a different part of the demonstration, why not let the agent watch just that part, and only at that moment? Methods for long documents and long videos already take this route: instead of reading everything, the language model navigates a hierarchical index (Sarthi et al., 2024; Wang et al., 2024; Packer et al., 2023). We bring this idea to embodied agents, which decide from their own progress when to look closer: before a delicate contact, at the start of a new sub-goal, or after a step goes wrong.

We build such an index over a demonstration and call the method Recursive Video In-Context Learning (RV-ICL). The index is a tree whose levels grow finer: event-driven keyframes of the whole task, the phases between sub-events, the moments around each sub-event, and short clips from any camera (Figure 1a). The agent reads the coarse levels before planning and does not collect clips up front. Whenever it needs more detail during execution, the agent re-enters the tree at the node of its current sub-goal and pulls only the relevant clip (Figure 1b). The demonstration is thus consulted recursively, at the level of detail and the moment the agent's progress calls for.

RV-ICL requires no training, no change to the VLA, and one demonstration per base task. The hierarchy is built from the sub-events of the demonstration, the instants at which one sub-task ends and the next begins. The same construction therefore applies to any task that decomposes into sub-tasks.

We make the following contributions:

• We introduce video in-context learning to tool-using robot agents: their text memory cannot record what a successful execution looks like, but a demonstration video shows it frame by frame ( §3.1§3.1).

• We propose Recursive Video In-Context Learning (RV-ICL), which lets the agent look only at the part of the demonstration its current step needs, by giving it recursive access to a hierarchy built from the demonstration’s sub-events ( §3§3).

• On LIBERO-PRO, RV-ICL raises the success rate of HarnessVLA from 92.6% to 96.5%, above every baseline, and on LIBERO-Plus from 86.7% to 95.8% across seven kinds of perturbation. On the long LIBERO-10 tasks it gains up to 12 points, where keyframes or the whole video of the same demonstration gain at most 2 ( §5§5).

References (63)