信息网络安全 ›› 2026, Vol. 26 ›› Issue (10): 1581-1594.doi: 10.3969/j.issn.1671-1122.2026.10.006

• 学术研究 • 上一篇    下一篇

面向LLM生成状态图的质量评估框架构建与实例研究

吴润方1, 杜晔1,2(), 唐宇1, 孔同3   

  1. 1 北京交通大学网络空间安全学院, 北京 100044
    2 北京交通大学唐山研究院, 唐山 063000
    3 国家工业信息安全发展研究中心, 北京 100040
  • 收稿日期:2026-03-02 出版日期:2026-10-10 发布日期:2026-11-06
  • 通讯作者: 杜晔 E-mail:ydu@bjtu.edu.cn
  • 作者简介:吴润方(1995—),女,山东,博士研究生,主要研究方向为软件模型检测、形式化验证|杜晔(1978—),男,黑龙江,教授,博士,主要研究方向为云安全、空天地一体化网络安全、网络防御、漏洞检测|唐宇(1998—),男,河北,博士研究生,主要研究方向为群智能优化算法、软件缺陷预测|孔同(1993—),男,山东,高级工程师,博士,主要研究方向为云安全、智能信息安全
  • 基金资助:
    中央引导地方科技发展资金(246Z0705G);中央高校基本科研业务费专项资金(2024JBZX018);北京市自然科学基金(L254063)

Construction and empirical study of a quality assessment framework for statecharts generated by LLM

Wu Runfang1, Du Ye1,2(), Tang Yu1, Kong Tong3   

  1. 1 School of Cyberspace Science and Technology, Beijing Jiaotong University, Beijing 100044, China
    2 Tangshan Research Institute of Beijing Jiaotong University, Tangshan 063000, China
    3 China Industrial Control Systems Cyber Emergency Response Team, Beijing 100040, China
  • Received:2026-03-02 Online:2026-10-10 Published:2026-11-06
  • Contact: Du Ye E-mail:ydu@bjtu.edu.cn

摘要:

现阶段传统需求建模依赖人工,效率低下且易出现语义鸿沟,大语言模型(LLM)生成统一建模语言模型的代码质量不稳定。为解决上述问题,文章结合结构化需求建模描述与状态图质量维度函数,提出一种面向LLM生成状态图的质量评估框架。结构化需求建模描述由系统概览、模式层次、状态定义、转移逻辑和安全约束5个核心组件组成,旨在将自然语言需求转换为供LLM生成状态图使用的结构化语义输入。状态图质量维度函数则构建涵盖可执行性、语法质量、语义质量及实用质量4个维度的状态图形式化评估体系。该框架突破了现有研究在行为模型质量评估中依赖单一指标、缺少系统化验证机制的局限,基于100份跨领域需求文档,采用GPT-4.0与DeepSeek-R1进行生成与评估实验。实验结果表明,GPT-4.0、DeepSeek-R1生成状态图的平均语义覆盖率分别为82%、91%,验证了LLM在需求驱动建模中的应用潜力,并揭示两个模型在质量指标上的差异与优势,为LLM生成模型的质量评估及实际场景中的模型选择与优化提供系统方法与参考。

关键词: LLM, 代码生成, 状态图, 统一建模语言模型

Abstract:

At present, traditional requirement modeling relies on manual efforts, is inefficient, and prone to semantic gaps, while the quality of unified modeling language model generation by large language model (LLM) remains unstable. To address these issues, this study proposed a quality assessment framework for LLM-generated statecharts by combining a structured requirements modeling description with a state-diagram quality dimension function. The structured requirements modeling description used five core components: system overview, pattern hierarchy, state definitions, transition logic, and safety constraints, aiming to convert natural language requirements into structured semantic inputs for LLM to generate state diagrams. State-diagram quality dimension function constructed a formalized evaluation system for statecharts across four dimensions, including executability, syntactic quality, semantic quality, and practical quality. This framework overcomes the limitations of existing research in behavioral model quality assessment, which relies on single metrics and lacks systematic verification mechanisms. Experimental evaluation is conducted using two large models, GPT-4.0 and DeepSeek-R1, on 100 cross-domain requirements documents. Results demonstrate that GPT-4.0 achieves an average semantic coverage of 82%, while DeepSeek-R1 reaches 91%, confirming the applicability of LLM in requirements-driven modeling. The analysis further reveals distinct strengths and characteristics of different models across various quality metrics. This study provides a systematic methodology for evaluating LLM-generated models and offers practical references for model selection and optimization in real-world applications.

Key words: LLM, code generation, statechart diagram, unified modeling language model

中图分类号: