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

AdaptEval: 一个用于评估大型语言模型在代码片段适应上的基准

AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptation

College of Computer Science and Technology(计算机科学与技术学院);National University of Defense and Technology(国防科技大学)

Tanghaoran Zhang, Xinjun Mao, Shangwen Wang, Yuxin Zhao, Yao Lu, Jin Zhang, Zhang Zhang, Kang Yang, Yue Yu

AI总结:

AdaptEval是一个用于评估大型语言模型在代码片段适应能力的基准,通过多粒度标注和细粒度测试框架,首次实证研究了六种LLMs在代码适应任务上的表现。

摘要:

近年来,大型语言模型(LLMs)的进步已经自动化了各种软件工程任务,基准测试的出现是为了评估其能力。然而,在适应方面,一个关键的活动是代码重用,但目前没有基准测试来评估LLMs的性能,这使得它们在这一领域的实际效用仍然不清楚。为了填补这一空白,我们提出了AdaptEval,一个用于评估LLMs在代码片段适应上的基准。与现有基准不同,AdaptEval具有以下三个独特的特征:首先,实用上下文。AdaptEval中的任务来源于开发者的实践,保留了来自Stack Overflow和GitHub社区的丰富上下文信息。其次,多粒度标注。每个任务在任务和适应层面都进行了标注,支持对LLMs在不同适应场景中的评估。第三,细粒度评估。AdaptEval包括一个两层测试框架,结合适应层面和功能层面的测试,这使得能够评估LLMs在各种个别适应中的表现。基于AdaptEval,我们进行了首次实证研究,评估了六个指令调优的LLMs,尤其是三个推理LLMs在代码片段适应上的表现。实验结果表明,AdaptEval能够从多个角度评估LLMs的适应能力。它还提供了关于其当前限制的重要见解,特别是它们在遵循明确指示方面的挣扎。我们希望AdaptEval能够促进进一步的研究和改进LLMs在代码片段适应中的能力,支持其在现实世界中的应用。

英文摘要:

Recent advancements in large language models (LLMs) have automated various software engineering tasks, with benchmarks emerging to evaluate their capabilities. However, for adaptation, a critical activity during code reuse, there is no benchmark to assess LLMs' performance, leaving their practical utility in this area unclear. To fill this gap, we propose AdaptEval, a benchmark designed to evaluate LLMs on code snippet adaptation. Unlike existing benchmarks, AdaptEval incorporates the following three distinctive features: First, Practical Context. Tasks in AdaptEval are derived from developers' practices, preserving rich contextual information from Stack Overflow and GitHub communities. Second, Multi-granularity Annotation. Each task is annotated with requirements at both task and adaptation levels, supporting the evaluation of LLMs across diverse adaptation scenarios. Third, Fine-grained Evaluation. AdaptEval includes a two-tier testing framework combining adaptation-level and function-level tests, which enables evaluating LLMs' performance across various individual adaptations. Based on AdaptEval, we conduct the first empirical study to evaluate six instruction-tuned LLMs and especially three reasoning LLMs on code snippet adaptation. Experimental results demonstrate that AdaptEval enables the assessment of LLMs' adaptation capabilities from various perspectives. It also provides critical insights into their current limitations, particularly their struggle to follow explicit instructions. We hope AdaptEval can facilitate further investigation and enhancement of LLMs' capabilities in code snippet adaptation, supporting their real-world applications.

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

↑