Robo-Instruct: Simulator-Augmented Instruction Alignment For Finetuning Code LLMs

Zichao Hu, Junyi Jessy Li, Arjun Guha, Joydeep Biswas

TL;DR

ROBO-INSTRUCT is a novel framework that generates high-quality synthetic training data to fine-tune small, local Code LLMs for robotics. By synthesizing simulation environments "on the fly" to verify physical constraints and using LLMs to align instructions with verified code, it allows 7B-parameter models to match or outperform much larger proprietary models like GPT-4o-mini on robot programming tasks.

What Problem Does This Paper Address?

While large language models (LLMs) like GPT-4 are excellent at converting natural language into executable robot code, they are often impractical for real-world robotics due to high latency, privacy concerns, and the requirement for constant network connectivity. The ideal solution is to use smaller, "open-weight" models (e.g., Llama-3, Qwen) that can run locally on the robot's hardware.

However, these smaller models require fine-tuning on domain-specific data. Existing synthetic data generation methods like Self-Instruct often fail in robotics because they don't account for physical reality. An LLM might generate a program that tries to pick up an object that isn't there, or attempt to carry two items when the robot only has one arm.

Figure 2: Examples of programs violating domain- specific constraints.

Building a static simulator to catch these errors is a "chicken and egg" problem: you can't build the environment until you know what objects the LLM-generated task will require.

Methods

The authors introduce ROBO-INSTRUCT, a pipeline that automates the creation of verified, physically grounded training data. The framework consists of three main stages:

  1. On-the-Fly Simulation (Angelic Execution): Instead of using a pre-defined world, ROBO-INSTRUCT builds the simulation environment as the program runs. When the code calls an API like pick("apple"), the simulator dynamically infers that "apple" is an entity of type object and assigns it a state (e.g., its location).
  2. Constraint Verification: The system checks the program against robot-specific constraints (e.g., "cannot pick up a location") and real-world logic (e.g., "cannot pick up an object that doesn't exist"). If a program fails in any sampled simulation "world," it is rejected.
  3. LLM-Aided Instruction Alignment: Even if a program is valid, it might not perfectly match the original instruction. ROBO-INSTRUCT uses a larger LLM to look at the verified code and rewrite the instruction to match what the code actually does, ensuring high-quality pairs for fine-tuning.
High-level overview of the ROBO-INSTRUCT framework.

Datasets

The researchers evaluated their framework using ROBOEVAL, a benchmark specifically designed for service mobile robots. It includes 16 complex tasks (like "ElevatorTour" or "MailDelivery") that require navigation, perception, and human interaction. To generate the training data, they used Llama-3-8B to produce 5,000 unique instruction-program pairs, which were then filtered and aligned by the ROBO-INSTRUCT pipeline.

Key Insights and Ideas

  • The "Undefined" State: Traditional planning (like STRIPS) uses binary True/False states. ROBO-INSTRUCT introduces an "Undefined" state. If a program checks for an object that hasn't been defined yet, the simulator randomly instantiates it as either present or absent. This allows the system to test if the code is robust enough to handle different environmental configurations.
  • Instruction-to-Code vs. Code-to-Instruction: Most alignment research focuses on making code match the instruction. ROBO-INSTRUCT flips this: since the code has been physically verified by the simulator, it treats the code as the "ground truth" and revises the instruction to match it.
  • Efficiency of Small Models: The paper proves that a well-curated, physically-grounded dataset is more valuable than raw model scale. A 7B model trained on verified data can beat a 34B model trained on standard synthetic data.

Key Results

  • Performance Boost: ROBO-INSTRUCT-fine-tuned models outperformed their base versions by an average of 19.9% in pass@1 scores.
  • Beating the Giants: The fine-tuned 7B and 9B models matched or surpassed the performance of much larger models, including StarCoder2-15B and the proprietary GPT-4o-mini.
  • Speed: In real-world deployment tests, the local fine-tuned models were approximately 6x faster at generating code than querying GPT-4, significantly reducing robot response latency.
  • Ablation Success: The combination of both program verification and instruction alignment yielded the best results (68.75% pass@1 for CodeLlama-7B), proving that both physical grounding and linguistic alignment are necessary.

Limitations and Future Work

The authors note that their framework provides necessary but not sufficient conditions for correctness. While it catches physical violations, it might miss high-level logic errors. For example, the simulator might allow a robot to "pick up a building" if the LLM treats the building as a small object, because the simulator infers types based on API usage rather than common-sense physics.

Future work includes integrating ROBO-INSTRUCT into a reinforcement learning loop, allowing models to iteratively learn from their simulation failures to generate even more robust and realistic robot programs.

Summary updated

BibTeX
@inproceedings{hu2025robo,
  author = {Zichao Hu and Junyi Jessy Li and Arjun Guha and Joydeep Biswas},
  title = {{Robo-Instruct: Simulator-Augmented Instruction Alignment For Finetuning Code LLMs}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=WnZjdQOWiY},
}
Figure