Demo2Code: From Summarizing Demonstrations to Synthesizing Code via Extended Chain-of-Thought

Huaxiaoyue Wang, Gonzalo Gonzalez-Pumariega, Yash Sharma, Sanjiban Choudhury
5/1/2023

No official code found. Best implementation: portal-cornell/robotouille (45 stars, MIT, last commit 2026-05-03). 1 more below.

Abstract

Language instructions and demonstrations are two natural ways for users to teach robots personalized tasks. Recent progress in Large Language Models (LLMs) has shown impressive performance in translating language instructions into code for robotic tasks. However, translating demonstrations into task code continues to be a challenge due to the length and complexity of both demonstrations and code, making learning a direct mapping intractable. This paper presents Demo2Code, a novel framework that generates robot task code from demonstrations via an extended chain-of-thought and defines a common latent specification to connect the two. Our framework employs a robust two-stage process: (1) a recursive summarization technique that condenses demonstrations into concise specifications, and (2) a code synthesis approach that expands each function recursively from the generated specifications. We conduct extensive evaluation on various robot task benchmarks, including a novel game benchmark Robotouille, designed to simulate diverse cooking tasks in a kitchen environment. The project's website is available at https://portal-cornell.github.io/demo2code/

View on arXivView PDF

Code Implementations(2)

MIT
456C, SASFeb 18, 20235 months agoMIT
60PythonOct 27, 20231 years ago

Similar Papers

Cite this paper

@article{wang2023democode,
  title  = {Demo2Code: From Summarizing Demonstrations to Synthesizing Code via Extended Chain-of-Thought},
  author = {Huaxiaoyue Wang and Gonzalo Gonzalez-Pumariega and Yash Sharma and Sanjiban Choudhury},
  year   = {2023},
  eprint = {2305.16744},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/pdf/2305.16744},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.16744.svg)](https://codeofpaper.com/paper/2305.16744)

Discussion