arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2209.07753cs.RO
收藏

代码即策略:用于具身控制的语言模型程序

Code as Policies: Language Model Programs for Embodied Control

Robotics at Google(谷歌机器人部门)

Jacky Liang, Wenlong Huang, Fei Xia, Peng Xu, Karol Hausman, Brian Ichter, Pete Florence, Andy Zeng

AI总结:

本文提出“代码即策略”方法,利用大语言模型根据自然语言指令生成机器人策略代码,通过分层代码生成提示实现空间推理、指令泛化与行为常识,并在多个真实机器人平台上验证了反应式与航路点式策略。

摘要:

已有研究表明,在代码补全任务上训练的大语言模型(LLMs)能够根据文档字符串(docstrings)合成简单的 Python 程序 [1]。我们发现,这些具备代码编写能力的 LLMs 可以被重新用于在给定自然语言指令的情况下编写机器人策略代码。具体而言,策略代码可以表达函数或反馈回路,用于处理感知输出(例如来自目标检测器 [2], [3] 的输出),并对控制原语 API 进行参数化。当以若干示例语言指令(以注释形式格式化)及其对应的策略代码作为输入(通过少样本提示)时,LLMs 可以接收新指令并自主重新组合 API 调用,从而分别生成新的策略代码。通过串联经典逻辑结构并引用第三方库(例如 NumPy、Shapely)来执行算术运算,以这种方式使用的 LLMs 可以编写出能够 (i) 展现空间几何推理能力、(ii) 泛化到新指令、以及 (iii) 根据上下文(即行为常识)为模糊描述(如“更快”)规定精确数值(例如速度)的机器人策略。本文提出代码即策略(code as policies):一种以机器人为中心的语言模型生成程序(LMPs)表述,该表述既可以表示反应式策略(例如阻抗控制器),也可以表示基于航路点的策略(基于视觉的抓取与放置、基于轨迹的控制),并在多个真实机器人平台上进行了演示。我们方法的核心是分层代码生成提示(递归定义未定义的函数),这能够编写更复杂的代码,并将 HumanEval [1] 基准上的最优结果提升至解决 39.8% 的问题。代码和视频可在 https://code-as-policies.github.io 获取。

英文摘要:

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

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑