arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.18107cs.SEcs.AI
收藏

面向双模态软件工程的上下文内代码-文本学习

In-Context Code-Text Learning for Bimodal Software Engineering

University of Luxembourg(卢森堡大学)

Xunzhu Tang, Liran Wang, Yonghui Liu, Linzheng Chai, Jian Yang, Zhoujun Li, Haoye Tian, Jacques Klein, Tegawende F. Bissyande

AI总结:

本文提出 InCTRL 流程,通过可配置提示模板将23个软件工程任务统一为代码-文本上下文内学习,显著提升 CodeLLAMA 的少样本与下游任务性能并开源模型、代码和数据集。

摘要:

随着大语言模型的出现,双模态软件分析最初似乎已触手可及。遗憾的是,软件工程中自然语言文本与代码之间复杂的相互作用带来了独特挑战,使预训练模型难以泛化到各种任务。我们假设,面向代码-文本双模态的上下文内学习是一条有前景的途径。因此,本文对上下文内代码-文本学习进行了全面研究,重点利用预训练 CodeLLAMA 模型。我们考虑了一个涵盖23个软件工程任务的多样化数据集,并将其转换为上下文内学习格式。为有效提取信息特征,我们提出一种可配置的提示模板。随后,我们提出的流程 InCTRL 统一了跨各种软件工程任务的提示学习。在研究数据集上的广泛评估表明,INCTRL 模型在少样本性能方面具有优势,超过了包括支撑模型 CodeLLAMA 在内的最先进模型。通常可以观察到,在应用于 CodeLLAMA 模型时,INCTRL 在各种任务上带来精确率(至少约12%)和召回率(最高达93.88%)的提升。例如,在程序修复任务上,INCTRL 将 CodeLLAMA 的 BLEU 分数提高85分;而在克隆检测方面,INCTRL 实现了69个百分点的提升。此外,在各个下游任务上使用检索增强生成时,INCTRL 模型可提供最先进性能。最后,我们定性分析了 INCTRL 相对于 CodeLLAMA 的优势,并开源所有模型以产生更广泛影响。我们的代码和数据集公开发布于:https://anonymous.4open.science/r/inctrl-B65B。

英文摘要:

Bimodal software analysis initially appeared to be within reach with the advent of large language models. Unfortunately, the complex interplay of natural language text and code in software engineering, presents unique challenges that prevent pretrained models to generalize to a variety of tasks. We postulate that in-context learning for the code-text bimodality is a promising avenue. This paper thus introduces a comprehensive study of in-context code-text learning, focusing on leveraging pretrained CodeLLAMA models. We consider a diverse dataset encompassing 23 software engineering tasks, which we transform in an in-context learning format. To effectively extract informative features, we propose a configurable prompt template. Our proposed pipeline, InCTRL, then unifies prompt learning across various software engineering tasks. Extensive evaluation on the study datasets demonstrates the superiority of INCTRL-models in few-shot performance, surpassing state-of-the-art models including the support model, CodeLLAMA. Typically, we observe that applied to the CodeLLAMA model, INCTRL brings improvements in terms of precision (at least about 12\%) and recall (up to 93.88\%) on various tasks. For example, on the task of program repair, INCTRL improves the BLEU score of CodeLLAMA by 85 points, while for clone detection, INCTRL achieves an improvement of 69 percentage points. Moreover, INCTRL-models offer state-of-the-art performance when using retrieval-augmented generation on individual downstream tasks. Finally, we qualitatively analyze the benefits of INCTRL over CodeLLAMA and open-source all models for broader impact. We make our code and dataset publicly available at: \begin{center} {\url{https://anonymous.4open.science/r/inctrl-B65B}} \end{center}

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

↑