Org: NVIDIA, UC Berkeley, Stanford, CMU · Date: Mar 2026 (v2 Jul 2026) · Paper: arXiv:2603.22435 · Code: capgym/cap-x (likely official) · Models: 12 evaluated. Agent0 uses Gemini-3-Pro, or an ensemble of GPT-5.2, Opus 4.5 and Gemini-3-Pro.

CaP-X tackles code-as-policy robot manipulation, in which an LLM writes Python against perception and IK primitives instead of emitting actions directly. The paper contributes three things at once: a benchmark (CaP-Gym and CaP-Bench), a training-free agent (CaP-Agent0) and an RL recipe (CaP-RL).

CaP-Gym provides Gymnasium environments in which each turn takes an observation, generates Python and executes it in a stateful REPL, covering robosuite, LIBERO-PRO and BEHAVIOR.

Because of this, it is as much a benchmark as an agent, and several later harnesses, including AMP1, ASPIRE, HarnessPAI and RAX, report results on its suites.

This figure plots CaP-Bench success against model release date, relative to human expert code.

This figure plots CaP-Bench success against model release date, relative to human expert code.

It measures success in two ways. CaP-Bench evaluates models zero-shot against human expert code across two sets of abstraction tiers: S1 to S4 range from privileged macros down to raw APIs, while M1 to M4 add multi-turn feedback that progresses from text to raw images and then to visual-differencing text.

Gemini-3-Pro writes very different code for "lift the red cube" when given high-level primitives than when given low-level primitives.

Gemini-3-Pro writes very different code for "lift the red cube" when given high-level primitives than when given low-level primitives.

The main finding is that higher abstraction helps, especially for weak models, and that raw images in context hurt performance whereas text descriptions help.

The agent itself is measured by task success. On a perturbed 30-task LIBERO-PRO subset, CaP-Agent0 reaches 18%, compared with 13% for π0.5 and 0% for OpenVLA.

On 7 robosuite tasks it matches or beats human expert code on 4 of 7, where the human average is 88.5%. On 2 BEHAVIOR tasks it reaches about 64%, with 56% and 72% on the two tasks, compared with 36% and 72% for human code.

With CaP-RL, a Qwen 7B coder rises from 20% to 72% success in simulation, and on a real Franka it reaches 84% on Lift and 76% on Stack, compared with 92% and 84% for human code.

The CaP-RL fine-tuned Qwen-2.5-Coder-7B is deployed on the real Franka task of putting the red cube on the green cube, with behaviour before and after reinforcement learning compared.

The CaP-RL fine-tuned Qwen-2.5-Coder-7B is deployed on the real Franka task of putting the red cube on the green cube, with behaviour before and after reinforcement learning compared.

The agent is zero-shot and uses no demos, but its skill library was mined from earlier successful rollouts on robosuite, and S1 and CaP-RL use privileged poses and masks.

It does this with a multi-turn REPL loop that generates code, executes it, returns feedback in the form of stdout/stderr plus visual-differencing text, and then decides whether to continue.

Each turn samples 9 candidates, either from one model or 3 from each of 3 models, and a coding agent merges them into a single program.

Perception relies on learned tools: SAM 3 for segmentation, Molmo 2 for pointing, Contact-GraspNet, Open3D and a query_vlm call. The Visual Differencing Module has a VLM describe the scene and its per-turn changes as text, so the coder never sees raw images.

CaP-Agent0 combines a skill library, a Visual Differencing Module and parallel ensembled reasoning.

CaP-Agent0 combines a skill library, a Visual Differencing Module and parallel ensembled reasoning.

For actions, the generated Python calls PyRoki IK, which is collision- and reachability-aware, plus gripper commands, while the higher tiers expose pick/place macros.

The skill library holds 9 task-agnostic functions that were regex-mined from successful rollouts across 12 models and verified with Gemini, plus Contact-GraspNet. Memory consists of REPL state within an episode and the skill library shared across tasks.

CaP-RL then applies GRPO to Qwen2.5-Coder-7B with environment rewards, and the resulting policy transfers from simulation to a real Franka.