arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.07046cs.SEcs.AIcs.LG
收藏

SnipGen:一个用于评估代码大语言模型的挖掘仓库框架

SnipGen: A Mining Repository Framework for Evaluating LLMs for Code

William & Mary(威廉与玛丽学院)

Daniel Rodriguez-Cardenas, Alejandro Velasco, Denys Poshyvanyk

AI总结:

针对代码 LLM 评估中的训练与评测数据重叠问题,本文提出 SnipGen 仓库挖掘框架,利用近期 GitHub 提交生成方法级数据点与可组合提示模板,支持严谨的代码生成评测。

摘要:

语言模型(LLM),例如基于 transformer、在数十亿参数上训练的神经网络,已在软件工程(SE)中变得日益普遍。这些模型在包含代码仓库的大规模数据集上进行训练,对软件工程任务展现出显著能力。然而,评估其有效性面临重大挑战,主要原因是训练所用数据集与评估所用数据集之间可能存在重叠。为解决这一问题,我们提出 SnipGen,这是一个综合性仓库挖掘框架,旨在跨多种代码生成下游任务利用提示工程。SnipGen 通过生成稳健的测试平台并构建定制化数据点来缓解数据污染,以帮助研究人员和从业者评估 LLM 在代码相关任务上的表现。在我们的探索性研究中,SnipGen 从 GitHub 提交中 338K 个近期代码变更里挖掘了约 227K 个数据点,重点关注方法级粒度。SnipGen 提供一组提示模板,这些模板可组合形成类似思维链(Chain-of-Thought)的提示序列,从而实现对 LLM 代码生成质量的细致评估。通过提供挖掘工具、方法论和数据集,SnipGen 使研究人员和从业者能够在软件工程场景中严格评估并解释 LLM 的性能。

英文摘要:

Language Models (LLMs), such as transformer-based neural networks trained on billions of parameters, have become increasingly prevalent in software engineering (SE). These models, trained on extensive datasets that include code repositories, exhibit remarkable capabilities for SE tasks. However, evaluating their effectiveness poses significant challenges, primarily due to the potential overlap between the datasets used for training and those employed for evaluation. To address this issue, we introduce SnipGen, a comprehensive repository mining framework designed to leverage prompt engineering across various downstream tasks for code generation. SnipGen aims to mitigate data contamination by generating robust testbeds and crafting tailored data points to assist researchers and practitioners in evaluating LLMs for code-related tasks. In our exploratory study, SnipGen mined approximately 227K data points from 338K recent code changes in GitHub commits, focusing on method-level granularity. SnipGen features a collection of prompt templates that can be combined to create a Chain-of-Thought-like sequence of prompts, enabling a nuanced assessment of LLMs' code generation quality. By providing the mining tool, the methodology, and the dataset, SnipGen empowers researchers and practitioners to rigorously evaluate and interpret LLMs' performance in software engineering contexts.

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

↑