构建代码生成评估框架,避免训练数据污染。
SnipGen: A Mining Repository Framework for Evaluating LLMs for Code
- 通过提示工程从GitHub提交中挖掘代码片段,生成测试数据。
- 共提取22.7万条数据点,覆盖33.8万次近期代码变更。
- 提供可组合的提示模板,适合研究者评估大模型代码能力。
基于变换器的大型语言模型(如训练参数达数十亿的神经网络)在软件工程领域日益普及。这些模型在包含代码仓库的海量数据上训练,展现出卓越的代码生成能力。然而,其有效性评估面临挑战,主要源于训练与评估数据集之间可能存在重叠。为此,本文提出SnipGen——一个全面的代码仓库挖掘框架,利用提示工程支持多种下游代码生成任务。该框架旨在通过生成稳健的测试基准和定制化数据点,缓解数据污染问题。在探索性研究中,SnipGen从338,000个近期的GitHub提交中挖掘出约227,000条方法级粒度的数据点。其核心特征是包含一组可组合的提示模板,能形成类思维链的提示序列,实现对大模型代码生成质量的精细化评估。通过提供工具、方法与数据集,SnipGen为研究人员和实践者提供了严谨评估大模型在软件工程中表现的能力。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。