Abstract
Zero-shot generalization across various robots, tasks, and environments remains a significant challenge in robotic manipulation. Policy code generation methods use executable code to connect high-level task descriptions and low-level action sequences, leveraging the generalization capabilities of large language models (LLMs) and atomic skill libraries. We propose Robotic Programmer (RoboPro), a robotic foundation model capable of perceiving visual information and following free-form instructions to perform manipulation via policy code in a zero-shot manner. To address the inefficiency of collecting runtime code data, we introduce Video2Code, a pipeline that synthesizes executable code from extensive in-the-wild videos. RoboPro achieves state-of-the-art zero-shot performance, surpassing GPT-4o on RLBench by 11.6% and demonstrating robustness to API variations.
Introduction
Generalizing a robot's behavior to novel tasks and environments without task-specific fine-tuning is a primary goal in robotics. Current methods typically follow two paths: Vision-Language-Action (VLA) models, which map images to motor commands but require massive robot-specific data, and "Code-as-Policies," which use LLMs to generate high-level code but often lack visual grounding or scale poorly due to manual annotation needs. RoboPro addresses these bottlenecks by enabling a model to learn from human demonstration videos, bridging the gap between semantic reasoning and physical execution.
Methodology
The Video2Code Pipeline
To overcome the high cost of human annotation, we developed the Video2Code pipeline to curate high-quality training data automatically. First, a "Draft VLM" (Gemini-1.5-Flash) extracts step-by-step natural language plans from "in-the-wild" videos (e.g., the DROID dataset). Subsequently, a "Code LLM" (DeepSeek-Coder-V2) translates these plans into executable Python code. This code utilizes a predefined API library comprising perception modules (for object detection) and control modules (for motion planning).
RoboPro Model Architecture
RoboPro is an end-to-end vision-language-code model. It employs a SigLIP-L vision encoder to process RGB-D environmental observations, which are then projected into the LLM's embedding space via a lightweight two-layer MLP adapter. The base LLM is CodeQwen-1.5-7B, optimized for code generation. Training involves three stages: visual alignment, pre-training on image-text pairs, and supervised fine-tuning (SFT) on 115,000 synthesized code-instruction pairs.
Key Insights and Ideas
Code as an Intermediate Representation
Code provides a structured framework that is easier for LLMs to reason about than raw motor tokens. It naturally supports long-horizon tasks by decomposing them into logical sub-routines.
Visual Reasoning and API Robustness
RoboPro demonstrates strong emergent visual reasoning. For instance, when instructed to "wipe the desk," it correctly identifies a sponge as the appropriate tool from a cluttered scene. Furthermore, the model is robust to changes in its environment and API; it can adapt to renamed or refactored functions because it understands the functional intent behind the code rather than just memorizing syntax.
Experimental Results
RoboPro demonstrates superior zero-shot generalization across both simulation and real-world benchmarks.
- RLBench: RoboPro achieved a 42.7% success rate, significantly outperforming GPT-4o (31.1%) and the CaP baseline (23.6%). This performance is comparable to supervised models like PerAct (43.6%).
- LIBERO: The model achieved a 52.4% success rate, surpassing GPT-4o's 35.0%.
- Real-World: Across 8 diverse tasks, RoboPro maintained a 72.5% average success rate.
Ablation studies highlight the importance of the synthesized data: without the Video2Code dataset, RLBench performance dropped from 42.7% to a mere 0.4%.
Conclusion
RoboPro represents a significant step toward general-purpose robotic foundation models. By leveraging synthesized code from human videos, it bridges the gap between high-level reasoning and low-level execution. Future work will focus on reducing inference latency and expanding the framework to navigation and multi-robot coordination.
Summary updated