一句话:提出 AdaptEval,首个评估大语言模型代码片段适配能力的基准,含真实上下文、多粒度标注与细粒度测试。
针对代码复用中的代码片段适配缺乏 LLM 评估基准这一问题,本文提出 AdaptEval。该基准从开发者实践中构建任务,保留 Stack Overflow 与 GitHub 的丰富上下文;对每个任务在任务级和适配级标注需求,以覆盖多样适配场景;并采用适配级与函数级两层测试实现细粒度评估。基于 AdaptEval,作者首次实证评估六个指令微调 LLM 和三个推理 LLM。结果表明,AdaptEval 能从多角度评测 LLM 的适配能力,并揭示其当前局限,尤其是难以遵循显式指令。
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.
DOI 原文 ·
@inproceedings{paperbot9280,
title = {AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptation},
author = {Tanghaoran Zhang and Xinjun Mao and Shangwen Wang and Yuxin Zhao and Yao Lu and Jin Zhang and Zhang Zhang and Kang Yang and Yue Yu},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00103}
}