Code-as-policy methods enable robot manipulation without task-specific training, but they often achieve low zero-shot success and require extensive interaction to adapt to new tasks. We present CaAP, a framework that improves both zero-shot performance and few-trial adaptation efficiency. Within a trial, Self-Adaptive Process Monitoring lets the agent specify when and how to observe execution, while Heritable Handoff deliberately suspends the program when its assumptions no longer hold, preserving the scene and program state for subsequent recovery. Across trials, LoreCraft consolidates successes and failures into declarative lessons and reusable executable tools, enabling subsequent attempts to build on prior experience. On LIBERO-PRO, CaAP achieves 53.9% average zero-shot success, about three times that of the strongest code-based baseline, CaP-Agent0 (18.0%), and 10.3 percentage points above the strongest evaluated vision-language-action baseline. After 15 online adaptation trials per task, validation-based program selection raises the average success rate to 73.1%. This exceeds the 61.7% reported by ASPIRE with Opus 4.6 while using about one-sixth of its rollouts and one-tenth of its cost. Experiments on a real bimanual mobile manipulator further demonstrate the applicability of CaAP to physical robot manipulation.
1Method
A code-as-policy agent writes a program, runs it, and only regains control when the program finishes or fails. By then a wrong assumption may already have knocked an object over. CaAP changes what happens inside a trial and what carries over between trials.
Self-Adaptive Process Monitoring
The generated code opens capture windows around the motions it is unsure about and chooses how to sample them. A vision model reports what happened in those frames, so the next turn sees how the motion unfolded, not only where it ended.
Heritable Handoff
When a check in the code fails, the program suspends itself instead of continuing on a false premise. The scene and the program namespace are kept intact, and the next turn resumes from the measured state.
LoreCraft
After each trial, successes and failures are consolidated into Lore, declarative lessons, and Craft, executable tools that later programs can call. Later attempts start from what earlier ones learned.
2Results on LIBERO-PRO
Zero-shot success (%) on six LIBERO-PRO splits
| Method | Object-P | Object-T | Goal-P | Goal-T | Spatial-P | Spatial-T | Avg. |
|---|---|---|---|---|---|---|---|
| VLA models, trained on LIBERO demonstrations (selected) | |||||||
| π0.5 | 17.4 | 0.8 | 37.8 | 2.0 | 20.4 | 0.8 | 13.2 |
| ABot-M0 | 9.0 | 9.8 | 5.6 | 10.6 | 13.4 | 54.8 | 17.2 |
| PRTS | 36.0 | 8.8 | 19.0 | 33.8 | 26.8 | 62.2 | 31.1 |
| Cont. Reasoning | 54.5 | 27.0 | 36.0 | 33.0 | 51.0 | 60.0 | 43.6 |
| Code-based methods, no target-task rollouts before evaluation | |||||||
| Opus 4.6 | 23.6 | 17.0 | 26.6 | 5.0 | 8.6 | 8.5 | 14.9 |
| CaP-Agent0 | 21.8 | 18.2 | 25.6 | 16.8 | 11.8 | 14.0 | 18.0 |
| CaAP (final) | 59.2 | 53.2 | 54.0 | 17.2 | 51.6 | 62.2 | 49.6 |
| CaAP (ever) | 60.0 | 55.2 | 62.0 | 26.8 | 54.0 | 65.4 | 53.9 |
P and T denote position and task perturbations. CaAP uses DeepSeek-V4.1-Flash-1017; Opus 4.6 and CaP-Agent0 use Claude Opus 4.6 and an ensemble of Gemini-3-Pro, GPT-5.2 and Claude Opus 4.5. The full table with all VLA baselines is in the paper.
Online adaptation
Same-model comparisons
All methods in the bar charts use DeepSeek-V4.1-Flash-1017.
3Example rollouts
Zero-shot trials with empty memory: the program is written by the language model at test time, with no task-specific training or demonstrations.
4A trial, turn by turn
Goal-P task 8, put the bowl on the plate, zero-shot with empty memory. Every grasp attempt is wrapped in a capture window and followed by a check on the gripper width. When a check fails, the block hands off before lifting, the bowl is not disturbed, and the next turn changes only the grasp. The trial succeeds after 9 agent turns.
5Real robot
On a bimanual mobile manipulator, the task instruction is obtained from a human demonstration video: pour oil before adding seasoning. Online execution forms a program; after freezing, the same program completes the ordered task without further model calls, despite rearranged objects and additional distractors.
6BibTeX
@article{caap2026,
title = {CaAP: Code as Adaptive Policies for Cold-Start Robot Manipulation},
author = {Huang, Pianran and Liu, Ziyi and Luo, Zhaoxin and Tan, Qichen and
Xu, Jiajie and Huang, He and Zhang, Min and Li, Zhijun},
journal = {arXiv preprint},
year = {2026}
}
Harbin Institute of Technology
Soochow University