nl2spec: Interactively Translating Unstructured Natural Language to Temporal Logics with Large Language Models
Matthias Cosler, Christopher Hahn, Daniel Mendoza, Frederik Schmitt,, Caroline Trippel

TL;DR
nl2spec leverages large language models to convert natural language system requirements into formal temporal logic specifications, enabling interactive refinement and reducing manual effort in formal verification tasks.
Contribution
This work introduces a novel LLM-based framework for translating unstructured natural language into formal temporal logic specifications with an interactive ambiguity resolution process.
Findings
Effective translation of natural language to temporal logic demonstrated.
User study shows improved accuracy with interactive refinement.
Open-source tool available for community use.
Abstract
A rigorous formalization of desired system requirements is indispensable when performing any verification task. This often limits the application of verification techniques, as writing formal specifications is an error-prone and time-consuming manual task. To facilitate this, we present nl2spec, a framework for applying Large Language Models (LLMs) to derive formal specifications (in temporal logics) from unstructured natural language. In particular, we introduce a new methodology to detect and resolve the inherent ambiguity of system requirements in natural language: we utilize LLMs to map subformulas of the formalization back to the corresponding natural language fragments of the input. Users iteratively add, delete, and edit these sub-translations to amend erroneous formalizations, which is easier than manually redrafting the entire formalization. The framework is agnostic to…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Software Reliability and Analysis Research
