MergeRepair:关于在代码大型语言模型中合并任务特定适配器以实现自动程序修复的探索性研究
MergeRepair: An Exploratory Study on Merging Task-Specific Adapters in Code LLMs for Automated Program Repair.
MergeRepair: An Exploratory Study on Merging Task-Specific Adapters in Code LLMs for Automated Program Repair.
大型语言模型(LLMs)在程序修复、文档编写、代码重构、调试和测试等多项软件开发相关任务中展现出强大的能力。然而,训练这些模型需要海量数据和大量计算资源。适配器(Adapters)是一种专门设计的小型模块,用于对LLMs进行参数高效微调,以适配特定任务、领域或应用,而无需对整个模型进行大规模重新训练。这些适配器提供了一种更高效的方式来定制LLMs以满足特定需求,充分利用大模型的已有能力。模型(及适配器)合并已成为一种开发能够处理多任务模型的技术,且仅需极少甚至无需额外训练。尽管模型与适配器合并在自然语言处理和计算机视觉等领域已展现出良好性能,但其在软件工程任务中的适用性仍未被充分探索。本文通过我们的方法,研究了合并适配器在软件工程背景下的有效性,特别聚焦于自动程序修复(APR)任务。具体而言,我们采用三种不同的合并方法——权重平均、TIES-Merging和DARE-TIES——对多个任务特定适配器进行合并,并评估合并后适配器在APR任务上的性能。我们提出了一种新方法,即顺序合并任务特定适配器,其中合并适配器的顺序和权重起着重要作用。我们进一步将该方法与基线方法进行比较,基线方法采用等权重合并应用于不同适配器的参数,即所有适配器具有同等重要性。通过持续合并,我们探索了合并适配器的能力以及任务顺序的影响,这与真实软件项目中的情形类似。为评估我们的方法,我们选取两个LLM——StarCoder2和Granite模型,在APR基准HumanEvalFix上进行实验,采用多种合并适配器组合,这些适配器在CommitPackFT数据集的子集上训练,该子集包含四个任务以及Python语言的APR任务。结果表明,合并任务特定适配器能够提升模型在APR任务上的性能。具体而言,当在StarCoder2模型上将APR适配器与Improvement和Misc任务适配器合并时,我们的方法在pass@1分数上相较APR任务最高提升2.38%。在相同模型和合并适配器下,pass@10分数提升至4.01%。这一提升可能更多地受基础模型和所合并的特定任务适配器的影响,而不仅仅是适配器数量。所提出的持续合并方法在合并顺序被高效确定时是有效的。结果表明,在持续合并过程中将最有效的任务适配器最后加入时,性能有所提升。此外,当合并模型中不使用APR适配器时,我们仍可达到相当甚至更好的性能,这强调了该方法的泛化能力。这些发现表明,通过适配器合并利用其他代码相关任务的知识,即使数据有限,也能提升新任务(如APR)的性能。
Large Language Models (LLMs) have shown high capabilities in several software development-related tasks such as program repair, documentation, code refactoring, debugging, and testing. However, training these models requires massive amount of data and significant computational resources. Adapters are specialized, small modules designed for parameter efficient fine-tuning of LLMs for specific tasks, domains, or applications without requiring extensive retraining of the entire model. These adapters offer a more efficient way to customize LLMs for particular needs, leveraging the pre-existing capabilities of the large model. Model (and adapter) merging have emerged as a technique to develop one model capable of multiple tasks, with minimal or no training required. Although model and adapter merging has shown promising performance in domains such as natural language processing and computer vision, its applicability to software engineering tasks remains underexplored. In this paper, we investigate the effectiveness of merged adapters within the context of software engineering, with a particular focus on the Automated Program Repair (APR) task, through our approach, . In particular, we merge multiple task-specific adapters using three different merging methods, including weight-averaging, TIES-Merging, and DARE-TIES, and evaluate the performance of the merged adapter on the APR task. We introduce a approach, a novel method in which we sequentially merge the task-specific adapters where the order and weight of the merged adapters play a significant role. We further compare the performance of our approach with a baseline method consisting of equal-weight merging applied on parameters of different adapters, where all adapters are of equal importance. Through continual merging, we explore the capability of merged adapters and the effect of task order, as it occurs in real-world software projects. To evaluate our approach, we consider two LLMs, StarCoder2 and Granite models on an APR benchmark, HumanEvalFix, with various combinations of the merged adapters trained on a subset of the CommitPackFT dataset that contains four tasks and APR in Python. The results show that merging task-specific adapters can enhance the performance of models on the APR task, . In particular, our approach achieves up to 2.38% performance improvement over APR task in terms of pass@1 score when merging APR with Improvement and Misc task-adapters on top of the StarCoder2 model. Performance rises to 4.01% for pass@10 score with the same model and merged adapters. This improvement could be significantly influenced by the base model and the specific task adapters merged, rather than only the number of adapters. The proposed continual merging approach can be effective if the order of merging is efficiently determined. Results show that performance improves when the most effective task-adapter is added last in a continual merging process. Moreover, we can achieve on-par or even better performance when APR adapter is not used in the merged model, emphasizing the generalizeability of the approach. These findings suggest that leveraging knowledge from other code-related tasks through adapter merging can improve performance on new tasks like APR, even with limited data.
Meghdad Dehghan, Jie Jw Wu, Fatemeh H Fard, Ali Ouni. MergeRepair: An Exploratory Study on Merging Task-Specific Adapters in Code LLMs for Automated Program Repair.. Empirical software engineering. 2027; doi:10.1007/s10664-026-10943-y.
Meghdad Dehghan, Jie Jw Wu, Fatemeh H Fard, Ali Ouni (2027). MergeRepair: An Exploratory Study on Merging Task-Specific Adapters in Code LLMs for Automated Program Repair.. Empirical software engineering. https://doi.org/10.1007/s10664-026-10943-y
Meghdad Dehghan, Jie Jw Wu, Fatemeh H Fard, Ali Ouni. MergeRepair: An Exploratory Study on Merging Task-Specific Adapters in Code LLMs for Automated Program Repair.[J]. Empirical software engineering, 2027 doi:10.1007/s10664-026-10943-y.
翻译全文 · AI 文献问答 · PDF 原文下载 · 引用导出