BTGenBot: Behavior Tree Generation for Robotic Tasks with Lightweight LLMs
Riccardo Andrea Izzo, Gianluca Bardaro, Matteo Matteucci
TL;DR
The paper tackles the problem of flexible robot task planning within hardware constraints by using fine-tuned, lightweight LLMs (≤7B parameters) to generate executable behavior trees. It introduces a 600 BT dataset with natural-language task descriptions and employs a two-step LoRA-based fine-tuning pipeline on Llama-2-7B, LlamaChat, and CodeLlama-7B-Instruct. Comprehensive evaluation across nine tasks combines syntactic (Groot2), semantic (expert) validation, a BT validator, simulation with TurtleBot3, and real-robot deployment, showing that fine-tuned models outperform base models and that LlamaChat often provides the best overall performance. The work demonstrates the feasibility of on-device BT generation for robotic control, enabling a direct user-to-robot interface with practical implications for service robotics and logistics, while highlighting the need for robust automatic validation for deployment.
Abstract
This paper presents a novel approach to generating behavior trees for robots using lightweight large language models (LLMs) with a maximum of 7 billion parameters. The study demonstrates that it is possible to achieve satisfying results with compact LLMs when fine-tuned on a specific dataset. The key contributions of this research include the creation of a fine-tuning dataset based on existing behavior trees using GPT-3.5 and a comprehensive comparison of multiple LLMs (namely llama2, llama-chat, and code-llama) across nine distinct tasks. To be thorough, we evaluated the generated behavior trees using static syntactical analysis, a validation system, a simulated environment, and a real robot. Furthermore, this work opens the possibility of deploying such solutions directly on the robot, enhancing its practical applicability. Findings from this study demonstrate the potential of LLMs with a limited number of parameters in generating effective and efficient robot behaviors.
