arXiv:2507.19909cs.SEcs.AI2025-07中稿 · publication in the…被引 6

用高效微调提升大模型修复代码能力,避免过拟合

The Impact of Fine-tuning Large Language Models on Automated Program Repair

  • 采用参数高效微调(LoRA/IA3)限制可训练参数量
  • 全量微调反而降低多个代码修复基准表现
  • 适合想低成本优化代码生成模型的研究者

自动化程序修复(APR)利用多种工具和技术帮助开发者更快实现功能正确、无错误的代码。近年来,大型语言模型(LLMs)因其性能和灵活性,被广泛引入到APR工具链中。然而,训练这些模型需要大量资源。微调技术被用于将预训练的LLMs适配到特定任务(如APR),以远低于从头训练的成本提升性能。本研究系统评估了不同微调方法对代码类LLMs在APR任务中的影响。实验覆盖三种主流APR基准(QuixBugs、Defects4J、HumanEval-Java),测试六种不同参数规模的模型(CodeGen、CodeT5、StarCoder、DeepSeekCoder、Bloom、CodeLlama-2)。比较了三种训练策略:无微调、全量微调、参数高效微调(PEFT)中的LoRA与IA3。结果表明,全量微调因数据分布差异和过拟合导致多模型性能下降;而参数高效微调通过控制可训练参数量,取得更优效果。

原文摘要 · Abstract (English)

Automated Program Repair (APR) uses various tools and techniques to help developers achieve functional and error-free code faster. In recent years, Large Language Models (LLMs) have gained popularity as components in APR tool chains because of their performance and flexibility. However, training such models requires a significant amount of resources. Fine-tuning techniques have been developed to adapt pre-trained LLMs to specific tasks, such as APR, and enhance their performance at far lower computational costs than training from scratch. In this study, we empirically investigate the impact of various fine-tuning techniques on the performance of LLMs used for APR. Our experiments provide insights into the performance of a selection of state-of-the-art LLMs pre-trained on code. The evaluation is done on three popular APR benchmarks (i.e., QuixBugs, Defects4J and HumanEval-Java) and considers six different LLMs with varying parameter sizes (resp. CodeGen, CodeT5, StarCoder, DeepSeekCoder, Bloom, and CodeLlama-2). We consider three training regimens: no fine-tuning, full fine-tuning, and parameter-efficient fine-tuning (PEFT) using LoRA and IA3. We observe that full fine-tuning techniques decrease the benchmarking performance of various models due to different data distributions and overfitting. By using parameter-efficient fine-tuning methods, we restrict models in the amount of trainable parameters and achieve better results. Keywords: large language models, automated program repair, parameter-efficient fine-tuning, AI4Code, AI4SE, ML4SE.

代码生成微调方法LLM应用AI4SE

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。