跳到主要导航 跳到搜索 跳到主要内容

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

  • Yilongfei Xu
  • , Jincao Feng
  • , Weikai Miao*
  • *此作品的通讯作者
  • East China Normal University

科研成果: 书/报告/会议事项章节会议稿件同行评审

摘要

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.

源语言英语
主期刊名Proceedings - 2024 IEEE 24th International Conference on Software Quality, Reliability and Security, QRS 2024
出版商Institute of Electrical and Electronics Engineers Inc.
204-215
页数12
ISBN(电子版)9798350365634
DOI
出版状态已出版 - 2024
活动24th IEEE International Conference on Software Quality, Reliability and Security, QRS 2024 - Cambridge, 英国
期限: 1 7月 20245 7月 2024

丛书

姓名IEEE International Conference on Software Quality, Reliability and Security, QRS
ISSN(印刷版)2693-9177

会议

会议24th IEEE International Conference on Software Quality, Reliability and Security, QRS 2024
国家/地区英国
Cambridge
时期1/07/245/07/24

学术指纹

探究 'Learning from Failures: Translation of Natural Language Requirements into Linear Temporal Logic with Large Language Models' 的科研主题。它们共同构成独一无二的学术指纹。

引用此