We study the generalization abilities of language models when translating natural language into formal specifications with complex semantics. In particular, we fine-tune language models on three datasets consisting of English sentences and their corresponding formal representation: 1) regular expressions (regex), frequently used in programming and search; 2) First-order logic (FOL), commonly used in software verification and theorem proving; and 3) linear-time temporal logic (LTL), which forms the basis for industrial hardware specification languages. Our experiments show that, in these diverse domains, the language models maintain their generalization capabilities from pre-trained knowledge of natural language to generalize, e.g., to new variable names or operator descriptions. Additionally, they achieve competitive performance, and even outperform the state-of-the-art for translating into regular expressions, with the benefits of being easy to access, efficient to fine-tune, and without a particular need for domain-specific reasoning.
翻译:我们研究语言模型在将自然语言转换成具有复杂语义的正式规格时的通用能力,特别是,我们微调三种数据集的通用语言模型,其中包括英文句子及其相应的正式表述:1)经常表达(regex),经常用于编程和搜索;2)通常用于软件核查和理论验证的第一阶逻辑(FOL);以及3)线性时间时间时间逻辑(LTL),它构成工业硬件规格语言的基础。我们的实验表明,在这些不同的领域,语言模型保持其从经过培训的自然语言知识中的一般化能力,以便普遍化,例如,将新的变异名称或操作者描述加以归纳。此外,它们取得了竞争性的性能,甚至超越了将常规表达转换为最先进的艺术,其好处是容易获得、高效调整和不需要特定领域推理。