One way to get a language model to control a robot on a task it has never seen is to retrieve demonstrations of related tasks and paste them into the prompt as worked examples. Each demonstration is written out as text: object positions, gripper poses and keyframe actions. This forces a choice about detail. Write the demonstrations sparsely, and the model loses the geometry it needs, because text is a lossy stand-in for 3D space. Write them densely, or include many of them, and the model gets distracted by irrelevant numbers and irrelevant examples, because language models are known to reason worse when their context is padded with noise. Current systems fix this choice by hand, once for every task.
We propose to make the choice learnable and task-specific. Before the language model plans any actions, it copies out, verbatim, only those fields and segments of the retrieved demonstrations that bear on the current scene. It is trained with reinforcement learning, where the reward is simulated task success minus a cost per extracted token. The claim is that the right amount of detail varies from task to task and from demonstration to demonstration. If so, a model rewarded by actual robot outcomes will beat any fixed prompt format and any text-only denoising method, and the advantage should grow as the retrieved context gets noisier.
Core Claim and Positioning
The starting point is Exploring the Limits of Vision-Language-Action Manipulation in Cross-task Generalization. That paper introduced the AGNOSTOS benchmark on RLBench and proposed X-ICM, which retrieves demonstrations from seen tasks by dynamics similarity. A diffusion model predicts the final observation of the new task, and demonstrations whose outcomes resemble that prediction are pasted into a language model's prompt. The model then predicts actions without any parameter updates. The same paper identifies two limitations. Textualizing 3D coordinates is lossy and brittle, and the open-loop, untrained planner accumulates errors. It does not study what happens when the retrieved demonstrations themselves contain irrelevant material. That paper therefore motivates the proposal and supplies the retrieval step, which we reuse unchanged.
The text-only noise literature supplies the method template. Aligning Extraction and Generation for Robust Retrieval-Augmented Generation (Ext2Gen) trains a language model to first copy the relevant sentences out of a noisy set of retrieved passages and then answer from them. It uses preference optimization over static question-answer pairs and shows that this in-generation extraction beats separate pre-generation compressors (Recomp, CompAct, EXIT), which throw away premises the answer needed. We carry the extract-then-act structure into embodied control, and we change the training signal in two ways. The relevance labels come from whether the robot succeeded, not from answer similarity. The learning is online, because in manipulation "relevant" is defined by physics that no text-similarity score captures.
Three further papers constrain the design. Retrieval-Augmented Reinforcement Learning found that letting the agent's own state query memory directly did no better than having no retrieval at all. What helped was a separate retrieval process with an information bottleneck on what was read. Our token cost plays the role of that bottleneck. Unlike their learned vector summaries, however, our bottleneck operates on human-readable text that a language model reasons over. MARC uses reinforcement learning to compress retrieved video clips. It keeps accuracy under 95% token reduction on short videos but retains only 74% of baseline performance on long ones, because rigid top-k retrieval breaks the reasoning chain. That warning shapes our design: extraction operates within the retrieved set and is conditioned on the current observation, rather than dropping whole units by a fixed rule. Demonstration Selection for In-Context Learning via Reinforcement Learning (RDES) uses reinforcement learning to choose which examples to include in text classification. We choose what inside each example to keep, and we test whether that finer grain matters. Finally, Words as Beacons reports that free-form language guidance is ambiguous and high-variance. This is one reason we require verbatim copying from the demonstrations rather than letting the model paraphrase them.
Research Program
The system has three parts. The first is X-ICM's dynamics-based retriever, which returns $K$ demonstrations. The second is a serializer that writes each demonstration at maximal detail: every object's pose, every keyframe action, the gripper state and scene metadata, each field tagged with an identifier. The third is a single language-model policy that emits two things in sequence. It first emits a set of copied field identifiers and spans, and then emits the action plan conditioned only on those copied spans plus the current scene description. The policy $\pi$ is trained to maximize
$$J(\pi) = \mathbb{E}\big[\,R_{\text{succ}} - \lambda\,|E|\,\big],$$
where $R_{\text{succ}} \in \{0,1\}$ is RLBench task completion, $|E|$ is the number of extracted tokens, and $\lambda$ sets the price of reading. Training uses group-relative policy optimization, the variant of policy gradient used by ViLASR in Reinforcing Spatial Reasoning in Vision-Language Models with Interwoven Thinking and Visual Drawing. It is run on the 18 seen AGNOSTOS tasks, with a short supervised warm start on extractions that a larger model proposes and that the simulator verifies as successful.
The analysis half of the program matters as much as the method. We will measure success as a function of two independent noise sources. The first is the number of injected irrelevant demonstrations, drawn from dissimilar seen tasks. The second is the number of injected irrelevant fields, meaning poses of distractor objects and unused metadata. We will also vary where the most relevant demonstration sits in the prompt, to check for the lost-in-the-middle effect that Ext2Gen documents for text. These curves test the premise directly: detail helps up to a point and then hurts, and the peak falls at different places for different tasks.
Baselines
The naive reference points are two fixed prompt formats run through the same backbone with no training. One is a sparse format with only target-object poses and keyframes. The other is the maximal-detail format our extractor reads from. Their gap on unseen tasks is the size of the fidelity–noise tension. If the two formats are indistinguishable, the tension is not real on this benchmark.
The strongest existing method is X-ICM. Exploring the Limits of Vision-Language-Action Manipulation in Cross-task Generalization reports 30.1% overall success on AGNOSTOS with a 72B backbone, broken down as 37.6% on Level-1 and 20.3% on Level-2. The same paper reports 17.5% for π0 and 15.6% for VoxPoser. Reinforcement learning at 72B is beyond our budget, and no reported result was found on Lacuna for X-ICM with a 7B backbone. We will therefore rerun X-ICM at the backbone size we train, using identical retrieval, the same $K$ and the same simulator seeds. We report the published 72B figure as an external ceiling. Beating X-ICM means a statistically significant gain in Level-2 success at matched backbone. It also means a flatter degradation slope as distractors are added. A Level-2 gain is what matters because Level-1 tasks can be solved by surface analogy.
The most important ablation keeps everything except extraction. The same backbone is trained with the same reinforcement learning budget, reading the full maximal-detail prompt. This isolates whether the explicit copy step does work that end-to-end reinforcement learning would otherwise have to learn implicitly. A second ablation extracts random spans matched in token count, to separate "reading less" from "reading the right things." A third ablation gets the same number of simulator rollouts, but uses them to label extractions offline and then trains with preference optimization, as Ext2Gen does. This separates online reward from the extract-then-act format. Finally, we compare against RDES-style selection of whole demonstrations, trained with the same rollout budget. Every trained method gets the same number of simulator episodes and the same hyperparameter search budget.
Why not just…?
Why not just grid-search the prompt format and number of demonstrations? This is the most serious threat. A tuned global setting is cheap and may capture most of the gain. We will run it and also give it an unfair advantage: a per-task oracle that picks the best fixed format for each unseen task using test outcomes. If our learned extractor does not beat the global tuned setting on Level-2 tasks, and does not come close to the per-task oracle, then the claim that needed detail varies within a task is false. In that case the right conclusion is "tune the format," and we will report it.
Why not just run reinforcement learning on the full prompt and let the model learn to ignore noise? Soft attention has no built-in way to switch a token off entirely. The text evidence (Improving Zero-shot Reader by Reducing Distractions from Irrelevant Documents in Open-Domain Question Answering; Ext2Gen) shows accuracy falling as more documents are added, even for capable models. Still, reinforcement learning on the full prompt may learn implicit filtering. This is exactly the matched ablation above. If the full-prompt ablation matches our method under heavy injected noise, the extraction step is unnecessary.
Why not just use an off-the-shelf compressor or Ext2Gen itself? These tools score relevance using text-answer signals. The demonstrations are retrieved by physical dynamics, and a pose field is relevant only if the robot needs it to succeed. Ext2Gen already shows that separate compressors discard needed premises in text (0.557 for Ext2Gen-R2 versus 0.473 for default Llama3.1-8B-Instruct, with compressors below Ext2Gen). We expect this failure to be worse for numeric geometry. We will test it by running Ext2Gen, trained on text, as a front end.
Why not just skip text and use an end-to-end vision-language-action model? π0 reaches 17.5% on AGNOSTOS and falls to near zero on Level-2 (Exploring the Limits of Vision-Language-Action Manipulation in Cross-task Generalization). Grounding objects from pixels is a separate bottleneck, as Read and Reap the Rewards found when unsupervised detection failed on Atari. Text-based in-context planning is currently the stronger route to unseen tasks, so making it robust is worth doing.
Decisive Experiments
All experiments use AGNOSTOS on RLBench with the published split of 18 seen and 23 unseen tasks. The primary metric is Level-2 success rate over at least 25 seeded episodes per task. Secondary metrics are Level-1 success, extracted tokens per episode, and the slope of success against injected-noise level.
Hidden Sensitivity in Spatial Reasoning Evaluation shows that headline spatial scores can reflect confounds such as data source and answer distribution. We therefore report per-task results and check whether gains concentrate in a few easy task families.
Three outcomes would support the proposal together. The fixed-format curves must peak at different detail levels across tasks. The learned extractor must beat both the per-task-tuned fixed format and the full-prompt reinforcement learning ablation on Level-2. And the gap must widen as irrelevant demonstrations and fields are injected. If the first outcome fails, the premise is wrong. If the second fails against grid search, the method is unnecessary. If only the third holds, the contribution narrows to robustness under noise, which is still useful but smaller.
Because RLBench rollouts are slow, compute is the practical risk. We will size the reinforcement learning budget so that all trained baselines receive identical episode counts, and report success against episodes for each.
References
- Exploring the Limits of Vision-Language-Action Manipulation in Cross-task Generalization
- Aligning Extraction and Generation for Robust Retrieval-Augmented Generation
- Retrieval-Augmented Reinforcement Learning
- MARC: Memory-Augmented RL Token Compression for Efficient Video Understanding
- Demonstration Selection for In-Context Learning via Reinforcement Learning
- Words as Beacons: Guiding RL Agents with High-Level Language Prompts
- Reinforcing Spatial Reasoning in Vision-Language Models with Interwoven Thinking and Visual Drawing
- Improving Zero-shot Reader by Reducing Distractions from Irrelevant Documents in Open-Domain Question Answering
- Read and Reap the Rewards: Learning to Play Atari with the Help of Instruction Manuals
- RLBench: The Robot Learning Benchmark & Learning Environment.
- Hidden Sensitivity in Spatial Reasoning Evaluation: Diagnosis and Re-ranking with VSI-Bench