arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.15898cs.SE
收藏

基于大语言模型从自然语言合同生成形式化规范:Symboleo 的早期实验

Towards the LLM-Based Generation of Formal Specifications from Natural-Language Contracts: Early Experiments with Symboleo

Mounira Nihad Zitouni, Amal Ahmed Anda, Sahil Rajpal, Daniel Amyot, John Mylopoulos

AI总结:

本文探索使用大语言模型从英文商业合同自动生成 Symboleo 形式化规范,通过 38 种提示组合实验发现该方法前景良好,但语法遵循和环境变量识别等问题仍需改进。

摘要:

在过去十年中,研究者提出了不同的领域特定语言(DSL),用于形式化地规定法律合同中陈述的需求,主要用于分析,也用于代码生成。Symboleo 是该领域中一种有前景的语言。然而,从自然语言合同编写形式化规范是一项复杂任务,尤其是对于缺乏形式语言专业知识、法律专家而言。本文报告了一项探索性实验,目标是通过大语言模型(LLM)从英文商业合同自动生成 Symboleo 规范。实验研究了 38 种提示组件组合(包含/不包含语法、语义解释、0 到 3 个示例以及情感提示),主要在 GPT-4o 上进行,也在较小程度上测试了另外 4 个 LLM。生成的规范根据 16 种错误类型进行人工评估,这些错误类型分为 3 个严重级别。所有 LLM 上的早期结果显示出有前景的成果(即使对于一种鲜为人知的 DSL),这可能会加速法律合同的规范化。然而,观察到的若干问题,特别是围绕语法/句法遵循和环境变量识别(49%),表明有许多潜在改进领域值得进一步研究。

英文摘要:

Over the past decade, different domain-specific languages (DSLs) were proposed to formally specify requirements stated in legal contracts, mainly for analysis but also for code generation. Symboleo is a promising language in that area. However, writing formal specifications from natural-language contracts is a complex task, especial for legal experts who do not have formal language expertise. This paper reports on an exploratory experiment targeting the automated generation of Symboleo specifications from business contracts in English using Large Language Models (LLMs). Combinations (38) of prompt components are investigated (with/without the grammar, semantics explanations, 0 to 3 examples, and emotional prompts), mainly on GPT-4o but also to a lesser extent on 4 other LLMs. The generated specifications are manually assessed against 16 error types grouped into 3 severity levels. Early results on all LLMs show promising outcomes (even for a little-known DSL) that will likely accelerate the specification of legal contracts. However, several observed issues, especially around grammar/syntax adherence and environment variable identification (49%), suggest many areas where potential improvements should be investigated.

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

↑