TLDR: NRTrans is a new framework that translates natural language into robot control programs with correctness guarantees. It uses a simplified Robot Skill Language (RSL), a compiler for verification, and a debugger that provides feedback to LLMs for iterative program refinement. This approach significantly improves the success rate and accuracy of LLM-generated robot programs, especially for lightweight LLMs on resource-constrained robots, by ensuring programs are error-free before execution.
Large Language Models (LLMs) are increasingly being used in robotics to help robots understand and perform tasks given in natural language. This exciting development aims to bring embodied intelligence to robots, allowing them to generate control programs directly from user commands. However, a significant challenge with current methods is the frequent occurrence of programming errors in the generated code. This is often due to the inherent inconsistencies of LLMs and the complex nature of robotic tasks, especially when using smaller, more resource-efficient LLMs.
To address these issues, a new framework called NRTrans has been introduced. NRTrans is an LLM-powered system designed to translate natural language commands into robotic language with a crucial feature: correctness guarantees. This means the framework ensures that the generated robot control programs are free of errors before they are sent to the robot for execution. It also significantly improves the performance of LLMs in program generation through a unique feedback-based fine-tuning mechanism.
Understanding the Core Problem
Existing approaches to using LLMs in robotics generally fall into three categories: fine-tuning LLMs for low-level control, using prompt engineering to decompose tasks into pre-defined actions, or having LLMs generate high-level programs that are then compiled. Each of these methods has limitations. Fine-tuning requires vast datasets and computational resources, which are often unavailable for resource-constrained robots. Prompt engineering, while avoiding model training, frequently leads to programming errors due to LLM inconsistencies and task complexity. Generating high-level code also suffers from these programming errors and lacks built-in correctness checks.
Introducing NRTrans: A Novel Solution
NRTrans tackles these limitations head-on. It proposes a two-pronged approach: first, it provides correctness verification for generated control programs, and second, it enhances LLM performance in program generation through feedback-based fine-tuning. The cornerstone of this framework is the Robot Skill Language (RSL).
The Robot Skill Language (RSL)
RSL is a high-level language designed to simplify the intricate details of robot control programs. It acts as a bridge between natural language tasks and the robot’s underlying skills. By abstracting away complex hardware specifics, RSL allows LLMs to generate programs more easily, focusing on the robot’s capabilities rather than low-level code. RSL’s keywords are intuitive, directly representing robot actions like “FORWARD,” “GRASP,” or “APPROACH,” making it simpler for LLMs to understand and generate.
How NRTrans Works: A Four-Stage Process
The NRTrans framework operates in four distinct stages:
1. Prompt Construction and RSL Generation: The process begins by constructing a prompt for the LLM. This prompt includes a system message defining the LLM’s role and the rules of RSL, along with optional “shots” (examples) and the user’s natural language task. The LLM then generates an RSL program based on this prompt.
2. RSL Compilation and Validation: The generated RSL program is fed into the RSL compiler. This compiler translates the RSL program into an executable robot control program (e.g., in Python). Crucially, it also verifies the correctness of the RSL program against defined language rules. If errors are detected, the framework moves to the next stage.
3. Feedback Composition and RSL Fine-Tuning: If the RSL compiler finds errors, the RSL debugger generates clear, semantic-intuitive error messages. These messages are then incorporated back into the prompt, forming feedback for the LLM. The LLM uses this feedback to refine and regenerate the RSL program, entering a closed-loop fine-tuning process until the program passes compiler verification.
4. Robot Control Program Execution: Once the RSL program successfully passes all correctness checks, the compiled robot control program is deployed to the robot. This program automatically translates into low-level commands, enabling the robot to perform the specified actions.
Also Read:
- Enhancing Robot Safety in Dual-Arm Operations with SafeBimanual
- HumanoidVerse: A Robot That Understands and Rearranges Multiple Objects with Vision and Language
Key Advantages and Experimental Results
NRTrans offers several significant advantages. Its RSL simplicity reduces the complexity of program generation for LLMs, even lightweight ones. The RSL compiler provides crucial correctness guarantees, addressing the inconsistency issues often seen with LLMs. Furthermore, the feedback-based fine-tuning mechanism, powered by semantic-intuitive error messages, significantly enhances the LLM’s ability to generate correct programs, especially for resource-constrained devices.
Experiments comparing NRTrans with existing methods like ProgPrompt demonstrated impressive results. NRTrans consistently outperformed ProgPrompt, achieving an average improvement of 53.6% in success rate and 9.6% in accuracy. For lightweight LLMs like Gemma2-2b and Gemma2-9b, NRTrans showed a remarkable 30% increase in accuracy over ProgPrompt. Even in “zero-shot” scenarios (without initial examples), NRTrans significantly boosted the success rate by 91.6% through its feedback mechanism. This highlights the framework’s effectiveness and its applicability in real-world robotic applications, even with less powerful LLMs.
This innovative framework marks a significant step towards more reliable and efficient LLM-powered robotics, ensuring that robots can execute tasks accurately and robustly. For more details, you can refer to the full research paper: An LLM-powered Natural-to-Robotic Language Translation Framework with Correctness Guarantees.


