arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2405.12450cs.SEcs.AI
收藏

PathOCL:基于路径的提示增强方法用于GPT-4生成OCL

PathOCL: Path-Based Prompt Augmentation for OCL Generation with GPT-4

Polytechnique Montréal(蒙特利尔理工学院);Software and Emerging Technologies Lab (SAET)(软件与新兴技术实验室(SAET));SoftWare Analytics and Technologies Lab (SWAT)(软件分析与技术实验室(SWAT))

Seif Abukhalaf, Mohammad Hamdaqa, Foutse Khomh

AI总结:

本文提出PathOCL,一种基于路径的分块提示增强方法,通过仅选择与规范相关的UML类子集,在GPT-4上生成更多有效OCL约束并显著减小提示规模。

摘要:

以GitHub Copilot为代表的AI编程助手快速发展,推动了软件应用开发。这些助手依赖大语言模型(LLMs),即支持语言理解与生成等多种任务的基础模型(FMs)。LLMs已展现出使用对象约束语言(OCL)等形式化语言表达UML模型规范的能力。然而,提示的上下文大小受限于LLM可处理的token数量。随着UML类模型规模增大,这一限制变得尤为突出。在本研究中,我们提出PathOCL,一种新颖的基于路径的提示增强技术,旨在促进OCL生成。PathOCL针对LLM的局限性,特别是其token处理限制以及大型UML类模型带来的挑战。PathOCL基于分块(chunking)概念,有选择地利用与英文规范相关的UML类子集来增强提示。我们的研究结果表明,与增强完整UML类模型(UML-Augmentation)相比,PathOCL在使用GPT-4模型时能够生成更多有效且正确的OCL约束。此外,在扩大UML类模型规模时,使用PathOCL构造的平均提示大小显著降低。

英文摘要:

The rapid progress of AI-powered programming assistants, such as GitHub Copilot, has facilitated the development of software applications. These assistants rely on large language models (LLMs), which are foundation models (FMs) that support a wide range of tasks related to understanding and generating language. LLMs have demonstrated their ability to express UML model specifications using formal languages like the Object Constraint Language (OCL). However, the context size of the prompt is limited by the number of tokens an LLM can process. This limitation becomes significant as the size of UML class models increases. In this study, we introduce PathOCL, a novel path-based prompt augmentation technique designed to facilitate OCL generation. PathOCL addresses the limitations of LLMs, specifically their token processing limit and the challenges posed by large UML class models. PathOCL is based on the concept of chunking, which selectively augments the prompts with a subset of UML classes relevant to the English specification. Our findings demonstrate that PathOCL, compared to augmenting the complete UML class model (UML-Augmentation), generates a higher number of valid and correct OCL constraints using the GPT-4 model. Moreover, the average prompt size crafted using PathOCL significantly decreases when scaling the size of the UML class models.

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

↑