We study the ability of language models to translate natural language into formal specifications with complex semantics. In particular, we fine-tune off-the-shelf language models on three datasets consisting of structured English sentences and their corresponding formal representation: 1) First-order logic (FOL), commonly used in software verification and theorem proving; 2) linear-time temporal logic (LTL), which forms the basis for industrial hardware specification languages; and 3) regular expressions (regex), frequently used in programming and search. Our experiments show that, in these diverse domains, the language models achieve competitive performance to the respective state-of-the-art with the benefits of being easy to access, cheap to fine-tune, and without a particular need for domain-specific reasoning. Additionally, we show that the language models have a unique selling point: they benefit from their generalization capabilities from pre-trained knowledge on natural language, e.g., to generalize to unseen variable names.
翻译:我们研究语言模型将自然语言转化为具有复杂语义的正式规格的能力,特别是,我们根据三个数据集,包括结构化英语句子及其相应的正式表述,对三个数据集的现成语言模型进行微调:1)软件核查和理论验证中常用的第一阶逻辑(FOL);2)构成工业硬件规格语言基础的线性时间时间逻辑(LTL);3)经常用于编程和搜索的常规表达式(regex)。我们的实验表明,在这些不同领域,语言模型取得了对各自最新技术的竞争性性能,其好处是容易获得、廉价的微调,而且不需要特定领域的理由。此外,我们表明语言模型有一个独特的销售点:它们从经过预先训练的自然语言知识(例如,将通俗化为看不见的变异名称)中得益于其通用能力。