Research
RACaP: Agentic Reasoning, Acting, and Coding as Policies for Evolvable Robot Learning
Code-as-Policies systems generate Python robot programs when a task arrives, which is flexible but slow: the paper reports one coding iteration taking 6.8 to 23.8 seconds in CaP-X and a multi-turn…

- arXiv
- 2609.29394 · Preprint · not peer-reviewed
- Published
- 2026-09-24
- Authors
- Zexi Li, Yehang Zhang, Haojian Huang, Bohan Zhou, Wenqian Li, Chenxu Wang, Yifan Chang, Yangkai Wei, Tianyi Zhang, Ying-Cong Chen, Kaiwen Zhou, Yinchuan Li, James Cheng
In plain words
Code-as-Policies systems generate Python robot programs when a task arrives, which is flexible but slow: the paper reports one coding iteration taking 6.8 to 23.8 seconds in CaP-X and a multi-turn trial taking 60.8 to 113.6 seconds, all while the robot waits.
AI summary
Overview
Research area: Robot learning and embodied AI, specifically Code-as-Policies (CaP) systems that turn language instructions into executable robot programs, combined with LLM-based Reasoning-and-Acting (ReAct) agents.
Technical level: Advanced. The paper assumes familiarity with vision-language models, robot manipulation benchmarks (LIBERO family, Robosuite), curriculum learning, and fine-tuning methods such as rejection-sampled fine-tuning and LoRA.
Scope (one sentence): The paper proposes RACaP, a framework that moves robot code generation out of task execution and into an offline "evolution" stage, so that a frozen library of typed Policy APIs plus a lightweight ReAct agent can generalize, transfer zero-shot, and execute long-horizon tasks more efficiently than runtime code-generation baselines.
What This Paper Is About
Code-as-Policies systems generate Python robot programs when a task arrives, which is flexible but slow: the paper reports one coding iteration taking 6.8 to 23.8 seconds in CaP-X and a multi-turn trial taking 60.8 to 113.6 seconds, all while the robot waits. Generated programs also mix reusable physical mechanisms with task-specific constants (object names, coordinates, grasp heights), so they transfer poorly and must be rewritten for each new scene.
RACaP's goal is to resolve this "evolution-to-execution" problem by moving coding to an offline evolution stage — where reusable mechanisms are learned, tested, and frozen into typed Policy APIs — and leaving only fast, steerable function calls and adaptive decisions to a ReAct loop at runtime.
Key Contributions
-
Evolution-to-execution formulation. The authors explicitly separate reusable mechanisms learned through coding during evolution from scene-dependent decisions made through runtime function calls, making cross-task generalizability and runtime steerability explicit objectives of the learned interface (formalized in Equations 2 and 3, with a paired-gain objective for APIs and a lexicographic success-then-turns objective for the ReAct harness and memory).
-
Two-phase agentic evolution. A framework that first builds competence through capability curriculum learning (stages S0 to S6, covering Execution, Recovery, Breadth, and Orchestration) and then improves Policy APIs, the ReAct harness, and long-term experience memory through autonomous paired evolution, promoting a candidate only when its paired gains exceed its paired regressions.
-
A frozen, steerable runtime. A runtime consisting of six typed Policy APIs (
pickplace,insert,stack,push,articulate,actuate_control), a two-tier ReAct agent (Full ReAct for task decomposition and routing, Transport ReAct for local object transfer), and dual-structured memory (per-episode working memory plus read-only long-term experience memory). No Python code is generated, compiled, or repaired during evaluation. -
Transfer and efficient deployment. Validation on in-domain, zero-shot, long-horizon, and cross-embodiment settings, plus a compact ReAct student distilled from GPT-5.6 into Qwen3-VL-8B-Instruct via rejection-sampled fine-tuning for on-robot edge deployment.
Main Findings
-
In-domain growth is front-loaded. On LIBERO-90 (seed 0), an instrumented Phase 1 replay solves 42/90 tasks (46.7%), the evolution-time Phase 1 run reaches 48/90 (53.3%), and the archived Phase 2 artifact solves 49/90 (54.4%). Phase 2 adds only one task in-domain, but the paper argues this masks larger transfer and stability gains.
-
Zero-shot transfer improves substantially. On LIBERO-PRO (six perturbation suites, 10 tasks, 3 seeds, 180 paired episodes), Phase 2 solves 81/180 episodes (45.0%) versus 59/180 (32.8%) for Phase 1 and 15/180 (8.3%) to 32/180 (17.8%) for runtime-coding CaP baselines. The paper reports this as 2.5 times the success rate of CaP baselines.
-
Object perturbations benefit most. Phase 2 reaches 73.3% on object-position changes and 60.0% on object-task changes, which the authors interpret as evidence that Phase 2 improves generalizable object interfaces rather than memorizing layouts.
-
Paired statistical tests support the gains. Phase 2 succeeds on 33 episodes missed by Phase 1, while Phase 1 succeeds on only 11 missed by Phase 2 (exact McNemar test, p = 0.00126). Against RATS-base, p = 1.41 × 10⁻⁸.
-
Fewer calls and less wall time. Phase 2 averages a median policy time of 380 seconds and 15.9 API calls per episode on LIBERO-PRO, versus 454 seconds and 16.6 calls for Phase 1, 954 seconds and 45.2 calls for RATS-90, 845 seconds and 13.0 calls for CaP-X, and 726 seconds and 28.5 calls for RATS-base. Reported cost per episode is $0.24 for Phase 2 versus $1.25 for RATS-90. The paper reports a 1.9 times speedup in median policy time over CaP baselines.
-
Naive self-play can hurt. In a controlled study, play on LIBERO-90 reduces RATS success from 21.1% to 11.1% in-domain and from 17.8% to 8.3% on zero-shot LIBERO-PRO; audits trace failures to interface drift between saved helper functions and newly generated caller scripts (mismatched keys, data types, function arguments).
-
Long-horizon gains come from composition, not shorter traces. On LIBERO-Long (10 tasks, 5 seeds), Phase 2 solves 23/50 episodes (46.0%) and Phase 1 solves 16/50 (32.0%), while code-generation baselines solve only 2.0% to 4.0%. Gains concentrate in subtasks such as On (40.0% to 65.0%) and Turnon (20.0% to 50.0%); mean ReAct turns increase from 8.22 to 8.72, and Close remains at 0.0% (McNemar p = 0.118).
-
Phase 2 search is selective. Over 596 development episodes, the harness generated 32 proposals and tested 23 candidates in simulation, yielding nine promoted wins across task groups covering transport (T1 to T4), stacking, articulation, compact controls, routing, and efficiency.
-
One calibration trial reveals adaptation capacity. A single calibration rollout per task family improves Phase 1 by 8.3 percentage points and Phase 2 by 10.0 points on the 60 paired seed-1 subset, while code-generation baselines show mixed or negative responses.
-
Cross-embodiment transfer remains hard but the interface evolves. On Robosuite, frozen Phase 2 solves 6/35 episodes (17.1%) and CaP-X solves 9/35 (25.7%) without target-domain evolution. After domain evolution, RACaP-RS and RATS-RS both reach 11/35 (31.4%), but RACaP-RS needs 32.9 seconds and $0.089 per episode versus 90.7 seconds and $0.159 for RATS-RS. Both solve 1/10 held-out task types (10.0%).
-
Distillation preserves teacher decisions with lower latency. Rejection-sampled fine-tuning uses 54 accepted and 40 rejected decisions, raising exact agreement with accepted teacher decisions from 83.3% to 97.6% and executable action agreement from 61.9% to 76.2%, while reducing repeated physical calls from 16 to 4 across 60 paired held-out episodes. The compact model averages 0.750 seconds per call versus 9.895 seconds for the teacher proxy, a 13.2 times per-decision speedup.
Methodology in Plain English
The researchers split a robot agent's brain into three pieces that are all learned before deployment and then frozen: a library of typed functions ("Policy APIs") that handle the physical mechanics of grasping, inserting, stacking, pushing, and operating mechanisms; a reasoning loop ("ReAct") that decides which function to call with which arguments, in what order, and when to stop; and a memory of general lessons from past failures.
Learning happens in two phases. Phase 1 is a fixed curriculum across stages S0 to S6 that teaches basic competence first: on a 41-task transport cohort, adding retries, failure feedback, and visual correction raises success from 13/41 (31.7%) to 28/41 (68.3%); then, across all 90 tasks, adding six contact-mechanics APIs and harness improvements moves performance from 40/90 (44.4%) to 48/90 (53.3%). The curriculum is used because an agent starting from only basic primitives produces trajectories where perception, grasping, placement, routing, and stopping errors are tangled together, so the coding agent cannot attribute a failure to a specific mechanism.
Phase 2 removes the fixed order. The system clusters its remaining failures, picks a capability to target, has a coding agent propose one change, and validates the candidate against the frozen parent on the same tasks, seeds, and budgets — promoting it only if native success strictly improves, and archiving ties and regressions. Visual critics compare before-and-after frames against API calls, and proposals must state predicted gains, regression risks, and rejection conditions.
At deployment, the robot never writes or repairs code. It calls the frozen APIs with adjustable arguments, reads back status reports, measurements, and fresh RGB-D images, and uses those to change its action sequence, arguments, recovery strategy, or stopping decision. A parent "Full ReAct" scope handles overall instruction parsing and routing across all six APIs, while a child "Transport ReAct" scope handles single source-to-destination subgoals. For edge deployment, decision traces from a hosted GPT-5.6-sol teacher were distilled into a Qwen3-VL-8B-Instruct student using role-specific LoRA adapters with the base model and vision encoder frozen, keeping only teacher rollouts that achieved native success, satisfied schema constraints, and contained valid visual evidence.
Fairness controls: all methods used the same GPT-5.5 endpoint during evaluation (RACaP used GPT-5.6 during evolution, which the paper notes accounts for the Phase 1 difference between the evolution and evaluation figures), an 8000-step horizon, public observations, and native simulator predicates hidden from all policies. RATS-90 was re-run under a standardized setup with 15 development rounds under a shared 596-reset ceiling and at most 10 visual code repairs.
Why This Matters
The paper reframes a practical tension in LLM-driven robotics: runtime code generation is expressive but slow and brittle, while fixed neural policies are fast but hard to update. Showing that code can be evolved offline, frozen behind typed interfaces, and still remain steerable through function arguments gives the field a concrete alternative to both extremes, supported by controlled baselines and paired statistical tests rather than single-run comparisons.
Real-world applications:
- Household and service robots performing multi-step instructions such as clearing utensils onto a plate and closing a drawer, where object positions and layouts change between episodes and the robot must detect and recover from failed grasps.
- Warehouse and logistics manipulation involving pick-and-place, stacking, and insertion into shelves or caddies, where latency directly affects throughput and a per-episode cost of $0.24 versus $1.25 matters at scale.
- On-device deployment on cost-constrained hardware, where the distilled compact ReAct model's 0.750 seconds per call versus 9.895 seconds supports local execution without a hosted model dependency.
- Retail and kitchen automation requiring operation of stoves, knobs, buttons, switches, doors, and drawers, which the Policy API library covers through
articulateandactuate_control.
Industry relevance: the work targets two things enterprises care about — reliability under distribution shift, and inference economics. The reported 15.9 API calls, 380-second median policy time, and $0.24 per episode on LIBERO-PRO, plus the 13.2 times per-decision speedup from distillation, point to a deployable cost profile for LLM-driven manipulation rather than a research-only pipeline.
Future Directions
-
Restoring online skill invention. The stated limitation is that freezing source code restricts RACaP to generalizing within its Policy API closure rather than inventing new physical skills online. The authors propose keeping the fast frozen path for standard execution while routing novel failures to a sandboxed coding pipeline that can promote updated code.
-
Better cross-embodiment transfer. Frozen Phase 2 solved 6/35 Robosuite episodes (17.1%), below CaP-X's 9/35 (25.7%), and both RACaP-RS and RATS-RS reached only 1/10 held-out task types (10.0%). How much target-domain evolution is needed for a new robot body, and how to reduce it, remains open.
-
Closing the residual failure modes. Close stays at 0.0% on LIBERO-Long, no method completes all seven objects on the seven-object benchmark (Phase 2 median of 3.0 objects at 10 minutes), and Goal-Task perturbation remains at 13.3%. The paper does not report a mechanism that resolves these specific gaps.
-
Reducing stochasticity in promotion decisions. The LIBERO-Long improvement is not significant by the reported test (p = 0.118), and LIBERO-90 is evaluated on a single seed (seed 0) because of task count. Larger paired evaluations, more seeds, and stronger statistical power for capability-level claims are natural next steps.
Target Audience
Researchers working on LLM and VLM agents for robot manipulation, Code-as-Policies and program-synthesis approaches to control, and self-improving or self-evolving agent systems. It is also relevant to engineers building production robot stacks who need to weigh runtime code generation against frozen typed tool libraries in terms of success rate, latency, and per-episode cost, and to practitioners interested in distilling large hosted models into compact local vision-language models for on-robot inference. Readers without background in embodied benchmarks such as LIBERO or in ReAct-style agent loops will find the methodology accessible but the evaluation details demanding.
Authors’ abstract
General-purpose robot agents must learn from experience, transfer to new tasks, and act efficiently. Code as Policies (CaP) methods generate and repair programs at runtime, incurring latency and entangling reusable mechanisms with task-specific decisions. We introduce RACaP, an agentic framework that moves coding to evolution and uses a Reasoning-and-Acting (ReAct) loop to call frozen, typed Policy APIs at deployment. A two-phase strategy combines capability curriculum…
The full abstract on arXivRelated papers
- Robo-Harness K1: Harnessing Robot-Use Agents via Perception Augmentation 2026-09-24 · cs.RO · Also by Bohan Zhou, Chenxu Wang +10
- In-Context Learning for Robots: Methods and Applications 2026-09-28 · cs.RO · Also by Bohan Zhou, Chenxu Wang +10
- World Action Agent: Harnessing VLMs for Robot Manipulation via World Action Rehearsal 2026-09-24 · cs.RO · Also by Bohan Zhou, Chenxu Wang +9
- RoboAware: Learning to Coordinate Embodied Skills from Counterfactual Outcomes 2026-10-08 · cs.RO · Also by Bohan Zhou, Haojian Huang +7
- Are Frontier VLM Agents Ready to Be Robot Generalists? An Empirical Study with the Embodied Agent Arena 2026-10-01 · cs.RO · Also by Haojian Huang, Kaiwen Zhou +6