arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.00275cs.SE
收藏

基于结构和事件的面向状态机建模的大型语言模型框架

Structure- and Event-Driven Frameworks for State Machine Modeling with Large Language Models

McGill University(麦吉尔大学)

Samer Abdulkarim, Evan Boyd, Karl Bridi, Alec Tufenkjian, Boqi Chen, Gunter Mussbacher

AI总结:

本文提出结合结构和事件驱动的框架,利用大型语言模型自动生成UML状态机,评估了不同模型在非结构化自然语言需求下的表现,发现混合方法能提升非推理模型性能,但无法进一步提升推理模型效果。

摘要:

UML状态机设计是软件工程中的关键过程。传统上,由经验丰富的工程师根据自然语言需求手动构建状态机,这一过程耗时且易出错。许多自动化方法存在,但需要结构化的自然语言需求。本文研究了当前大型语言模型(LLM)通过专门的状态机框架(SMF)从非结构化自然语言需求中完全自动化生成UML状态机的能力。我们评估了两种最先进的LLM:非推理LLM GPT-4o和推理导向LLM Claude 3.5 Sonnet,使用单步和多步提示方法。我们引入了一种新的混合方法,利用单提示基线输出作为初始状态机草案,然后通过SMF进行优化。在我们的研究中,基于人类方法开发了两种不同的SMF:(i)结构驱动的SMF,其中状态机组件(状态、转换、守卫、动作等)按顺序逐步生成;(ii)事件驱动的SMF,其中识别出的事件迭代引导状态机构建。我们的实验表明,尽管LLM在单提示基线(如Claude 3.5 Sonnet生成的状态F1得分为0.90,转换为0.75)方面表现出有希望的能力,但其性能尚未完全足够用于完全自动化的解决方案(如GPT-4o的守卫F1得分为0.23,动作为0.00)。我们提出的混合方法将非推理LLM(GPT-4o)的性能提升到与推理LLM(Claude 3.5 Sonnet)相当的水平,但无法进一步提升推理LLM。我们的评估突显了当前LLM在自动化状态机设计中的潜力和局限性,为未来该领域研究提供了基准。

英文摘要:

UML state machine design is a critical process in software engineering. Traditionally, state machines are manually crafted by experienced engineers based on natural language requirements-a time-consuming and error-prone procedure. Many automated approaches exist but they require structured NL requirements. In this paper, we investigate the capabilities of current Large Language Models to fully automate UML state machine generation via specialized State Machine Frameworks (SMFs) from non-structured NL requirements. We evaluate two types of state-of-the-art LLMs using single-step and multi-step prompting approaches: a non-reasoning LLM GPT-4o and a reasoning-focused LLM Claude 3.5 Sonnet, and introduce a novel Hybrid Approach that uses the output from a Single-Prompt Baseline as an initial draft state machine, which is then refined through an SMF. In our study, two distinct SMFs are developed based on human approaches: (i) a Structure-Driven SMF, in which state machine components (states, transitions, guards, actions, etc.) are generated in sequential steps, and (ii) an Event-Driven SMF, where identified events iteratively guide state machine construction. Our experiments indicate that while LLMs demonstrate a promising ability to generate state machine models from the Single-Prompt Baseline (e.g., F1-scores of 0.90 for states and 0.75 for transitions using Claude 3.5 Sonnet), their performance is not yet fully sufficient for a fully automated solution (e.g., F1-scores of 0.23 for guards and 0.00 for actions for GPT-4o). Our proposed Hybrid Approach improves the performance of the non-reasoning LLM (GPT-4o) to a similar level as the reasoning LLM (Claude 3.5 Sonnet) but does not further improve the reasoning LLM. Our evaluation highlights both the potential and the limitations of current LLMs for automated state machine design, providing a baseline for future research in this domain.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑