Skip to main content
QUICK REVIEW

[论文解读] NL2TL: Transforming Natural Languages to Temporal Logics using Large Language Models

Yongchao Chen, R. Gandhi|arXiv (Cornell University)|May 12, 2023
Natural Language Processing TechniquesComputer Science被引用 3
一句话总结

该论文提出NL2TL框架,利用大语言模型(LLMs)生成一个包含28K个提升后的自然语言(NL)到时序逻辑(TL)配对的多样化、跨领域数据集,并在该数据上微调T5模型,以实现可泛化的NL到TL翻译。该方法在仅使用不到10%领域特定数据的情况下,准确率超过95%,显著优于基线序列到序列模型和少样本GPT-3提示方法,在五个不同领域中表现优异。

ABSTRACT

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.

研究动机与目标

  • 为解决自然语言到时序逻辑(TL)翻译缺乏可泛化的跨领域数据集的问题。
  • 克服领域特定、基于规则或合成的NL-TL数据的局限性,这些数据阻碍了模型的泛化能力。
  • 利用LLMs实现数据创建和模型微调,构建一个可泛化的NL到TL框架。
  • 实现在多样化工程领域中,从自然语言到时序逻辑的高精度、数据高效翻译。
  • 证明在提升后的NL-TL对上进行预训练可增强模型泛化能力,并减少对大规模领域特定标注数据的依赖。

提出的方法

  • 利用GPT-3通过一种新颖的多阶段数据创建流水线,生成合成的、多样化的NL-TL配对,并结合人工干预进行优化。
  • 通过整合15K个LLM生成的配对与13K个清洗后的已有配对,构建一个包含28K个提升后的NL-TL配对的数据集,其中原子命题(APs)被抽象化。
  • 在提升后的NL-TL配对上微调T5模型,以学习独立于特定领域或APs的通用逻辑结构。
  • 采用两种部署策略实现完整的NL到TL翻译:(1) 将提升后的模型与AP识别模块结合,或 (2) 在领域特定数据上进一步微调。
  • 通过消融研究验证LLM增强数据的必要性以及提升后预训练的有效性。
  • 采用基于规则的检查确保生成的TL在句法上正确,包括括号匹配和操作符有效性。
Figure 1: Illustration of lifted NL and lifted STL.
Figure 1: Illustration of lifted NL and lifted STL.

实验结果

研究问题

  • RQ1与纯合成或人工收集的数据相比,LLM增强的数据创建是否能显著提升NL-TL数据集的多样性和丰富性?
  • RQ2与仅进行领域特定微调相比,在提升后的NL-TL对上进行预训练是否能增强模型在多样化领域中的泛化能力?
  • RQ3在仅使用少量领域特定数据(<10%)的情况下,微调后的T5模型能否在提升后的NL-TL对上实现超过95%的高准确率?
  • RQ4在跨领域NL到TL翻译中,该方法的性能与序列到序列基线模型和少样本GPT-3提示方法相比如何?
  • RQ5在数据生成和模型微调中使用LLMs,能在多大程度上减少对专家标注数据的需求?

主要发现

  • 所提出的框架在五个不同领域中的NL到TL翻译任务中准确率超过95%,显著优于基线序列到序列模型。
  • 该模型仅需每领域200至500个完整的NL-TL示例即可达到高准确率,与基线方法相比,数据需求量降低了一个数量级。
  • 在28K个提升后的NL-TL数据集上进行预训练,可实现强大的零样本泛化能力;消融研究显示,若仅使用未经过LLM增强的已有数据,模型无法在不同领域间泛化。
  • 在提升后数据上进行预训练的T5-large模型优于T5-base和基线Seq2Seq模型,证明了模型架构规模以及在抽象化逻辑结构上进行预训练的优势。
  • GPT-4生成的NL和STL配对比GPT-3更准确、更接近人类表达,表明未来使用更新的LLMs可进一步提升性能。
  • 框架的消融研究证实,LLM增强数据对跨领域性能至关重要,仅在现有数据集上训练的模型无法实现泛化。
Figure 2: Illustration of different formats of STL expressions. (a) Different expression formats of the same STL. (b) The binary tree representation of STL.
Figure 2: Illustration of different formats of STL expressions. (a) Different expression formats of the same STL. (b) The binary tree representation of STL.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。