LLM improves automatic conversions between FSM and behavior trees

Towards An LLM-Driven Unified Conversion Framework for BT and FSM in Autonomous Intelligent Systems

Artificial Intelligence

Summary

Autonomous systems like robots use ways to describe their actions, often as finite state machines (FSM) or behavior trees (BT). Both describe the same behaviors but converting between the two can be tricky and often leads to bigger, more complex models. The authors propose using large language models (LLMs) to automate and improve this conversion process, keeping the behavior complete and models simpler. Their method works well in simulations with robots and game agents, making it easier to build and maintain these systems.

What this means in practice

  • For robotics developers: Automatically convert behavior descriptions between FSM and BT to simplify autonomous robot programming and maintenance.
  • For game ai developers: Generate efficient and accurate behavior models for game characters by converting between FSM and BT formats automatically.

Authors

Zhang Qi, Yang Shuo, Zhu Zhengqiu, Zhou Peng, Jiao Peng

Abstract

Finite state machine (FSM) and behavior trees (BT) are widely adopted behavioral modeling paradigms for autonomous intelligent systems. While functionally equivalent and inter-convertible in principle, existing transformation methods between FSM and BT face major challenges in preserving behavioral completeness and avoiding model complexity explosion. To overcome these issues, we propose an LLM-driven unified conversion framework that enables automatic, efficient, and semantically consistent transformation between FSM and BT. Specifically, a novel loop execution BT structure is designed for LLM to accurately capture the loop structure in FSM, thereby preserving behavioral completeness. To mitigate the state explosion problem in BT-to-FSM conversion, a depth compression strategy is introduced with LLM prompt to eliminate redundant control nodes, complemented by differentiated hierarchical conversion rules that collectively reduce the number of required sub-FSM. Simulation experiments in multiple autonomous decision-making scenarios demonstrate that the proposed framework enables an accurate and automated bidirectional conversion between FSM and BT. Furthermore, it significantly enhances the scalability and maintainability of generated models compared to traditional approaches, providing a practical solution for behavior model conversion in consumer-grade autonomous intelligent systems such as service robots, game agents, and smart home devices