NL2CTL: Automatic Generation of Formal Requirements Specifications via Large Language Models

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

3 Scopus citations

Abstract

Reducing the gap between natural language requirements and precise formal specifications is a critical task in requirements engineering. In recent years, requirement engineering is becoming increasingly complex alongside the growing intricacy of system engineering. Most requirements are expressed in natural language, which can be incomplete and ambiguous. However, formal languages with strict semantics can accurately represent certain temporal logic properties and allow for automated verification and analysis. This often limits the application of verification techniques, as writing formal specifications is a manual, error-prone, and time-consuming task. To address this, this paper proposes a framework that leverages Large Language Models (LLMs) to achieve automated conversion of natural language requirements to Computation Tree Logic (CTL). To address the issue of dataset scarcity, we leveraged the interactive and generative capabilities of LLMs. By constructing a random generation algorithm and utilizing prompt engineering, we generated an NL-CTL dataset using LLMs. The generated dataset was then used to fine-tune the T5-Large model, enhancing its generative capacity. To improve generalization, this paper proposes the use of the GPT-3.5 Atomic Proposition (AP) Recognition method, which eliminates the constraints of using the framework across different domains. A series of experimental evaluations showed that the fine-tuned LLM achieved an accuracy of 46.4%, whereas the LLM with few-shot learning using only prompt engineering achieved only 2% accuracy, demonstrating the feasibility of this approach.

Original languageEnglish
Title of host publicationFormal Methods and Software Engineering - 25th International Conference on Formal Engineering Methods, ICFEM 2024, Proceedings
EditorsKazuhiro Ogata, Dominique Mery, Meng Sun, Shaoying Liu
PublisherSpringer Science and Business Media Deutschland GmbH
Pages1-17
Number of pages17
ISBN (Print)9789819606160
DOIs
StatePublished - 2024
Event25th International Conference on Formal Engineering Methods, ICFEM 2024 - Hiroshima, Japan
Duration: 2 Dec 20246 Dec 2024

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume15394 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Conference

Conference25th International Conference on Formal Engineering Methods, ICFEM 2024
Country/TerritoryJapan
CityHiroshima
Period2/12/246/12/24

Keywords

  • Computation Tree Logic (CTL)
  • Large Language Models (LLM)
  • Requirements Engineering (RE)
  • Specification Generation

Fingerprint

Dive into the research topics of 'NL2CTL: Automatic Generation of Formal Requirements Specifications via Large Language Models'. Together they form a unique fingerprint.

Cite this