Large language models (LLMs) have achieved remarkable progress in code generation, largely driven by the availability of high-quality code datasets for effective training. To further improve data quality, numerous training data optimization techniques have been proposed; however, their overall effectiveness has not been systematically evaluated. To bridge this gap, we conduct the first large-scale empirical study, examining five widely-used training data optimization techniques and their pairwise combinations for LLM-based code generation across three benchmarks and four LLMs. Our results show that data synthesis is the most effective technique for improving functional correctness and reducing code smells, although it performs relatively worse on code maintainability compared to data refactoring, cleaning, and selection. Regarding combinations, we find that most combinations do not further improve functional correctness but can effectively enhance code quality (code smells and maintainability). Among all combinations, data synthesis combined with data refactoring achieves the strongest overall performance. Furthermore, our fine-grained analysis reinforces these findings and provides deeper insights into how individual techniques and their combinations influence code generation effectiveness. Overall, this work represents a first step toward a systematic understanding of training data optimization and combination strategies, offering practical guidance for future research and deployment in LLM-based code generation.


翻译:大语言模型(LLMs)在代码生成领域取得了显著进展,这主要得益于高质量代码数据集的有效训练。为进一步提升数据质量,研究者提出了多种训练数据优化技术,但其整体有效性尚未得到系统评估。为填补这一空白,我们开展了首次大规模实证研究,在三个基准测试和四种大语言模型上,考察了五种广泛使用的训练数据优化技术及其两两组合在基于LLM的代码生成中的效果。实验结果表明:数据合成是提升功能正确性和减少代码异味最有效的技术,但在代码可维护性方面表现相对弱于数据重构、数据清洗和数据选择。关于技术组合,我们发现大多数组合虽不能进一步提升功能正确性,但能有效改善代码质量(代码异味和可维护性)。在所有组合中,数据合成与数据重构的组合实现了最强的综合性能。此外,我们的细粒度分析进一步验证了上述发现,并深入揭示了单项技术及其组合如何影响代码生成效果。总体而言,本研究为系统理解训练数据优化与组合策略迈出了第一步,为基于大语言模型的代码生成的未来研究与部署提供了实践指导。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
LLM4SR:关于大规模语言模型在科学研究中的应用综述
专知会员服务
42+阅读 · 2025年1月9日
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员