{"paper":{"title":"Code as Policies: Language Model Programs for Embodied Control","license":"http://arxiv.org/licenses/nonexclusive-distrib/1.0/","headline":"Language models write executable robot policies by composing code from a few example commands.","cross_cats":[],"primary_cat":"cs.RO","authors_text":"Andy Zeng, Brian Ichter, Fei Xia, Jacky Liang, Karol Hausman, Peng Xu, Pete Florence, Wenlong Huang","submitted_at":"2022-09-16T07:17:23Z","abstract_excerpt":"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 i"},"claims":{"count":4,"items":[{"kind":"strongest_claim","text":"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.","source":"verdict.strongest_claim","status":"machine_extracted","claim_id":"C1","attestation":"unclaimed"},{"kind":"weakest_assumption","text":"That the LLM-generated code will execute correctly and safely on physical robots for novel commands without runtime errors or the need for additional verification layers.","source":"verdict.weakest_assumption","status":"machine_extracted","claim_id":"C2","attestation":"unclaimed"},{"kind":"one_line_summary","text":"Language models generate robot policy code from natural language commands via few-shot prompting, enabling spatial-geometric reasoning, generalization, and precise control on real robots.","source":"verdict.one_line_summary","status":"machine_extracted","claim_id":"C3","attestation":"unclaimed"},{"kind":"headline","text":"Language models write executable robot policies by composing code from a few example commands.","source":"verdict.pith_extraction.headline","status":"machine_extracted","claim_id":"C4","attestation":"unclaimed"}],"snapshot_sha256":"470d07b5c414fcdc910d20fc21ada31822fe767ea0215669bcfa733256168e85"},"source":{"id":"2209.07753","kind":"arxiv","version":4},"verdict":{"id":"3e578c85-85a9-4284-a948-e7a23e50242f","model_set":{"reader":"grok-4.3"},"created_at":"2026-05-15T00:34:09.000934Z","strongest_claim":"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.","one_line_summary":"Language models generate robot policy code from natural language commands via few-shot prompting, enabling spatial-geometric reasoning, generalization, and precise control on real robots.","pipeline_version":"pith-pipeline@v0.9.0","weakest_assumption":"That the LLM-generated code will execute correctly and safely on physical robots for novel commands without runtime errors or the need for additional verification layers.","pith_extraction_headline":"Language models write executable robot policies by composing code from a few example commands."},"references":{"count":145,"sample":[{"doi":"","year":2021,"title":"Evaluating Large Language Models Trained on Code","work_id":"042493e9-b26f-4b4e-bbde-382072ca9b08","ref_index":1,"cited_arxiv_id":"2107.03374","is_internal_anchor":true},{"doi":"","year":2021,"title":"Mdetr-modulated detection for end-to-end multi-modal understanding,","work_id":"6721969f-722b-4bba-99aa-53b14bc21994","ref_index":2,"cited_arxiv_id":"","is_internal_anchor":false},{"doi":"","year":2021,"title":"Open-vocabulary Object Detection via Vision and Language Knowledge Distillation","work_id":"59541f32-18cf-4328-ad60-c9018e1401cf","ref_index":3,"cited_arxiv_id":"2104.13921","is_internal_anchor":true},{"doi":"","year":2020,"title":"Robots that use language,","work_id":"e9899a79-9a17-47bd-9003-ecd3eb28d940","ref_index":4,"cited_arxiv_id":"","is_internal_anchor":false},{"doi":"","year":1971,"title":"Procedures as a representation for data in a computer program for understanding natural language,","work_id":"b0f61573-32b7-4404-b123-c6b18536f5cb","ref_index":5,"cited_arxiv_id":"","is_internal_anchor":false}],"resolved_work":145,"snapshot_sha256":"80eecb5f69ff894e7f40e112ede521abe3f348cc1bd105dccc5a18daf56cc162","internal_anchors":17},"formal_canon":{"evidence_count":2,"snapshot_sha256":"f403e391445d27071458bb4975fecbb024d680e10c47424b57e36b40760463cb"},"author_claims":{"count":0,"strong_count":0,"snapshot_sha256":"258153158e38e3291e3d48162225fcdb2d5a3ed65a07baac614ab91432fd4f57"},"builder_version":"pith-number-builder-2026-05-17-v1"}