Cited by 850Robot Manipulation and LearningAI-based Problem Solving and PlanningSoftware Engineering Research

Code as Policies: Language Model Programs for Embodied Control

Open access
Liang, Jacky, Huang, Wenlong, Xia, Fei, Xu, Peng, Hausman, Karol, Ichter, Brian, Florence, Pete, Zeng, Andy·2023·2023 IEEE International Conference on Robotics and Automation (ICRA)

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 reasoning, (ii) generalize to new instructions, and (iii) prescribe precise values (e.g., velocities) to ambiguous descriptions (‘faster’) depending on context (i.e., behavioral commonsense). This paper presents Code as Policies: a robot-centric formulation of language model generated programs (LMPs) that can represent reactive policies (e.g., impedance controllers), as well as waypoint-based policies (vision-based pick and place, trajectory-based control), demonstrated across multiple real robot platforms. Central to our approach is prompting hierarchical code-gen (recursively defining undefined functions), which can write more complex code and also improves state-of-the-art to solve 39.8% of problems on the HumanEval [1] benchmark. Code and videos are available at https://code-as-policies.github.io

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1109/icra48891.2023.10160591

Cites

60 of 60 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • LLM-generated robotic task plans are highly sensitive to prompt phrasing and vulnerable to adversarial manipulation.

    “LLM-generated robotic task plans are highly sensitive to prompt phrasing (Liang et al., 2023) and vulnerable to adversarial manipulation (Zhang et al., 2024c).”

    From Large Language Model Reasoning Failures (2026) · cites this paper as Liang et al., 2023

    Appendix A, “Prompt Engineering” (page unavailable), says reliable code generation requires careful prompting and that ambiguous or inconsistent examples can produce unreliable responses. This supports sensitivity to prompt design, but it does not establish that robotic task plans are highly sensitive to phrasing specifically. The adversarial-manipulation clause is cited to Zhang et al., not Liang et al., and is not part of this verdict. (LLM, conf=0.82)

    Experimental — accuracy not yet measured
  • Naive LLMs and VLMs generate plans step by step, lacking mechanisms to detect and correct earlier mistakes or execution errors.

    “Naive LLMs and VLMs generate plans step by step, lacking mechanisms to detect and correct earlier mistakes or execution errors (Liang et al., 2023; Huang et al., 2022b; Duan et al., 2024).”

    From Large Language Model Reasoning Failures (2026) · cites this paper as Liang et al., 2023

    The Introduction describes earlier LLM robot approaches as planning sequences of steps and says that abstraction makes it difficult for LLMs to influence the perception–action feedback loop. The related-work discussion also describes a system that uses success-detector or VLM feedback to re-plan. The paper therefore supports the limitation for basic sequence-planning approaches, but does not establish that naive LLMs and VLMs generally cannot detect and correct earlier mistakes or execution errors. (LLM, conf=0.83)

    Experimental — accuracy not yet measured
  • Incorporating feedback mechanisms or explicit error-handling strategies significantly reduces embodied errors.

    “Incorporating feedback mechanisms or explicit error-handling strategies significantly reduces these errors (Liang et al., 2023; Wang et al., 2023a).”

    From Large Language Model Reasoning Failures (2026) · cites this paper as Liang et al., 2023

    The Abstract describes feedback loops for robot control, and Appendix A (Prompt Engineering) says hints or examples can fix some code-generation mistakes. Neither passage establishes that feedback or error-handling strategies significantly reduce embodied errors; the appendix also says attempted code editing produced inconsistent results. No page numbers are available in our copy. (LLM, conf=0.82)

    Experimental — accuracy not yet measured
  • In personalization and embodied control, agents author and revise executable policies, simulators, and skill libraries in response to environment feedback.

    “In personalization and embodied control, agents author and revise executable policies, simulators, and skill libraries in response to environment feedback [9, 10, 32].”

    From Code as Agent Harness (2026) · cites this paper as [10]

    The paper describes LLMs writing executable robot policies and recursively defining functions that can accumulate into libraries (introductory Code as Policies passage; page unavailable). Its policies can react to perception feedback, but the paper does not describe agents authoring simulators or revising policies and libraries in response to environment feedback. Appendix A says code editing to fix errors was not used in the experiments. (LLM, conf=0.88)

    Experimental — accuracy not yet measured
  • Programs are increasingly used as the medium through which LLM agents reason, act, and model their environments.

    “Programs are increasingly used as the medium through which LLM agents reason, act, and model their environments.”

    From Code as Agent Harness (2026) · cites this paper as [10]

    The Abstract and III. METHOD describe LLM-generated programs that perform spatial reasoning, process perceptual inputs, and control robots. The paper does not establish that programs are increasingly used across LLM agents or that the programs model their environments, rather than use perception outputs. (LLM, conf=0.84)

    Experimental — accuracy not yet measured

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

Research works printed but not linked: 1

  1. D. Kalashnikov, A. Irpan, P. Pastor, J. Ibarz, A. Herzog, E. Jang, D. Quillen, E. Holly, M. Kalakrishnan, V. Vanhoucke et al., "Scalable deep reinforcement learning for vision-based robotic manipulation," in CoRL, 2018.

Cited by

Sorted by citations

Authors
Liang, J., Huang, W., Xia, F., Xu, P., Hausman, K., Ichter, B., Florence, P., & Zeng, A.
Venue
2023 IEEE International Conference on Robotics and Automation (ICRA)
Publisher
IEEE
Published
2023-05-29
Pages
9493-9500
ISSN
1050-4729 (ISSN-L)
OpenAlex
W4383097638
Cited by
767
References
59
Citations by year
2026: 231 · 2025: 286 · 2024: 201 · 2023: 48 · 2022: 1
FWCI
327.59
Type
conference paper
Language
en
Open access
Locations
  • Proceedings - IEEE International Conference on Robotics and Automation/Proceedings (publishedVersion)
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Engineering › Control and Systems Engineering › Robot Manipulation and Learning
  • Physical Sciences › Computer Science › Artificial Intelligence › AI-based Problem Solving and Planning
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
Keywords
large language models, code generation, robot policy, embodied control, natural language commands, few-shot prompting, trajectory-based control, impedance control

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review