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

大型代码模型在API建议中的系统评估:何时、哪个以及如何使用

A Systematic Evaluation of Large Code Models in API Suggestion: When, Which, and How

Chaozheng Wang, Shuzheng Gao, Cuiyun Gao, Wenxuan Wang, Chun Yong Chong, Shan Gao, Michael R. Lyu

AI总结:

本文系统评估了大型代码模型在API建议任务中的能力,构建了涵盖176个API的基准,并针对何时使用、哪个使用和如何使用三个场景进行了全面分析。

摘要:

API建议是现代软件开发中的一项关键任务,通过基于当前上下文预测和推荐第三方API来协助程序员。近期大型代码模型(LCMs)的进展在API建议任务中显示出潜力。然而,它们主要关注建议使用哪些API,忽略了程序员在实践中可能需要更多帮助,包括何时使用建议的API以及如何使用这些API。为了弥补这一差距,本文对LCMs在API建议任务中进行了系统评估。为便于研究,我们首先构建了一个包含多样化代码片段集合的基准,涵盖了853个流行Java项目中使用的176个API。随后考虑了API建议任务中的三个不同场景进行评估,包括:(1)“何时使用”,旨在确定API使用的期望位置和时机;(2)“哪个使用”,旨在从给定库中识别合适的API;(3)“如何使用”,旨在预测给定API的参数。这三个场景的考虑允许全面评估LCMs在向开发者建议API方面的能力。在评估过程中,我们选择了九个不同模型大小的流行LCMs用于这三个场景。我们还对上下文选择对模型性能的影响进行了深入分析...

英文摘要:

API suggestion is a critical task in modern software development, assisting programmers by predicting and recommending third-party APIs based on the current context. Recent advancements in large code models (LCMs) have shown promise in the API suggestion task. However, they mainly focus on suggesting which APIs to use, ignoring that programmers may demand more assistance while using APIs in practice including when to use the suggested APIs and how to use the APIs. To mitigate the gap, we conduct a systematic evaluation of LCMs for the API suggestion task in the paper. To facilitate our investigation, we first build a benchmark that contains a diverse collection of code snippets, covering 176 APIs used in 853 popular Java projects. Three distinct scenarios in the API suggestion task are then considered for evaluation, including (1) ``\textit{when to use}'', which aims at determining the desired position and timing for API usage; (2) ``\textit{which to use}'', which aims at identifying the appropriate API from a given library; and (3) ``\textit{how to use}'', which aims at predicting the arguments for a given API. The consideration of the three scenarios allows for a comprehensive assessment of LCMs' capabilities in suggesting APIs for developers. During the evaluation, we choose nine popular LCMs with varying model sizes for the three scenarios. We also perform an in-depth analysis of the influence of context selection on the model performance ...

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

↑