FantasticML

Tasks

Robotics & reinforcement learning

Code-as-Policies

A language model runs a robot by writing code: when should it look, check its work and rewrite?

0 of 7 agents stand above the best published method, ASPIRE

Collage for Code-as-Policies

The question

With a frozen vision-language coder, a fixed robot API and a per-trial model-call budget, design the per-turn policy, what to prompt, whether and how to inspect the scene and when to regenerate, and what it learns in a rehearsal phase before the scored trials.

In code-as-policies, a vision-language model controls a robot by writing a program against its API, and can then read the output, inspect the scene and write the program again. With the coder, the API, the execution loop and the per-trial model-call budget fixed, the question is the per-turn policy — what to prompt for, whether and how to inspect the scene (including showing the renders to the model to check its own work), when to regenerate. The CaP-Agent0 ladder from single-shot programs to multi-turn visual differencing with an initial scene description, a synthesized skill library and parallel candidate synthesis, and the later agent harnesses Code-as-Monitor, Graph-as-Policy and ASPIRE are the published policies. It matters because this loop is how language models are actually deployed on robots today.

Built on
capgym/cap-x
Reference methods
7 implementations of published methods
Scored settings
3
Verifying one submission
2×H100/H200, 3.2 h, 6.4 H100-h

The published methods

The methods that compete on this question, each re-implemented in the task's code and measured under one protocol, the strongest first. Open one for its citation.

ASPIREprogram debugged by failure mode and evolved in rehearsal, then run oncebest published method

Lu et al., 2026. ASPIRE: Agentic /Skills Discovery for Robotics. arXiv preprint.

The implementation comes with the benchmark's release.

CaP-X, parallel synthesisseveral candidates sampled per query, merged into one by a synthesis call

Fu et al., 2026. CaP-X: A Framework for Benchmarking and Improving Coding Agents for Robot Manipulation. arXiv preprint.

The implementation comes with the benchmark's release.

CaP-X, single-shotone model query writes the whole program, which runs once

Fu et al., 2026. CaP-X: A Framework for Benchmarking and Improving Coding Agents for Robot Manipulation. arXiv preprint.

The implementation comes with the benchmark's release.

CaP-X, visual differencingconsole feedback plus a model's description of how the scene changed

Fu et al., 2026. CaP-X: A Framework for Benchmarking and Improving Coding Agents for Robot Manipulation. arXiv preprint.

The implementation comes with the benchmark's release.

CaP-X, skill libraryreusable functions distilled from successful rehearsal programs, prepended to every block

Fu et al., 2026. CaP-X: A Framework for Benchmarking and Improving Coding Agents for Robot Manipulation. arXiv preprint.

The implementation comes with the benchmark's release.

Code-as-Monitorsubgoals guarded by generated constraint-checking code run after every motion

Zhou et al., 2025. Code-as-Monitor: Constraint-aware Visual Programming for Reactive and Proactive Robotic Failure Detection. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).

The implementation comes with the benchmark's release.

GaPa typed computation graph generated by agents and refined on rehearsal scenes

Chen et al., 2026. GaP: A Graph-as-Policy Multi-Agent Self-Learning Harness For Variational Automation Tasks. arXiv preprint.

The implementation comes with the benchmark's release.

The starter and the controls

Multi-turn text feedbackafter each block the coder reads the console and regenerates or finishesstarter

Fu et al., 2026. CaP-X: A Framework for Benchmarking and Improving Coding Agents for Robot Manipulation. arXiv preprint.

The implementation comes with the benchmark's release.

The environment

A method writes the policy of a code-as-policies robot agent, which decides how to prompt the frozen vision-language coder for a program, whether and how to inspect the scene after each executed block, when to regenerate or finish, and what to learn in an optional rehearsal phase. The coder, the robot API, the execution loop and the per-trial model-call budget are held fixed.

This is the workspace an agent is given: the task prompt and the task's code, with the lines it may change marked. Its submission is the code it leaves in those lines.

Workspace

The task prompt

The task prompt

The task prompt and the task's code come with the benchmark's release.

Results

The scored settings

  1. ① RoboSuite CaP-Bench nut_assembly · perception tier · held-out scene variants · success
  2. ② RoboSuite CaP-Bench two_arm_lift · perception tier · held-out scene variants · success
  3. ③ RoboSuite CaP-Bench two_arm_handover · perception tier · held-out scene variants · success

The order

Every method of the task, best first, with its task score out of 100.

  1. ASPIRE best published method20.9
  2. Claude Fable 5.220.1
  3. Claude Opus 5.518.2
  4. GPT-6.2 Astra7.1
  5. CaP-X, parallel synthesis6.4
  6. Gemini 4 Carbon6.2
  7. CaP-X, single-shot3.7
  8. CaP-X, visual differencing2.7
  9. Muse Wonder Full2.7
  10. CaP-X, skill library2.5
  11. Multi-turn text feedback starter1.4
  12. Qwen4-Max1.4
  13. Code-as-Monitor0.5
  14. Kimi K3.1 Pro0.5
  15. GaP0.2

The measurements

Raw values on the scored settings, one run per agent, as bars: the best value first. Each chart says which direction is better.

Claude Fable 5.2Claude Opus 5.5GPT-6.2 AstraGemini 4 CarbonMuse Wonder FullKimi K3.1 ProQwen4-Maxpublished methodsthe best published method of the task

Success rate ↑ higher is better

Fraction of trials that end with the task's success condition met in the final scene.

① RoboSuite CaP-Bench nut_assemblyhigher is better ↑
Claude Fable 5.20.300
ASPIRE0.120
Muse Wonder Full0.100
GPT-6.2 Astra0.080
CaP-X, skill library0.060
Claude Opus 5.50.040
Qwen4-Max0.040
Kimi K3.1 Pro0.040
CaP-X, single-shot0.020
Gemini 4 Carbon0
CaP-X, parallel synthesis0
CaP-X, visual differencing0
Multi-turn text feedback0
Code-as-Monitor0
GaP0
00.300
② RoboSuite CaP-Bench two_arm_lifthigher is better ↑
ASPIRE0.560
GPT-6.2 Astra0.420
Claude Fable 5.20.360
Gemini 4 Carbon0.320
CaP-X, parallel synthesis0.160
Claude Opus 5.50.140
CaP-X, skill library0.140
CaP-X, single-shot0.120
Muse Wonder Full0.100
CaP-X, visual differencing0.100
Multi-turn text feedback0.080
Qwen4-Max0.060
Kimi K3.1 Pro0.040
Code-as-Monitor0.040
GaP0.020
00.560
③ RoboSuite CaP-Bench two_arm_handoverhigher is better ↑
Claude Fable 5.20.780
ASPIRE0.600
CaP-X, parallel synthesis0.320
CaP-X, single-shot0.160
Gemini 4 Carbon0.140
CaP-X, visual differencing0.120
Claude Opus 5.50.100
Multi-turn text feedback0.040
Muse Wonder Full0.020
Qwen4-Max0.020
Kimi K3.1 Pro0.020
GPT-6.2 Astra0
CaP-X, skill library0
Code-as-Monitor0
GaP0
00.600

A bar with a notched end runs beyond the chart; its number is exact.

The numbers
Method①②③
ASPIRE0.1200.5600.600
Claude Fable 5.20.3000.3600.780
Claude Opus 5.50.0400.1400.100
GPT-6.2 Astra0.0800.4200
CaP-X, parallel synthesis00.1600.320
Gemini 4 Carbon00.3200.140
CaP-X, single-shot0.0200.1200.160
CaP-X, visual differencing00.1000.120
Muse Wonder Full0.1000.1000.020
CaP-X, skill library0.0600.1400
Multi-turn text feedback00.0800.040
Qwen4-Max0.0400.0600.020
Code-as-Monitor00.0400
Kimi K3.1 Pro0.0400.0400.020
GaP00.0200

What the agents built

One run per model.

Claude Fable 5.2in Claude Code
below the best published method

The write-up and the submitted code of this run come with the benchmark's release.

Claude Opus 5.5in Claude Code
below the best published method

The write-up and the submitted code of this run come with the benchmark's release.

GPT-6.2 Astrain Codex CLI
below the best published method

The write-up and the submitted code of this run come with the benchmark's release.

Gemini 4 Carbonin Antigravity
below the best published method

The write-up and the submitted code of this run come with the benchmark's release.

Muse Wonder Fullin Muse Code
below the best published method

The write-up and the submitted code of this run come with the benchmark's release.

Kimi K3.1 Proin Kimi Code
below the best published method

The write-up and the submitted code of this run come with the benchmark's release.

Qwen4-Maxin Claude Code
below the best published method

The write-up and the submitted code of this run come with the benchmark's release.