ProgPrompt: Generating Situated Robot Task Plans using Large Language Models

Ishika Singh, Valts Blukis, Arsalan Mousavian, Ankit Goyal, Danfei Xu, Jonathan Tremblay, Dieter Fox, Jesse Thomason, Animesh Garg · DOI

Introduction

Large Language Models (LLMs) like GPT-3 possess extensive "common sense" knowledge about the world. However, applying this knowledge to robotics is challenging because LLMs lack situated awareness. A standard LLM might suggest actions that are impossible in the robot's current environment or generate instructions that do not align with the robot's specific API. Previous attempts to bridge this gap often resulted in "hallucinated" actions or required exhaustive, pre-defined step lists.

ProgPrompt addresses this by treating robot task planning as a code-generation problem. By constraining the LLM to a Pythonic structure, researchers can ground the model's reasoning within the robot's specific capabilities and immediate surroundings.

Methodology: The ProgPrompt Framework

The core of the approach is a prompting scheme that formats the robot’s world and capabilities as a Python program. Instead of natural language instructions, the LLM is provided with a structured prompt containing:

  1. Action Primitives: An import statement listing available robot actions (e.g., grab, open, find).
  2. Environment State: A list of strings representing objects currently detected in the environment, grounding the LLM in its physical context.
  3. Few-Shot Examples: Fully defined Python functions representing completed tasks to guide the model's output format.
  4. State Feedback via Assertions: The generated code includes assert statements to check preconditions. If an assertion fails, "recovery actions" in an else block allow the robot to correct the state before proceeding.
  5. Chain-of-Thought Comments: Natural language comments (e.g., # 1: find the salmon) encourage the LLM to decompose complex goals into logical sub-tasks before generating code.
Overview of the ProgPrompt system architecture, including planning, state feedback, and execution.

Experimental Evaluation

ProgPrompt was evaluated in two distinct settings:

  • VirtualHome (VH): A simulation platform where the system was tested on 70 household tasks across three environments with 115 unique objects.
  • Physical Robot: Deployment on a Franka-Emika Panda robot arm for tabletop tasks. Real-world objects were identified using ViLD, an open-vocabulary object detector, to populate the prompt's object list.

Key Results and Insights

The programmatic structure of ProgPrompt significantly improves both the success rate and the executability of generated plans. By presenting robot actions as a library, the LLM is effectively constrained to the robot's functional boundaries. Furthermore, the inclusion of natural language comments acts as a "Chain of Thought," reducing repetitive or incoherent outputs.

Quantitative results comparing ProgPrompt variants and baselines across Success Rate (SR), Executability (Exec), and Goal Completion Rate (GCR).

As shown in the results table, ProgPrompt (using the Codex backbone) achieved a Success Rate (SR) of 40% in VirtualHome, a stark contrast to the 0% achieved by natural language baselines. Additionally, 90% of the generated actions were executable. Ablation studies confirmed that both comments and state feedback (assertions) are critical; removing comments dropped the Success Rate from 34% to 18% when using GPT-3.

Limitations and Future Work

While ProgPrompt represents a significant step forward, several limitations remain. In simulation, agents occasionally failed due to environment-specific constraints (e.g., inability to interact while sitting) that the LLM did not fully grasp. Token limits in LLMs also pose a challenge for extremely complex tasks, which may result in truncated plans.

Future research will explore incorporating real-valued numbers for precise measurements, nested dictionaries for complex scene graphs, and more sophisticated control flows to handle highly dynamic real-world environments.

Summary updated

BibTeX
@inproceedings{singh2023progprompt,
  author = {Ishika Singh and Valts Blukis and Arsalan Mousavian and Ankit Goyal and Danfei Xu and Jonathan Tremblay and Dieter Fox and Jesse Thomason and Animesh Garg},
  title = {{ProgPrompt: Generating Situated Robot Task Plans using Large Language Models}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2023},
  doi = {10.1109/icra48891.2023.10161317},
}
Figure