arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2206.01962cs.SEcs.LGcs.PL
收藏

基于自然语言的形式化规约

Formal Specifications from Natural Language

Stanford University(斯坦福大学);CISPA Helmholtz Center for Information Security(CISPA亥姆霍兹信息安全中心);Saarland University(萨尔兰大学)

Christopher Hahn, Frederik Schmitt, Julia J. Tillman, Niklas Metzger, Julian Siber, Bernd Finkbeiner

摘要:

研究了将自然语言转换为具有复杂语义的形式化规范时语言模型的泛化能力。特别是,我们在三个由英语句子及其相应的形式表示组成的数据集上微调语言模型:1)正则表达式(regex),常用于编程和搜索; 2)一阶逻辑(FOL),常用于软件验证和定理证明; 3)线性时间时态逻辑(LTL),它构成了工业硬件规约语言的基础。我们的实验表明,在这些不同的领域,语言模型保持其泛化能力,从自然语言的预训练知识到泛化,例如,新变量名或运算符描述。此外,它们实现了具有竞争力的性能,甚至在转换为正则表达式方面优于最先进的技术,其优点是易于访问,有效地进行微调,并且不需要特定于域的推理。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑