Deploying and Evaluating LLMs to Program Service Mobile Robots

Zichao Hu, Francesca Lucchetti, Claire Schlesinger, Yash Saxena, Anders Freeman, Sadanand Modak, Arjun Guha, Joydeep Biswas · DOI

TL;DR

This paper introduces CODEBOTLER, an open-source framework that turns natural language into service robot programs via a Python-embedded domain-specific language (eDSL), alongside ROBOEVAL, a benchmark that evaluates these programs using a symbolic simulator and temporal logic trace verification. By validating execution traces across varied initial states and utilizing a rejection sampling strategy in simulation, the framework significantly reduces runtime and execution errors before real-world deployment.

What Problem Does This Paper Address?

While Large Language Models (LLMs) excel at generating code, deploying LLM-generated programs (LMPs) on physical service mobile robots presents high stakes: sequencing errors, bad assumptions about world states, or hallucinations can cause physical failures. Traditional evaluation techniques rely either on simple input-output unit tests (insufficient for interactive, state-dependent sequences) or computationally heavy 3D simulators.

To bridge this gap, the authors tackle two key challenges:

  1. Reliably generating robot programs that coordinate perception, navigation, manipulation, and human interaction.
  2. Rigorously evaluating the execution traces of these programs to verify whether they satisfy complex, order-dependent temporal tasks across dynamic initial world states and slight prompt variations.

Methods

The authors build a two-part ecosystem:

  • CODEBOTLER: Prompts LLMs using few-shot examples with an embedded domain-specific language (eDSL) in Python. The eDSL exposes modular primitives such as go_to(location), ask(person, question, options), say(message), pick(obj), place(obj), and is_in_room(object).
  • ROBOEVAL Evaluation Pipeline:
  • Symbolic Simulator: Executes the generated program in a fast, lightweight simulated environment containing rooms, movable objects, and interactive agents. It generates an execution trace $r$ (a sequence of executed skills and arguments) while logging any Python syntax/runtime errors or invalid physical executions.
  • RoboEval Temporal Logic (RTL): A domain-tailored derivative of Linear Temporal Logic (LTL) that defines correct execution constraints (e.g., verifying whether a robot went to an office before asking a person, and only proceeded if they answered "yes").
  • Pre-Deployment Rejection Sampling: To curb errors before physical deployment, the symbolic simulator runs candidates across sampled non-static world states (5 runs). If a program raises Python errors or invalid robot actions, CODEBOTLER re-prompts the model until an LMP passes or hits a maximum retry limit.

Datasets

The authors introduce the ROBOEVAL Benchmark:

  • 16 Service Robot Tasks: Tasks spanning navigation, arithmetic, open-world reasoning, and conditional branching (e.g., CountSavory, ElevatorTour, MailDelivery, WeatherPoll).
  • Prompt Variations: Each task includes 5 distinct paraphrases (80 prompts total) to test robustness against minor wording changes.
  • World States: Each task includes multiple predefined initial world states (e.g., varying object placements, presence/absence of people, and human responses).

Key Insights and Ideas

  • Traces Over I/O Matching: Task success in robotics depends on the process (e.g., did the robot visit all rooms to count items, or did it guess the answer?). Trace-based temporal evaluation captures sequencing bugs that unit tests miss.
  • Domain-Specific Logic Simplification: Standard LTL formulas quickly become convoluted for complex conditional robot behaviors. RTL simplifies constraints into readable trace operators like .AfterFirst() and .Exists().
  • Code-Trained Models Make Fewer Syntax Errors: Open-access code models (CodeLlama, StarCoder) produce fewer raw Python errors (3.4% and 3.7%) than general-purpose API models like GPT-3.5 (18.0%), suggesting that deep pretraining on code helps adhere to the defined eDSL syntax even with smaller model sizes.
  • Simulation-Based Rejection Sampling Works: Running candidate programs through quick symbolic checks before deployment substantially increases the fraction of executable programs across all models.

Key Results

The benchmark evaluated five LLMs (GPT-4, GPT-3.5, PaLM2, CodeLlama-34B, and StarCoder) across 50 completions per prompt:

  • Model Performance:
  • GPT-4 dramatically outperformed other models, achieving a 100% pass rate on 67.5% of prompts, and at least some correct completions (pass@1 > 0.001) on 98.75% of prompts.
  • In contrast, GPT-3.5 achieved complete success on 43.75% of prompts, PaLM2 on 28.75%, CodeLlama on 26.25%, and StarCoder on 20.00%.
  • Failure Modes Breakdown:
  • GPT-4: 85.5% successful executions, 11.7% task completion errors (failing RTL logic), and only 2.8% combined Python/execution errors.
  • StarCoder: 31.2% successful executions, 35.8% task completion errors, and 29.3% robot execution errors (such as hallucinating non-existent rooms or objects).
  • Retry Sampling Gains: Increasing the symbolic retry limit from 0 to 100 noticeably lifted CDF curves for all models, though certain models (PaLM2, CodeLlama, StarCoder) still hit fundamental ceilings on tasks with complex reasoning requirements.

Limitations and Future Work

  • Imperfect World Knowledge in Simulation: The symbolic simulator cannot anticipate all true world configurations (e.g., dynamic real-time human replies or newly introduced objects), relying instead on random state sampling.
  • Ceiling Effects on Reasoning Failures: While rejection sampling successfully eliminates syntax and invalid execution calls, it does not directly fix underlying logical flaws or complex reasoning failures where the code executes cleanly but violates the task intent.
  • Future Work: The authors plan to investigate more sophisticated error mitigation strategies before robot deployment to eliminate stubborn logic and execution errors that simple retries fail to resolve.

Summary updated

BibTeX
@article{hu2024deploying,
  author = {Zichao Hu and Francesca Lucchetti and Claire Schlesinger and Yash Saxena and Anders Freeman and Sadanand Modak and Arjun Guha and Joydeep Biswas},
  title = {{Deploying and Evaluating LLMs to Program Service Mobile Robots}},
  journal = {IEEE Robotics Autom. Lett.},
  year = {2024},
  doi = {10.1109/lra.2024.3360020},
}
Figure