Proceedings

Code-BT: A Code-Driven Approach to Behavior Tree Generation for Robot Tasks Planning with Large Language Models

Download BibTeX Cite

Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 8814-8822.

https://doi.org/10.24963/ijcai.2025/980

Abstract

Behavior trees(BTs) provide a systematic and structured control architecture extensively employed in game AI and robotic behavior control, owing to their modularity, reactivity, and reusability. Nonetheless, manual BTs design requires significant expertise and becomes inefficient as task complexity increases. Recent automation technologies have avoided manual work, but often have high application barriers and face challenges in adapting to new tasks, making it difficult to easily configure them to specific requirements. Code-BT introduces a novel approach that utilizes large language models(LLMs) to automatically generate BTs, representing the task planning process as the process of coding and organizing sequences. By retrieving control flow information from the generated code, BTs can be efficiently constructed to address the complexity and diversity of task planning challenges. Rather than relying on manual design, Code-BT uses task instructions to guide the selection of relevant APIs, and then systematically assembles these APIs into modular code to align with the BTs structure. Finally, action sequences and control logic are extracted from the generated code to construct the BTs. Our approach not only ensures the automation of BTs generation but also guarantees the scalability and adaptability for long-term tasks. Experimental results demonstrate that Code-BT substantially improves LLM performance in BTs generation, achieving improvements ranging from16.67% to 29.17%.

  1. [Achiam et al., 2023] Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Alt- man, Shyamal Anadkat, et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
  2. [Aeronautiques et al., 1998] Constructions Aeronautiques, Adele Howe, Craig Knoblock, ISI Drew McDermott, Ash- win Ram, Manuela Veloso, Daniel Weld, David Wilkins Sri, Anthony Barrett, Dave Christianson, et al. Pddl-the planning domain definition language. Technical Report, Tech. Rep., 1998.
  3. [Ao et al., 2024] Jicong Ao, Fan Wu, Yansong Wu, Abdalla Swikir, and Sami Haddadin. Llm as bt-planner: Leverag- ing llms for behavior tree generation in robot task plan- ning. arXiv preprint arXiv:2409.10444, 2024.
  4. [Austin et al., 2021] Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, et al. Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021.
  5. [Brown et al., 2020] Tom Brown, Benjamin Mann, Nick Ry- der, Melanie Subbiah, Jared D Kaplan, Prafulla Dhari- wal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing sys- tems, 33:1877-1901, 2020.
  6. [Burns et al., 2024] Kaylee Burns, Ajinkya Jain, Keegan Go, Fei Xia, Michael Stark, Stefan Schaal, and Karol Haus- man. Genchip: Generating robot policy code for high- precision and contact-rich manipulation tasks. arXiv preprint arXiv:2404.06645, 2024.
  7. [Cai et al., 2021] Zhongxuan Cai, Minglong Li, Wanrong Huang, and Wenjing Yang. Bt expansion: a sound and complete algorithm for behavior planning of intelligent robots with behavior trees. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 6058-6065, 2021.
  8. [Cao and Lee, 2023] Yue Cao and CS Lee. Robot behavior- tree-based task generation with large language models. arXiv preprint arXiv:2302.12927, 2023.
  9. [Chen et al., 2021] Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde De Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021.
  10. [Chen et al., 2023] Siwei Chen, Anxing Xiao, and David Hsu. Llm-state: Expandable state representation for long- horizon task planning in the open world. arXiv preprint arXiv:2311.17406, 2023.
  11. [Chen et al., 2024] Xinglin Chen, Yishuai Cai, Yunxin Mao, Minglong Li, Wenjing Yang, Weixia Xu, and Ji Wang. In- tegrating intent understanding and optimal behavior plan- ning for behavior tree generation from human instructions. arXiv preprint arXiv:2405.07474, 2024. IJCAI
  12. [Colledanchise and Natale, 2021] Michele Colledanchise and Lorenzo Natale. On the implementation of behavior trees in robotics. IEEE Robotics and Automation Letters, 6(3):5929-5936, 2021.
  13. [Colledanchise and Ögren, 2016] Michele Colledanchise and Petter Ögren. How behavior trees modularize hy- brid control systems and generalize sequential behavior compositions, the subsumption architecture, and decision trees. IEEE Transactions on robotics, 33(2):372-389, 2016.
  14. [Colledanchise and Ögren, 2018] Michele Colledanchise and Petter Ögren. Behavior trees in robotics and AI: An introduction. CRC Press, 2018.
  15. [DeepSeek-AI, 2024] DeepSeek-AI. Introducing deepseek v2.5 blog. https://platform.deepseek.com/api-docs/zh-cn/ news/news0905/, 2024. Link
  16. [Dubey et al., 2024] Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024.
  17. [Gugliermo et al., 2023] Simona Gugliermo, Erik Schaffer- nicht, Christos Koniaris, and Federico Pecora. Learning behavior trees from planning experts using decision tree and logic factorization. IEEE Robotics and Automation Letters, 8(6):3534-3541, 2023.
  18. [Hurst et al., 2024] Aaron Hurst, Adam Lerer, Adam P Goucher, Adam Perelman, Aditya Ramesh, Aidan Clark, AJ Ostrow, Akila Welihinda, Alan Hayes, Alec Rad- ford, et al. Gpt-4o system card. arXiv preprint arXiv:2410.21276, 2024.
  19. [Iovino et al., 2021] Matteo Iovino, Jonathan Styrud, Pietro Falco, and Christian Smith. Learning behavior trees with genetic programming in unpredictable environments. In 2021 IEEE International Conference on Robotics and Au- tomation (ICRA), pages 4591-4597. IEEE, 2021.
  20. [Izzo et al., 2024] Riccardo Andrea Izzo, Gianluca Bardaro, and Matteo Matteucci. Btgenbot: Behavior tree genera- tion for robotic tasks with lightweight llms. arXiv preprint arXiv:2403.12761, 2024.
  21. [Jain et al., 2024] Aayush Jain, Philip Long, Valeria Vil- lani, John D Kelleher, and Maria Chiara Leva. Cobt: Collaborative programming of behaviour trees from one demonstration for robot manipulation. arXiv preprint arXiv:2404.05870, 2024.
  22. [Jiang et al., 2024a] Juyong Jiang, Fan Wang, Jiasi Shen, Sungju Kim, and Sunghun Kim. A survey on large language models for code generation. arXiv preprint arXiv:2406.00515, 2024.
  23. [Jiang et al., 2024b] Xue Jiang, Yihong Dong, Lecheng Wang, Zheng Fang, Qiwei Shang, Ge Li, Zhi Jin, and Wenpin Jiao. Self-planning code generation with large language models. ACM Transactions on Software Engi- neering and Methodology, 33(7):1-30, 2024.
  24. [Koenig and Howard, 2004] Nathan Koenig and Andrew Howard. Design and use paradigms for gazebo, an open-source multi-robot simulator. In 2004 IEEE/RSJ international conference on intelligent robots and sys- tems (IROS)(IEEE Cat. No. 04CH37566), volume 3, pages 2149-2154. Ieee, 2004.
  25. [Li et al., 2023] Jia Li, Ge Li, Yongmin Li, and Zhi Jin. Structured chain-of-thought prompting for code genera- tion. ACM Transactions on Software Engineering and Methodology, 2023.
  26. [Li et al., 2024] Chengshu Li, Ruohan Zhang, Josiah Wong, Cem Gokmen, Sanjana Srivastava, Roberto Martín- Martín, Chen Wang, Gabrael Levine, Wensi Ai, Benjamin Martinez, et al. Behavior-1k: A human-centered, embod- ied ai benchmark with 1,000 everyday activities and real- istic simulation. arXiv preprint arXiv:2403.09227, 2024.
  27. [Liang et al., 2023] Jacky Liang, Wenlong Huang, Fei Xia, Peng Xu, Karol Hausman, Brian Ichter, Pete Florence, and Andy Zeng. Code as policies: Language model programs for embodied control. In 2023 IEEE International Con- ference on Robotics and Automation (ICRA), pages 9493- 9500. IEEE, 2023.
  28. [Liu et al., 2024] Aixin Liu, Bei Feng, Bin Wang, Bingxuan Wang, Bo Liu, Chenggang Zhao, Chengqi Dengr, Chong Ruan, Damai Dai, Daya Guo, et al. Deepseek-v2: A strong, economical, and efficient mixture-of-experts lan- guage model. arXiv preprint arXiv:2405.04434, 2024.
  29. [Lykov et al., 2023] Artem Lykov, Maria Dronova, Niko- lay Naglov, Mikhail Litvinov, Sergei Satsevich, Artem Bazhenov, Vladimir Berman, Aleksei Shcherbak, and Dzmitry Tsetserukou. Llm-mars: Large language model for behavior tree generation and nlp-enhanced di- alogue in multi-agent robot systems. arXiv preprint arXiv:2312.09348, 2023.
  30. [Mower et al., 2024] Christopher E Mower, Yuhui Wan, Hongzhan Yu, Antoine Grosnit, Jonas Gonzalez- Billandon, Matthieu Zimmer, Jinlong Wang, Xinyu Zhang, Yao Zhao, Anbang Zhai, et al. Ros-llm: A ros framework for embodied ai with task feedback and structured reasoning. arXiv preprint arXiv:2406.19741, 2024.
  31. [Potteiger and Koutsoukos, 2023] Nicholas Potteiger and Xenofon Koutsoukos. Safe explainable agents for autonomous navigation using evolving behavior trees. In 2023 IEEE International Conference on Assured Autonomy (ICAA), Jun 2023.
  32. [Rovida et al., 2017] Francesco Rovida, Bjarne Grossmann, and Volker Krüger. Extended behavior trees for quick def- inition of flexible robotic tasks. In 2017 IEEE/RSJ In- ternational Conference on Intelligent Robots and Systems (IROS), pages 6793-6800. IEEE, 2017.
  33. [Silver et al., 2024] Tom Silver, Soham Dan, Kavitha Srini- vas, Joshua B Tenenbaum, Leslie Kaelbling, and Michael Katz. Generalized planning in pddl domains with pre- trained large language models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 20256-20264, 2024.
  34. [Vemprala et al., 2024] Sai H Vemprala, Rogerio Bonatti, Arthur Bucker, and Ashish Kapoor. Chatgpt for robotics: Design principles and model abilities. IEEE Access, 2024.
  35. [Wang et al., 2024] Jianan Wang, Bin Li, Xueying Wang, Fu Li, Yunlong Wu, Juan Chen, and Xiaodong Yi. Bes- imulator: A large language model powered text-based be- havior simulator. arXiv preprint arXiv:2409.15865, 2024.
  36. [Wei et al., 2022] Jason Wei, Xuezhi Wang, Dale Schuur- mans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems, 35:24824-24837, 2022.
  37. [Wen et al., 2024a] Shanghua Wen, Wendi Wu, Ning Li, Ji Wang, Shaowu Yang, Chi Ben, and Wenjing Yang. Auction-based behavior tree evolution for heterogeneous multi-agent systems. Applied Sciences, 14(17):7896, 2024.
  38. [Wen et al., 2024b] Yeming Wen, Pengcheng Yin, Kensen Shi, Henryk Michalewski, Swarat Chaudhuri, and Alex Polozov. Grounding data science code genera- tion with input-output specifications. arXiv preprint arXiv:2402.08073, 2024.
  39. [Yang et al., 2022] Shuo Yang, Xinjun Mao, Yao Lu, and Yong Xu. Towards a behavior tree-based robotic software architecture with adjoint observation schemes for robotic software development. Automated Software Engineering, 29(1):31, 2022.
  40. [Yang et al., 2024] An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Haoran Wei, et al. Qwen2. 5 technical report. arXiv preprint arXiv:2412.15115, 2024.
  41. [Zhou et al., 2024a] Haotian Zhou, Yunhan Lin, Longwu Yan, Jihong Zhu, and Huasong Min. Llm-bt: Performing robotic adaptive tasks based on large language models and behavior trees. arXiv preprint arXiv:2404.05134, 2024.
  42. [Zhou et al., 2024b] Zhehua Zhou, Jiayang Song, Kunpeng Yao, Zhan Shu, and Lei Ma. Isr-llm: Iterative self- refined large language model for long-horizon sequential task planning. In 2024 IEEE International Conference on Robotics and Automation (ICRA), pages 2081-2088. IEEE, 2024.
  43. [Zhou et al., 2024c] Ziyi Zhou, Mingchen Li, Huiqun Yu, Guisheng Fan, Penghui Yang, and Zijie Huang. Learn- ing to generate structured code summaries from hybrid code context. IEEE Transactions on Software Engineer- ing, 2024.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards