Demo2Code: From Summarizing Demonstrations to Synthesizing Code via Extended Chain-of-Thought
On the map: LLM reasoning → Spatial and embodied reasoning
Abstract (arXiv)
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/
Key facts. Cited by 39 papers in the map (data through 7 Oct 2026). Placed in Spatial and embodied reasoning, one of 17 directions in LLM reasoning. Builds on 7 of its 69 references that are in the map. First posted on arXiv 26 May 2023.
Builds on
7 of 69 references.
Closest ancestors · 1
Same direction, newest first
Other references · 6
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,397
- 2022BC-Z: Zero-Shot Task Generalization with Robotic Imitation Learningcited by 517
- 2022Socratic Models: Composing Zero-Shot Multimodal Reasoning with Languagecited by 513
- 2023Text2Motion: From Natural Language Instructions to Feasible Planscited by 223
Built on by
Citing papers per year: 2023: 6; 2024: 17; 2025: 6; 2026: 10.
39 papers.
Sort:
By area:
- 2023Eureka: Human-Level Reward Design via Coding Large Language Modelscited by 542
- 2023RoCo: Dialectic Multi-Robot Collaboration with Large Language Modelscited by 171
- 2024WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environmentcited by 99
- 2024Vision Language Models are In-Context Value Learnerscited by 84
- 2024DrEureka: Language Model Guided Sim-To-Real Transfercited by 78
- 2024If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agentscited by 77
- 2023SteP: Stacked LLM Policies for Web Actionscited by 66
- 2024A Large Language Model-Driven Reward Design Framework via Dynamic Feedback for Reinforcement Learningcited by 29
- 2024Harmon: Whole-Body Motion Generation of Humanoid Robots from Language Descriptionscited by 22
- 2024Empowering Large Language Model Agents through Action Learningcited by 20
- 2024SwarmBrain: Embodied agent for real-time strategy game StarCraft II via large language modelscited by 18
- 2024Eurekaverse: Environment Curriculum Generation via Large Language Modelscited by 14
27 more
- 2025ReCode: Unify Plan and Action for Universal Granularity Controlcited by 14
- 2024From Pixels to Predicates: Learning Symbolic World Models via Pretrained Vision-Language Modelscited by 11
- 2024VLMimic: Vision Language Models are Visual Imitation Learner for Fine-grained Actionscited by 8
- 2025Modeling Others' Minds as Codecited by 6
- 2023BYOC: Personalized Few-Shot Classification with Co-Authored Class Descriptionscited by 5
- 2023O3D: Offline Data-driven Discovery and Distillation for Sequential Decision-Making with Large Language Modelscited by 4
- 2024Natural Language as Policies: Reasoning for Coordinate-Level Embodied Control with LLMscited by 4
- 2024Knowing What Not to Do: Leverage Language Model Insights for Action Space Pruning in Multi-agent Reinforcement Learningcited by 3
- 2025Skill-Aligned Fairness in Multi-Agent Learning for Collaboration in Healthcarecited by 3
- 2024DocuMint: Docstring Generation for Python using Small Language Modelscited by 2
- 2024RoboCoder: Robotic Learning from Basic Skills to General Tasks with Large Language Modelscited by 2
- 2023Program Machine Policy: Addressing Long-Horizon Tasks by Integrating Program Synthesis and State Machinescited by 1
- 2025Long-Horizon Visual Imitation Learning via Plan and Code Reflectioncited by 1
- 2025Intuitive Programming, Adaptive Task Planning, and Dynamic Role Allocation in Human-Robot Collaborationcited by 1
- 2026TMR-VLA:Vision-Language-Action Model for Magnetic Motion Control of Tri-leg Silicone-based Soft Robotcited by 1
- 2026A Few Words Go a Long Way: Language Guided Robot Policy Synthesiscited by 1
- 2026Reconstruct, Practice, Go Real: Guided Self-Improvement for Embodied Agentscited by 1
- 2024Sketch-Plan-Generalize: Learning and Planning with Neuro-Symbolic Programmatic Representations for Inductive Spatial Conceptscited by 0
- 2024Creating and Repairing Robot Programs in Open-World Domainscited by 0
- 2025Rational Inverse Reasoning: Few-Shot Imitation by Inferring Intent through Planningcited by 0
- 2026Cross-Domain Demo-to-Code via Neurosymbolic Counterfactual Reasoningcited by 0
- 2026Efficient Skill Grounding via Code Refactoring with Small Language Modelscited by 0
- 2026Weights or Skills? A Survey of Robot-Learning Techniques: from Action-Predicting Weights to Robots that Write their Own Skillscited by 0
- 2026Learning and Transferring Closed-Loop Robot Softwarecited by 0
- 2026Generalizing Manipulation Skills with a Local Coding Agentcited by 0
- 2026CodeActionBench: Evaluating Agentic Code-as-Policy for Embodied Manipulationcited by 0
- 2026Encore: Few-Shot Agentic Discovery of Manipulation Strategiescited by 0
- 2026Reconstruct, Practice, Go Real: Guided Self-Improvement for Embodied Agents1 Oct 2026
- 2026Encore: Few-Shot Agentic Discovery of Manipulation Strategies29 Sep 2026
- 2026CodeActionBench: Evaluating Agentic Code-as-Policy for Embodied Manipulation27 Sep 2026
- 2026Generalizing Manipulation Skills with a Local Coding Agent22 Sep 2026
- 2026Learning and Transferring Closed-Loop Robot Software17 Sep 2026
- 2026Weights or Skills? A Survey of Robot-Learning Techniques: from Action-Predicting Weights to Robots that Write their Own Skills3 Aug 2026
- 2026A Few Words Go a Long Way: Language Guided Robot Policy Synthesis26 Jul 2026
- 2026Efficient Skill Grounding via Code Refactoring with Small Language Models6 Jun 2026
- 2026Cross-Domain Demo-to-Code via Neurosymbolic Counterfactual Reasoning19 Mar 2026
- 2026TMR-VLA:Vision-Language-Action Model for Magnetic Motion Control of Tri-leg Silicone-based Soft Robot28 Feb 2026
- 2025Intuitive Programming, Adaptive Task Planning, and Dynamic Role Allocation in Human-Robot Collaboration11 Nov 2025
- 2025ReCode: Unify Plan and Action for Universal Granularity Control27 Oct 2025
27 more
- 2025Modeling Others' Minds as Code29 Sep 2025
- 2025Long-Horizon Visual Imitation Learning via Plan and Code Reflection4 Sep 2025
- 2025Skill-Aligned Fairness in Multi-Agent Learning for Collaboration in Healthcare26 Aug 2025
- 2025Rational Inverse Reasoning: Few-Shot Imitation by Inferring Intent through Planning12 Aug 2025
- 2024From Pixels to Predicates: Learning Symbolic World Models via Pretrained Vision-Language Models31 Dec 2024
- 2024Vision Language Models are In-Context Value Learners7 Nov 2024
- 2024Eurekaverse: Environment Curriculum Generation via Large Language Models4 Nov 2024
- 2024VLMimic: Vision Language Models are Visual Imitation Learner for Fine-grained Actions28 Oct 2024
- 2024Creating and Repairing Robot Programs in Open-World Domains24 Oct 2024
- 2024A Large Language Model-Driven Reward Design Framework via Dynamic Feedback for Reinforcement Learning18 Oct 2024
- 2024Harmon: Whole-Body Motion Generation of Humanoid Robots from Language Descriptions16 Oct 2024
- 2024RoboCoder: Robotic Learning from Basic Skills to General Tasks with Large Language Models6 Jun 2024
- 2024DrEureka: Language Model Guided Sim-To-Real Transfer4 Jun 2024
- 2024Knowing What Not to Do: Leverage Language Model Insights for Action Space Pruning in Multi-agent Reinforcement Learning27 May 2024
- 2024DocuMint: Docstring Generation for Python using Small Language Models16 May 2024
- 2024Sketch-Plan-Generalize: Learning and Planning with Neuro-Symbolic Programmatic Representations for Inductive Spatial Concepts11 Apr 2024
- 2024Natural Language as Policies: Reasoning for Coordinate-Level Embodied Control with LLMs20 Mar 2024
- 2024Empowering Large Language Model Agents through Action Learning24 Feb 2024
- 2024WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment19 Feb 2024
- 2024SwarmBrain: Embodied agent for real-time strategy game StarCraft II via large language models31 Jan 2024
- 2024If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agents1 Jan 2024
- 2023Program Machine Policy: Addressing Long-Horizon Tasks by Integrating Program Synthesis and State Machines27 Nov 2023
- 2023O3D: Offline Data-driven Discovery and Distillation for Sequential Decision-Making with Large Language Models22 Oct 2023
- 2023Eureka: Human-Level Reward Design via Coding Large Language Models19 Oct 2023
- 2023BYOC: Personalized Few-Shot Classification with Co-Authored Class Descriptions9 Oct 2023
- 2023SteP: Stacked LLM Policies for Web Actions5 Oct 2023
- 2023RoCo: Dialectic Multi-Robot Collaboration with Large Language Models10 Jul 2023
- 2024If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agentscited by 77
- 2024Empowering Large Language Model Agents through Action Learningcited by 20
- 2024SwarmBrain: Embodied agent for real-time strategy game StarCraft II via large language modelscited by 18
- 2024Knowing What Not to Do: Leverage Language Model Insights for Action Space Pruning in Multi-agent Reinforcement Learningcited by 3
- 2026Reconstruct, Practice, Go Real: Guided Self-Improvement for Embodied Agentscited by 1
- 2026Generalizing Manipulation Skills with a Local Coding Agentcited by 0
- 2026CodeActionBench: Evaluating Agentic Code-as-Policy for Embodied Manipulationcited by 0
- 2026Encore: Few-Shot Agentic Discovery of Manipulation Strategiescited by 0
- 2026Reconstruct, Practice, Go Real: Guided Self-Improvement for Embodied Agents1 Oct 2026
- 2026Encore: Few-Shot Agentic Discovery of Manipulation Strategies29 Sep 2026
- 2026CodeActionBench: Evaluating Agentic Code-as-Policy for Embodied Manipulation27 Sep 2026
- 2026Generalizing Manipulation Skills with a Local Coding Agent22 Sep 2026
- 2024Knowing What Not to Do: Leverage Language Model Insights for Action Space Pruning in Multi-agent Reinforcement Learning27 May 2024
- 2024Empowering Large Language Model Agents through Action Learning24 Feb 2024
- 2024SwarmBrain: Embodied agent for real-time strategy game StarCraft II via large language models31 Jan 2024
- 2024If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agents1 Jan 2024
- 2023RoCo: Dialectic Multi-Robot Collaboration with Large Language Modelscited by 171
- 2024DrEureka: Language Model Guided Sim-To-Real Transfercited by 78
- 2023SteP: Stacked LLM Policies for Web Actionscited by 66
- 2024Harmon: Whole-Body Motion Generation of Humanoid Robots from Language Descriptionscited by 22
- 2024Eurekaverse: Environment Curriculum Generation via Large Language Modelscited by 14
- 2025ReCode: Unify Plan and Action for Universal Granularity Controlcited by 14
- 2025Modeling Others' Minds as Codecited by 6
- 2023BYOC: Personalized Few-Shot Classification with Co-Authored Class Descriptionscited by 5
- 2023O3D: Offline Data-driven Discovery and Distillation for Sequential Decision-Making with Large Language Modelscited by 4
- 2025Skill-Aligned Fairness in Multi-Agent Learning for Collaboration in Healthcarecited by 3
- 2024DocuMint: Docstring Generation for Python using Small Language Modelscited by 2
- 2024RoboCoder: Robotic Learning from Basic Skills to General Tasks with Large Language Modelscited by 2
12 most cited of 20 All 20 (JSON)
- 2026Learning and Transferring Closed-Loop Robot Software17 Sep 2026
- 2026Weights or Skills? A Survey of Robot-Learning Techniques: from Action-Predicting Weights to Robots that Write their Own Skills3 Aug 2026
- 2026Efficient Skill Grounding via Code Refactoring with Small Language Models6 Jun 2026
- 2026TMR-VLA:Vision-Language-Action Model for Magnetic Motion Control of Tri-leg Silicone-based Soft Robot28 Feb 2026
- 2025Intuitive Programming, Adaptive Task Planning, and Dynamic Role Allocation in Human-Robot Collaboration11 Nov 2025
- 2025ReCode: Unify Plan and Action for Universal Granularity Control27 Oct 2025
- 2025Modeling Others' Minds as Code29 Sep 2025
- 2025Skill-Aligned Fairness in Multi-Agent Learning for Collaboration in Healthcare26 Aug 2025
- 2024Eurekaverse: Environment Curriculum Generation via Large Language Models4 Nov 2024
- 2024Creating and Repairing Robot Programs in Open-World Domains24 Oct 2024
- 2024Harmon: Whole-Body Motion Generation of Humanoid Robots from Language Descriptions16 Oct 2024
- 2024RoboCoder: Robotic Learning from Basic Skills to General Tasks with Large Language Models6 Jun 2024
12 newest of 20 All 20 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2024Learning Novel Skills from Language-Generated Demonstrations
- 2025Learning Compositional Behaviors from Demonstration and Language
- 2025Growing with Your Embodied Agent: A Human-in-the-Loop Lifelong Code Generation Framework for Long-Horizon Manipulation Skills
- 2025LLM Trainer: Automated Robotic Data Generation via Demonstration Augmentation using LLMs
- 2026Learning Compositional Symbolic Task Rules from Demonstrations with Inductive Logic Programming
- 2025BT-ACTION: A Test-Driven Approach for Modular Understanding of User Instruction Leveraging Behaviour Trees and LLMs ↗
- 2023Scaling Up and Distilling Down: Language-Guided Robot Skill Acquisition
- 2025RoboInspector: Unveiling the Unreliability of Policy Code for LLM-enabled Robotic Manipulation