Learning from Failures: Translation of Natural Language Requirements into Linear Temporal Logic with Large Language Models

被引:0
作者
Xu, Yilongfei [1 ]
Feng, Jincao [1 ]
Miao, Weikai [1 ]
机构
[1] East China Normal Univ, Shanghai, Peoples R China
来源
2024 IEEE 24TH INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY, QRS | 2024年
关键词
Requirements Engineering; Formal Specification; Large Language Models; Prompt Engineering; Natural Language Processing; AMBIGUITY;
D O I
10.1109/QRS62785.2024.00029
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Formalization of intended requirements is indispensable when using formal methods in software development. However, translating Natural Language (NL) requirements into formal specifications, such as Linear Temporal Logic (LTL), is error-prone. Although Large Language Models (LLMs) offer the potential for automatically translating unstructured NL requirements to LTL formulas, general-purpose LLMs face two major problems: First, low accuracy in translation. Second, high cost of model training and tuning. To tackle these challenges, we propose a new approach that combines dynamic prompt generation with human-computer interaction to leverage LLM for an accurate and efficient translation of unstructured NL requirements to LTL formulas. Our approach consists of two techniques: 1) Dynamic Prompt Generation, which automatically generates the most appropriate prompts for translating the inquired NL requirements. 2) Interactive Prompt Evolution, which helps LLMs to learn from previous translation errors, i.e., erroneous formalizations are amended by users and added as new prompt fragments. Our approach achieves remarkable performance in publicly available datasets from two distinct domains, comprising 36 and 255,000 NL-LTL pairs, respectively. Without human interaction, our method achieves up to 94.4% accuracy. When our approach is extended to another domain, the accuracy improves from an initial 27% to 78% under interactive prompt evolution.
引用
收藏
页码:204 / 215
页数:12
相关论文
共 63 条
[1]   Automated Extraction and Clustering of Requirements Glossary Terms [J].
Arora, Chetan ;
Sabetzadeh, Mehrdad ;
Briand, Lionel ;
Zimmer, Frank .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2017, 43 (10) :918-945
[2]  
Bano M, 2015, IEEE INT WORKS EMPIR, P21, DOI 10.1109/EmpiRE.2015.7431303
[3]  
Bird S., 2006, P COLING ACL 2006 IN, P69, DOI [10.48550/arXiv.cs/0205028, DOI 10.3115/1225403.1225421, 10.3115/1225403.1225421, DOI 10.48550/ARXIV.CS/0205028]
[4]  
Brayton R. K., 1996, Computer Aided Verification. 8th International Conference, CAV '96. Proceedings, P428
[5]  
Brown TB, 2020, ADV NEUR IN, V33
[6]  
Brunello A., 2019, 26 INT S TEMP REPR R
[7]  
Chung HW, 2022, Arxiv, DOI [arXiv:2210.11416, DOI 10.48550/ARXIV.2210.11416]
[8]  
Church Alonzo., 1963, Journal of Symbolic Logic, V28
[9]  
Cimatti A., 1999, Computer Aided Verification. 11th International Conference, CAV'99. Proceedings (Lecture Notes in Computer Science Vol.1633), P495
[10]  
Clarke E. M., 1997, Foundations of Software Technology and Theoretical Computer Science. 17th Conference. Proceedings, P54, DOI 10.1007/BFb0058022