--- library_name: transformers pipeline_tag: text-generation base_model: meta-llama/Llama-3.2-1B-Instruct license: llama3.2 language: - en tags: - robotics - behavior-trees - behaviortree-cpp - ros2 - llama - arxiv:2602.01870 model-index: - name: BTGenBot-2 results: - task: type: text-generation name: Behavior Tree Generation dataset: name: BT Benchmark type: custom metrics: - type: success_rate name: Zero-shot Success Rate with Error Recovery value: 90.38 unit: '%' - type: success_rate name: One-shot Success Rate with Error Recovery value: 98.07 unit: '%' - type: xml_syntax name: XML Syntax Correctness with Error Recovery value: 100 unit: '%' - type: action_coherency name: Action Coherency with Error Recovery value: 100 unit: '%' datasets: - AIRLab-POLIMI/synthetic_bt --- # BTGenBot-2 `AIRLab-POLIMI/llama-3.2-1b-it-ft-lora-bt` is the fine-tuned Llama 3.2 1B Instruct model released with **BTGenBot-2: Efficient Behavior Tree Generation with Small Language Models**. BTGenBot-2 generates executable robot **Behavior Trees** from: 1. a natural-language task description, and 2. a list of available robot action primitives. The model outputs XML Behavior Trees compatible with **BehaviorTree.CPP**, supporting ROS 2 robotics behavior-tree pipelines. For the complete project, examples, code, dataset, benchmark, and paper, visit: 👉 **https://airlab-polimi.github.io/BTGenBot-2/** ## Model Details - **Developed by:** AIRLab, Politecnico di Milano - **Authors:** Riccardo Andrea Izzo, Gianluca Bardaro, Matteo Matteucci - **Base model:** `meta-llama/Llama-3.2-1B-Instruct` - **Model type:** Small language model for Behavior Tree generation - **Fine-tuning method:** QLoRA / LoRA parameter-efficient fine-tuning - **Input:** Natural-language robot task + available robot action primitives - **Output:** XML Behavior Tree compatible with BehaviorTree.CPP - **Language:** English - **Project page:** https://airlab-polimi.github.io/BTGenBot-2/ - **Paper:** https://arxiv.org/abs/2602.01870 - **Code:** https://github.com/AIRLab-POLIMI/BTGenBot-2 ## Intended Use This model is intended to generate robot Behavior Trees for research and development in robotics task planning. Example applications include: - ROS 2 / Nav2-compatible task planning; - navigation Behavior Tree generation; - manipulation Behavior Tree generation; - simulation-based robot-task validation; - benchmarking language-model-based Behavior Tree generation. ## Input Format The recommended input format is: ```text Task: Describe the robot task in natural language. Actions: [ActionName(parameters: parameter_1, parameter_2), AnotherAction(parameters: parameter_1)] ``` ## Output Format The model is expected to return XML only: ```xml ... ``` ## Training Data BTGenBot-2 was trained on a synthetic instruction-following dataset of **5,204** natural-language instruction / Behavior Tree pairs. Each sample contains: - `instruction`: system-level instructions for Behavior Tree generation; - `input`: task description and available robot actions; - `output`: XML Behavior Tree. The dataset was generated from real Behavior Trees and expanded through controlled synthetic generation. See the full project page for details: https://airlab-polimi.github.io/BTGenBot-2/ ## Training Procedure The model was fine-tuned from `meta-llama/Llama-3.2-1B-Instruct` using QLoRA / LoRA. Reported training details from the paper include: - **Train/test split:** 95% / 5% - **Learning rate:** `1e-4` - **Warmup ratio:** `0.1` - **Batch size:** `16` - **Training duration:** approximately 30 hours - **Hardware:** 2 × NVIDIA RTX Quadro 6000 GPUs, 48 GB total VRAM ## Citation ```bibtex @article{izzo2026btgenbot, title={BTGenBot-2: Efficient Behavior Tree Generation with Small Language Models}, author={Izzo, Riccardo Andrea and Bardaro, Gianluca and Matteucci, Matteo}, journal={arXiv preprint arXiv:2602.01870}, year={2026} } ``` ## More Information - **Project page:** https://airlab-polimi.github.io/BTGenBot-2/ - **Code:** https://github.com/AIRLab-POLIMI/BTGenBot-2 - **Paper:** https://arxiv.org/abs/2602.01870