Skip to main navigation Skip to search Skip to main content

面向功能安全软件需求提取的模型驱动提示词 生成与优化方法

Translated title of the contribution: Model-Driven Prompt Generation and Optimization Method for Functional Safety Software Requirements Extraction
  • Zhi Jun Shao
  • , Ji Wu*
  • , Hong Yu Cao
  • , Yan Wci Wang
  • , Qing Sun
  • , Hai Yan Yang
  • , Yan Hua Gao
  • , Jian Xu
  • *Corresponding author for this work
  • Beihang University
  • Beijing Institute of Control and Electronic Technology

Research output: Contribution to journalArticlepeer-review

Abstract

Functional safety requirements extraction is a crucial and foundational step in the development lifecycle of safety-critical software systems, directly influencing the functional safety and overall reliability of such systems. Functional safety requirements serve as the cornerstone for designing, implementing, and verifying software components that must operate safely under all conditions, especially in domains where failures can lead to catastrophic consequences, such as automotive, aerospace, and medical devices. Traditionally, the extraction of safety requirements has been a labor-intensive, manual process carried out collaboratively by system engineers and software engineers. This approach heavily depends on the engineers' domain-specific knowledge and accumulated experience, making it not only time-consuming but also prone to the risk of o-missions, which can undermine the quality of the final requirements. Given these challenges, reducing the risk of omissions and enhancing the efficiency and comprehensiveness of the safety requirement extraction process have become pressing and significant research topics. In recent years, Large Language Models (LLMs) have demonstrated strong capabilities in natural language understanding and generation, suggesting new opportunities for automating safety requirements extraction. However, leveraging LLMs effectively in this context requires addressing the challenge of adequately infusing them with domain-specific knowledge and practical experience, especially given the nuanced and complex nature of safety requirements. To address these issues, this paper proposes a novel, model-driven approach for the generation and optimization of prompts for LLMs, specifically tailored to the extraction of functional safety requirements. By metamodcling the domain knowledge necessary for safety requirements extraction, this method established prompt frameworks to guide the construction of prompt, and uses LLMs to extract the safety requirement features of natural language text with automatically generated zero-shot prompts. Based on the extracted safety requirements features, this method identifies similar cases from historical safety requirements extraction results to generate few-shot prompts, which guides LLMs to combine domain knowledge and historical experience for safety requirements extraction. This paper conducts a comprehensive evaluation of the safety requirements extraction performance of the proposed method in comparison with existing requirements extraction methods and mainstream Retrieval Augmented Generation (RAG) methods on three cases from safety-critical domain requirements practice, and explores the impacts of the underlying LLM, the number of examples included in the few-shot prompt, the example selection strategy, the application scenarios on the performance of the proposed method. This paper also conducts ablation experiments to investigate the impact of method design on performance of the proposed method, and further conducts a case study to explore the practice effectiveness of the method. The results show that the proposed method can effectively provide domain knowledge and experience to LLMs, thus obtaining better safety requirements extraction results, with Fl-score enhancements of up to 25. 75% on the three selected Chinese LLMs compared to the existing LLM-based requirements extraction method. When compared with TF-IDF and semantic similarity-based RAG methods, the proposed method has better results in extracting system functionality and software safety information, with Fl-scorc enhancements of up to 5. 18% and 6. 14%, respectively. These results demonstrate that our approach can effectively bridge the gap between domain knowledge and LLM capabilities, offering a promising direction for automating and improving safety requirement engineering in safety-critical software domains.

Translated title of the contributionModel-Driven Prompt Generation and Optimization Method for Functional Safety Software Requirements Extraction
Original languageChinese (Traditional)
Pages (from-to)2752-2778
Number of pages27
JournalJisuanji Xuebao/Chinese Journal of Computers
Volume48
Issue number11
DOIs
StatePublished - Nov 2025

Fingerprint

Dive into the research topics of 'Model-Driven Prompt Generation and Optimization Method for Functional Safety Software Requirements Extraction'. Together they form a unique fingerprint.

Cite this