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

  • 2023-03-08 20:08:53
  • Matthias Cosler, Christopher Hahn, Daniel Mendoza, Frederik Schmitt, Caroline Trippel
  • 2


A rigorous formalization of desired system requirements is indispensable whenperforming any verification task. This often limits the application ofverification techniques, as writing formal specifications is an error-prone andtime-consuming manual task. To facilitate this, we present nl2spec, a frameworkfor applying Large Language Models (LLMs) to derive formal specifications (intemporal logics) from unstructured natural language. In particular, weintroduce a new methodology to detect and resolve the inherent ambiguity ofsystem requirements in natural language: we utilize LLMs to map subformulas ofthe formalization back to the corresponding natural language fragments of theinput. Users iteratively add, delete, and edit these sub-translations to amenderroneous formalizations, which is easier than manually redrafting the entireformalization. The framework is agnostic to specific application domains andcan be extended to similar specification languages and new neural models. Weperform a user study to obtain a challenging dataset, which we use to runexperiments on the quality of translations. We provide an open-sourceimplementation, including a web-based frontend.


Quick Read (beta)

loading the full paper ...