Manuscript Offprint

arXiv:2611.12885

World In-Context Learning for Agentic Robot Manipulation

Heng Fang, Zehui Guo, Yuehan Zhang, Mingyang Du, Dingkang Liang, Xiang Bai

Abstract

Trained action policies write manipulation skill into network weights, tying what is learned to the distribution it is learned from. In-context learning (ICL) avoids this coupling but has not matched trained policies, because a demonstration recorded in another scene carries no feedback from the world the robot currently faces. We observe that what an agent learns in context is semantic, recording task steps and object roles rather than visual appearance, so experience gathered in one world transfers to another. Based on this insight, we propose World In-Context Learning (WICL), a paradigm in which a frozen model starts from a demonstration, rehears the task in a world such as a simulator, and writes the feedback into its context rather than its weights. We build RoboScript, a modular infrastructure that implements WICL for agentic manipulation. From a single demonstration, RoboScript learns each task through rehearsal in simulation, freezes the learned knowledge as a Task Memory, and deploys the frozen memory on new scenes with data isolation that ensures every deployment input is available on a real robot. On all 50 tasks of RoboTwin 2.0, RoboScript reaches 83.4% mean success across clean and randomized settings with one demonstration per task and no gradient updates, exceeding the strongest trained action policy by over 20 points. The method generalizes across visual distributions, improves through reflection, scales with the foundation model, and transfers to a physical dual-arm robot through cross-embodiment memory adaptation. With a world in the loop, a robot can learn a manipulation task in its context as well as it learns one in its weights.

Code: https://github.com/ArcheOne-AI/RoboScript Project page: https://ArcheOne-AI.github.io/RoboScript

1 Introduction

In-context learning (ICL) is a defining capability of foundation models. A model with frozen weights adapts to a new task from what its context shows, without any gradient update [5, 14]. Robot manipulation has long followed a different path. The dominant approach trains an action policy, either a vision-language-action (VLA) model [2, 3, 41, 55, 59, 104] or a world action model (WAM) [12, 86], and writes manipulation skill into network weights. This approach has made clear progress, but it ties what is learned to the distribution it is learned from. FastWAM [89], a widely adopted WAM trained on clean demonstrations of RoboTwin 2.0, reaches 77.8% mean success on clean scenes but drops to 1.9% under domain randomization [11]. Every new task or distribution requires new data and new training. ICL has recently emerged as a promising alternative that avoids this coupling. Recent models can perform a new manipulation task from a single demonstration given in their context, without any weight update [26, 68, 97]. This progress raises the question we study. Can a robot learn a manipulation task in its context as well as it learns one in its weights?

The in-context route avoids this coupling, but it has not matched trained policies, because its context carries

Figure

Figure 1 (a) Three paradigms for learning manipulation. Skill in weights is bound to the training domain. ICL avoids retraining but is bound to the shown scene. WICL rehearses in a world and stores semantic knowledge that transfers across settings. (b) RoboScript maps the coding-agent stack to robot manipulation, with the world replacing the terminal. (c) Success rate on all 50 RoboTwin 2.0 tasks with one demonstration and no gradient updates.

no feedback from the world. A demonstration is recorded in another scene and cannot tell the robot what will happen on the table in front of it. A frontier model (e.g. GPT-6 Astra) did not improve when given a demonstration from a different layout in its prompt, although some of its traces show it correcting its actions after observing their outcomes [92]. Code as Policies and its successors can control a robot through APIs, but without world feedback their errors accumulate [32, 53, 67, 88]. Coding agents show what is missing. They learn a new repository by running code in a terminal and reading what comes back [76, 83]. The feedback loop they rely on has no counterpart in robot manipulation.

Our key observation is that what an agent learns in context is semantic. It records object roles, task steps, and what went wrong, not the visual appearance of the world. Experience gathered in one world therefore carries over to another, as long as the two worlds agree on the semantics of the task. A cheap world that is faithful to the task, such as a simulator, a learned world model, or a latent model of the scene, is enough to learn in. Rehearsal in such a world is also safe, unlike acting directly on real hardware, where unsafe actions have damaged equipment [92].

We formalize this insight as World In-Context Learning (WICL), a learning paradigm that extends in-context learning with feedback from a world, as illustrated in Fig. 1a. A WICL learner keeps its weights frozen, starts from a demonstration, rehears the task in a world, and distills the feedback into its context. The resulting knowledge is semantic and transfers from the rehearsal world to the deployment world without retraining. After rehearsal, the context is frozen and evaluated on instances that were never rehearsed, so the result measures generalization, not memorization. The context is readable text, which allows the agent to review its own evaluations and rewrite what it has learned, enabling recursive self-improvement (RSI) without gradient updates. The world makes every round of improvement safe. Coding agents have shown that this loop already succeeds in software engineering, where the terminal serves as the world [76, 83]. Now that foundation models have reached this capability, a simulator can serve the same role for a robot.

We build RoboScript, a modular infrastructure for agent-centric robot manipulation. Fig. 1b illustrates the analogy and Fig. 1c reports the main results. In this paper, we implement WICL on RoboScript with a lifecycle that the agent carries out entirely without gradient updates. The foundation model first builds skills for a new environment on shared entry points. It then learns each task from a single demonstration and from rehearsal on training scenes, and freezes what it learns as a Task Memory. At deployment, it acts with the

Figure

Figure 2 Infrastructure of RoboScript. Every component runs as an independent service, and any method, benchmark, embodiment, or extension plugs in as a replaceable module. All model calls pass through one gateway. The agent plane reaches the world only through the deployable interface (D), and only the control plane accesses privileged data (P).

frozen memory on new scenes, anticipating how the task should unfold and recovering from failures. After evaluation, a reflection agent reviews the records and writes guidance for the next round, realizing RSI over several iterations. Data isolation is enforced by construction. Every acting agent, whether in rehearsal or in deployment, observes only camera images with depth and proprioception, the same inputs available on a real robot. Privileged simulator information serves only as supervision during learning, and a memory linter rejects coordinates, ground-truth terms, and seed identifiers. This strict separation ensures that what is learned in simulation is directly deployable on a physical robot. As shown in Fig. 2, the method, environment, embodiment, and foundation model are modular like Lego blocks. Each runs as an independent service and can be replaced, making RoboScript a reusable platform for agentic manipulation.

We conduct extensive experiments and present the main results on all 50 tasks of RoboTwin 2.0, leading to five findings. 1) One demonstration with rehearsal is sufficient. With one clean demonstration per task, RoboScript reaches 83.4% mean success across the clean and randomized settings without gradient updates, whereas the strongest trained action policy, trained with 50 demonstrations, reaches 61.7%. 2) What is learned in context generalizes across distributions. Rehearsing only on clean scenes, RoboScript maintains comparable success under domain randomization, whereas trained action policies retain at most 65.1% of their clean success. 3) Reflection improves the frozen memory. Each round of reflection rescues more episodes than it breaks on difficult tasks. 4) The framework improves with the foundation model. Without any change to code, prompts, or protocol, GPT-6.1-Sol reaches 83.6/83.2% on clean/randomized scenes, GPT-5.6-Luna reaches 79.8/76.0%, and even DeepSeek-V4.1-Flash, a lightweight model, reaches 77.8/78.4%, surpassing the strongest trained action policy. 5) Task Memories transfer across embodiments. With a lightweight adapter that rewrites an existing memory for a new robot, RoboScript deploys on a physical dual-arm robot without retraining or re-rehearsing. These findings jointly show that with a world in the loop, a robot can learn a manipulation task in its context as well as it learns one in its weights.

Our contributions are as follows.

  • We formulate WICL, a learning paradigm that extends in-context learning with feedback from a world. WICL decouples task skill from network weights and opens a path toward recursive self-improvement without retraining. We explain why the resulting knowledge transfers across worlds.
  • We build a modular infrastructure for agent-centric manipulation with strict data isolation that ensures deployability on real hardware. We implement WICL on RoboScript with a lifecycle covering skill building, task learning, deployment, and recursive self-improvement, all without gradient updates.
  • We conduct extensive experiments with one demonstration per task and report results on RoboTwin 2.0, across distributions, over multiple rounds of self-improvement, with three foundation models, and on a physical dual-arm robot via cross-embodiment memory transfer, achieving state-of-the-art performance.

References (100)

Couldn't load all references. Reload the page to try again.