欢迎访问《图学学报》

图学学报 ›› 2026, Vol. 47 ›› Issue (4): 863-873.DOI: 10.11996/JG.j.2095-302X.2026040863

• 数字化设计与制造 • 上一篇    下一篇

基于语法-语义双层提示策略的SysML2.0组成图与活动图智能生成方法

胡德睿1,2, 方哲梅1,2(), 罗云峰1,2   

  1. 1 华中科技大学人工智能与自动化学院湖北武汉 430074
    2 华中科技大学多谱信息处理技术全国重点实验室湖北 武汉 430074
  • 收稿日期:2025-12-05 接受日期:2026-05-14 出版日期:2026-08-31 发布日期:2026-08-31
  • 通讯作者:方哲梅,E-mail:zmfang2018@hust.edu.cn
  • 基金资助:
    国家自然科学基金(62103158);自动目标识别重点实验室(上海)联合基金资助项目(ATR(S)2025-001)

Intelligent generation method of SysML2.0 composition and activity diagrams based on semantic-syntactic dual-layer prompting strategy

HU Derui1,2, FANG Zhemei1,2(), LUO Yunfeng1,2   

  1. 1 School of Artificial Intelligence and Automation, Huazhong University of Science and Technology, Wuhan Hubei 430074, China
    2 National Key Laboratory of Science and Technology on Multispectral Information Processing, Huazhong University of Science and Technology, Wuhan Hubei 430074, China
  • Received:2025-12-05 Accepted:2026-05-14 Published:2026-08-31 Online:2026-08-31
  • Contact: FANG Zhemei,E-mail:zmfang2018@hust.edu.cn
  • Supported by:
    National Natural Science Foundation of China(62103158);Automated Target Recognition Key Laboratory (Shanghai) Joint Fund Supported Project(ATR(S)2025-001)

摘要:

针对复杂系统建模面临的模型构建复杂、SysML2.0语法学习成本高等问题,提出一种基于语法-语义双层提示策略的SysML2.0模型智能生成方法。在语义层,构建结构化语义提示模板,对系统组成、行为及关系进行规范化表达。在语法层,设计零样本、指令式和少样本三类提示策略,引导大模型生成符合SysML2.0语法规范的组成图与活动图模型代码。同时,建立模型复杂度与生成准确率评价指标,对不同提示策略、模型复杂度及大模型条件下的生成效果进行系统验证。结果表明少样本提示策略在不同复杂度和不同大模型条件下均表现出接近100%的生成准确率,显著优于零样本与指令式提示策略。虽然随着模型复杂度增加,各方法生成性能均有所下降,但少样本提示策略表现出更好的适应性与稳定性。可见基于少样本驱动的语法-语义分层提示机制能够缓解大模型在SysML2.0模型生成中的语义幻觉与结构错误问题,在无需大规模标注数据的条件下提升模型生成质量,为基于模型的系统工程从人工建模向智能建模转变提供了可行路径。

关键词: 提示词, 基于模型的系统工程, 系统建模语言2.0, 智能生成, 大语言模型

Abstract:

To address the challenges of complex system modeling, including the complexity of model construction and the high learning cost of SysML2.0 syntax, an intelligent SysML2.0 model generation method based on a syntax-semantic dual-layer prompting strategy was proposed. At the semantic layer, a structured semantic prompt template was constructed to standardize the representation of system compositions, behaviors, and relationships. At the syntactic layer, three prompting strategies, namely zero-shot prompting, instruction prompting, and few-shot prompting, were designed to guide Large Language Models (LLMs) in generating composition diagram and activity diagram model codes conforming to SysML2.0 syntax specifications. Meanwhile, model complexity and generation accuracy metrics were established to systematically evaluate the generation performance under different prompting strategies, model complexities, and LLM conditions. Experimental results showed that the few-shot prompting strategy achieved nearly 100% generation accuracy under different complexity levels and across different LLMs, significantly outperforming zero-shot and instruction prompting strategies. Although the generation performance of all methods decreased as model complexity increased, the few-shot prompting strategy demonstrated better adaptability and stability. The results indicated that the few-shot-driven syntax-semantic hierarchical prompting mechanism effectively alleviated semantic hallucinations and structural errors in SysML2.0 model generation by LLMs, thereby improving model generation quality without requiring large-scale annotated datasets. A feasible pathway was thus provided for the transformation of Model-Based Systems Engineering (MBSE) from manual modeling to intelligent modeling.

Key words: prompts, model-based systems engineering, SysML2.0, intelligent generation, large language model

中图分类号: