← Back
cheng-haha

cheng-haha/GPT-Policy

In-Context Robot Learning with VLM Agents

View on GitHub ↗https://cheng-haha.github.io/GPT-Policy/ ↗
Stars
291
Forks
5
Watchers
291
Open issues
0
Contributors
5
Language
Python
License
Other
Default branch
main
Created Sep 10, 2026Updated Sep 24, 2026

Star growth

Today—
This week—
This month—

Star history will appear here once this repo has been tracked for a couple of days.

README

GPT-Policy wordmark
GPT-Policy overview

GPT-Policy: In-Context Robot Learning with VLM Agents

This repository is the public implementation of GPT-Policy, a closed-loop control framework that connects a fixed vision-language model (VLM) to robot tools. At deployment time, the agent can use demonstrations, goal images, interaction history, and execution feedback without gradient updates or task-specific parameter changes.

The implementation currently provides hardware adapters for two robot arm platforms: ARX X5 and I2RT/YAM.

Paper project ArXiv Paper PDF X

Paper: In-Context Robot Learning with VLM Agents
Authors: Dongzhou Cheng, Taoran Yi, Ye Fang, Xingwu Zhang, Fan Feng, Yixuan Li, Gengxiong Zhuang, Rongze Wang, Shuai Yang, Wei Song, Weizhi Xue, Minyan Wu, Jie Gui, Jiaqi Wang, and Tong Wu.

Abstract

Enabling robots to adapt to unfamiliar environments as readily as humans remains a moonshot goal of embodied AI. No finite collection of demonstrations can cover every task and situation a robot will encounter, making the ability to learn from context at deployment essential for generalization. Such in-context learning (ICL), however, remains largely beyond the reach of existing robotic policies. The broad agentic capabilities of commercial vision-language models (VLMs), such as GPT-6 Astra, raise a compelling question: can these models learn from demonstrations, examples, and interaction feedback, then translate that information into executable and verifiable robot behavior from a new initial state without gradient updates or persistent changes to task-specific parameters? We introduce GPT-Policy, a general-agent framework for in-context robot learning. GPT-Policy integrates a context compiler that preserves task-relevant visual transitions, a VLM that proposes robot-tool actions, and a constrained controller that verifies and executes each action and reports its outcome. We evaluate its reliability and limitations through task success and efficiency metrics, matched comparisons across models, and controlled context ablations. In real-robot trials, human video demonstrations improve task completion even without robot action labels, while aligned action references yield further gains on contact-sensitive tasks. These findings position GPT-Policy as a step toward robot adaptation through in-context learning, providing an empirical foundation for translating the general-purpose capabilities of VLMs into physical behavior and clarifying the challenges that must be overcome for reliable deployment.

News

  • 🚀 [2026/09/16] The paper, project page, and code are now publicly available!
  • 🎥 [2026/09/11] The first robot cases and demonstrations are added to the project page!

Demos

Four synchronized views of three GPT-6 Astra robot runs. Click any preview to open its MP4.

Plug insertion from top camera Plug insertion from right wrist camera
Plug insertion · top view      Plug insertion · right wrist view

Robot retrieving Sprite bottle Robot unscrewing a bottle cap
Sprite retrieval · search and place the bottle      Bottle opening · unscrew and separate the cap

The full experiment gallery includes the other tasks and context comparisons.

Method overview

GPT-Policy closed-loop architecture

GPT-Policy builds one model input from the task, live camera/state observations, task references, and the previous tool result. The VLM emits one structured request; the selected adapter validates and executes it, then returns fresh observations and feedback for the next decision. Adapters support Cartesian targets and waypoint sequences, sequential IK checks, backend-specific timing, gripper control, and append-only run recording.

The available context types are:

  • Human Video: a visual procedure that can transfer across embodiments.
  • Robot Video / Video + Action: robot interactions, arm roles, and aligned motion references.
  • Target Image: the desired object arrangement, position, and spacing.
  • Self History: earlier observations, actions, results, and discovered subgoals.
  • Human-Robot Interaction: live intent, pointing, corrections, and turn-taking.

Installation

Python 3.10 or newer is required.

python -m venv .venv
source .venv/bin/activate
python -m pip install -e .

The base install is hardware-free. Install only the backend you need:

source .venv/bin/activate
python scripts/install_drivers.py arx
python scripts/install_drivers.py yam
python scripts/install_drivers.py realsense
# or: python -m pip install -e '.[arx,realsense]'

Agent CLIs are external dependencies. Install and authenticate the provider you select; credentials are stored outside this repository.

Quick start

For the default ARX profile, edit the placeholders in configs/default.json once, then run a task directly:

source .venv/bin/activate
gpt-policy "pick up the red block"

The command resolves configs/default.json automatically. To validate the profile without opening hardware or a model session:

gpt-policy --check

For another machine or provider, pass an explicit profile:

cp configs/examples/yam-local.json configs/my-machine.json
# edit interfaces, camera serials, and measured calibration
gpt-policy --config configs/my-machine.json "pick up the red block"

An input package can contain text, images, videos, or reviewed demonstrations:

gpt-policy --input-json task.json

Each motion is planned from fresh feedback, checked with per-sample IK, and recorded as an append-only run directory. Ctrl+C requests software cancellation and cleanup; it does not replace a hardware emergency stop.

Results from the paper

🎯 Target Image / Self History / Human–Robot Interaction: 100% success on each of the six tasks evaluated under these conditions.

👀 Human Video: Success rate improves from 0% to 67% on both towel and notebook pickup.

🤖 Robot Video + Action: Success rate improves from 0% to 100% on bottle opening and from 0% to 67% on plug reinsertion.

Repository layout

src/gpt_policy/       protocol, input preparation, planning, recording, adapters
configs/default.json  default sanitized ARX profile for `gpt-policy "..."`
configs/agents/       provider examples
configs/examples/     local-machine templates
scripts/              opt-in driver installation
tests/                offline protocol and configuration tests
docs/assets/          figures used in this README

The public tree excludes deployment hosts, private prompts, real credentials, run recordings, site-specific calibration, and evaluation history. The paper's physical demonstration records and complete evaluation environment are not included by implication.

Development

python -m pytest -q
python -m compileall -q src

TODO

  • Release the GPT-Policy pipeline for real-world ARX robots, including the complete harness and format adapters for different context types.
  • Release the YAM pipeline with hardware integration and flexible context support.
  • Release the RoboDojo simulation pipeline for reproducible evaluation.
  • Optimize the agent harness for context construction, feedback, and execution efficiency.

Limitations and safety

This is a research control loop. The integrator must verify calibration, workspace limits, collision behavior, camera placement, provider configuration, and emergency-stop procedures before energizing a robot. IK acceptance and a model completion message do not establish collision-free motion or physical task success. The project license is intentionally pending; redistribution and commercial use are not granted by this preview.

See THIRD_PARTY.md for third-party notices and optional SDK sources.

Citation

@article{cheng2026incontextrobotlearningvlm,
  title={In-Context Robot Learning with VLM Agents},
  author={Dongzhou Cheng and Taoran Yi and Ye Fang and Xingwu Zhang and Fan Feng and Yixuan Li and Gengxiong Zhuang and Rongze Wang and Shuai Yang and Wei Song and Weizhi Xue and Minyan Wu and Jie Gui and Jiaqi Wang and Tong Wu},
  journal={arxiv:2609.19138},
  year={2026}
}

Acknowledgements

GPT-Policy integrates optional ARX, I2RT/YAM, RealSense, and provider CLI interfaces, with reference to RoboCurve's inspect-robots project. Please see THIRD_PARTY.md before redistributing a deployment that includes external SDKs.