nl2spec: Interactively Translating Unstructured Natural Language to Temporal Logics with Large Language Models

Matthias Cosler, Christopher Hahn, Daniel Mendoza, Frederik Schmitt, Caroline Trippel
3/8/2023
cs.LOcs.AIcs.LG

No official code found. Best implementation: realChrisHahn2/nl2spec (64 stars, MIT, last commit 2024-02-13).

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 specific application domains and can be extended to similar specification languages and new neural models. We perform a user study to obtain a challenging dataset, which we use to run experiments on the quality of translations. We provide an open-source implementation, including a web-based frontend.

View on arXivView PDF

Code Implementations(1)

MIT

nl2spec: Interactively Translating Unstructured Natural Language to Temporal Logics with Large Language Models

6411CSS, HTMLMar 10, 20232 years agoMIT

Similar Papers

Cite this paper

@article{cosler2023nlspec,
  title  = {nl2spec: Interactively Translating Unstructured Natural Language to Temporal Logics with Large Language Models},
  author = {Matthias Cosler and Christopher Hahn and Daniel Mendoza and Frederik Schmitt and Caroline Trippel},
  year   = {2023},
  eprint = {2303.04864},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2303.04864v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2303.04864.svg)](https://codeofpaper.com/paper/2303.04864)

Discussion