[Paper Review] NL2TL: Transforming Natural Languages to Temporal Logics using Large Language Models
This paper proposes NL2TL, a framework that leverages large language models (LLMs) to generate a diverse, cross-domain dataset of 28K lifted natural language (NL)-to-temporal logic (TL) pairs and fine-tunes a T5 model on this data for generalizable NL-to-TL translation. The approach achieves over 95% accuracy with less than 10% domain-specific data, significantly outperforming baseline sequence-to-sequence models and few-shot GPT-3 prompting across five varied domains.
Temporal Logic (TL) can be used to rigorously specify complex high-level specification for systems in many engineering applications. The translation between natural language (NL) and TL has been under-explored due to the lack of dataset and generalizable model across different application domains. In this paper, we propose an accurate and generalizable transformation framework of English instructions from NL to TL, exploring the use of Large Language Models (LLMs) at multiple stages. Our contributions are twofold. First, we develop a framework to create a dataset of NL-TL pairs combining LLMs and human annotation. We publish a dataset with 28K NL-TL pairs. Then, we finetune T5 models on the lifted versions (i.e., the specific Atomic Propositions (AP) are hidden) of the NL and TL. The enhanced generalizability originates from two aspects: 1) Usage of lifted NL-TL characterizes common logical structures, without constraints of specific domains. 2) Application of LLMs in dataset creation largely enhances corpus richness. We test the generalization of trained models on five varied domains. To achieve full NL-TL transformation, we either combine the lifted model with AP recognition task or do the further finetuning on each specific domain. During the further finetuning, our model achieves higher accuracy (>95%) using only <10% training data, compared with the baseline sequence to sequence (Seq2Seq) model.
Motivation & Objective
- To address the lack of generalizable, cross-domain datasets for natural language to temporal logic (TL) translation.
- To overcome the limitations of domain-specific, rule-based, or synthetic NL-TL data that hinder model generalization.
- To develop a generalizable NL-to-TL framework using LLMs for both data creation and model fine-tuning.
- To enable high-accuracy, data-efficient translation from natural language to temporal logic across diverse engineering domains.
- To demonstrate that pre-training on lifted NL-TL pairs enhances model generalization and reduces reliance on large-scale domain-specific annotations.
Proposed method
- Leverages GPT-3 to generate synthetic, diverse NL-TL pairs in a novel, multi-stage data creation pipeline with human-in-the-loop refinement.
- Constructs a dataset of 28K lifted NL-TL pairs by combining 15K LLM-generated pairs with 13K cleaned, previously collected pairs, where atomic propositions (APs) are abstracted away.
- Fine-tunes a T5 model on the lifted NL-TL pairs to learn generic logical structures independent of specific domains or APs.
- Applies two deployment strategies for full NL-to-TL translation: (1) combining the lifted model with an AP recognition module, or (2) further fine-tuning on domain-specific data.
- Uses ablation studies to validate the necessity of LLM-augmented data and the effectiveness of lifted pre-training.
- Employs rule-based checks to ensure syntactic correctness of generated TLs, including parentheses matching and operator validity.

Experimental results
Research questions
- RQ1Can LLM-augmented data creation significantly improve the diversity and richness of NL-TL datasets compared to purely synthetic or manually collected data?
- RQ2Does pre-training on lifted NL-TL pairs enhance model generalization across diverse domains compared to domain-specific fine-tuning alone?
- RQ3Can a T5 model fine-tuned on lifted NL-TL pairs achieve high accuracy (>95%) with minimal domain-specific data (<10%)?
- RQ4How does the performance of the proposed method compare to sequence-to-sequence baselines and few-shot GPT-3 prompting in cross-domain NL-to-TL translation?
- RQ5To what extent does the use of LLMs in data generation and model fine-tuning reduce the need for expert-annotated data?
Key findings
- The proposed framework achieves over 95% accuracy in NL-to-TL translation across five diverse domains, significantly outperforming baseline sequence-to-sequence models.
- The model reaches high accuracy with only 200 to 500 full NL-TL examples per domain, representing a one-order-of-magnitude reduction in data requirements compared to baseline methods.
- Pre-training on the 28K lifted NL-TL dataset enables strong zero-shot generalization, with ablation studies showing that purely using collected data without LLM-augmented examples fails to generalize across domains.
- The T5-large model with lifted pre-training outperforms both T5-base and baseline Seq2Seq models, demonstrating the benefit of architectural scale and pre-training on abstracted logical structures.
- GPT-4-generated data yields more accurate and human-like NL and STL pairs than GPT-3, suggesting future improvements with newer LLMs.
- The framework’s ablation study confirms that LLM-augmented data is indispensable for cross-domain performance, as models trained only on existing datasets fail to generalize.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.