Code as Policies: Language Model Programs for Embodied Control
Jacky Liang, Wenlong Huang, Fei Xia, Peng Xu, Karol Hausman, Brian, Ichter, Pete Florence, Andy Zeng

TL;DR
This paper demonstrates how large language models trained on code can generate robot control policies from natural language commands, enabling flexible, generalizable, and precise embodied robot control across multiple platforms.
Contribution
It introduces a novel approach of using language models to generate robot policies as code, incorporating hierarchical prompting for complex behaviors and achieving state-of-the-art results on benchmarks.
Findings
LLMs can synthesize robot control policies from natural language commands.
Hierarchical code prompting improves the complexity and accuracy of generated policies.
The approach generalizes to new instructions and multiple robot platforms.
Abstract
Large language models (LLMs) trained on code completion have been shown to be capable of synthesizing simple Python programs from docstrings [1]. We find that these code-writing LLMs can be re-purposed to write robot policy code, given natural language commands. Specifically, policy code can express functions or feedback loops that process perception outputs (e.g.,from object detectors [2], [3]) and parameterize control primitive APIs. When provided as input several example language commands (formatted as comments) followed by corresponding policy code (via few-shot prompting), LLMs can take in new commands and autonomously re-compose API calls to generate new policy code respectively. By chaining classic logic structures and referencing third-party libraries (e.g., NumPy, Shapely) to perform arithmetic, LLMs used in this way can write robot policies that (i) exhibit spatial-geometric…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsRobot Manipulation and Learning · Multimodal Machine Learning Applications · Reinforcement Learning in Robotics
