arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.02303cs.LGcs.AI
收藏

MFTCoder:通过多任务微调提升代码大语言模型性能

MFTCoder: Boosting Code LLMs with Multitask Fine-Tuning

Ant Group(蚂蚁集团)

Bingchang Liu, Chaoyu Chen, Cong Liao, Zi Gong, Huan Wang, Zhichao Lei, Ming Liang, Dajun Chen, Min Shen, Hailian Zhou, Hang Yu, Jianguo Li

AI总结:

针对代码大模型单任务微调资源消耗大、未利用任务关联性的问题,提出多任务微调框架MFTCoder,通过多损失函数解决多任务学习挑战,训练效率更高,适配主流开源大模型,在HumanEval基准上超越GPT-4零样本表现。

摘要:

代码大语言模型(Code LLMs)已成为一个专门的研究领域,大量研究致力于通过在预训练模型上进行微调来增强模型的编码能力。以往的微调方法通常针对特定下游任务或场景定制,这意味着每个任务都需要单独微调,不仅消耗大量训练资源,还在部署和维护方面带来挑战。此外,这些方法未能利用不同代码相关任务之间固有的关联性。\n为克服这些局限,我们提出了多任务微调框架MFTCoder,可在多个任务上同步并行微调。通过整合多种损失函数,我们有效解决了多任务学习中的常见挑战,比如数据不平衡、难度水平各异以及收敛速度不一致的问题。\n大量实验确凿证明,我们的多任务微调方法效果优于单任务单独微调以及混合任务集合微调。此外,MFTCoder具备高效训练能力,包括高效数据分词模式和PEFT(参数高效微调),与传统微调方法相比速度显著提升。MFTCoder可与多个主流开源大语言模型无缝集成,如CodeLLaMA和Qwen。基于CodeLLaMA基座,我们经MFTCoder微调的模型CodeFuse-CodeLLama-34B在HumanEval基准上取得了74.4%的出色pass@1分数,超过了GPT-4的零样本表现(67%)。MFTCoder已在https://github.com/codefuse-ai/MFTCOder开源。

英文摘要:

Code LLMs have emerged as a specialized research field, with remarkable studies dedicated to enhancing model's coding capabilities through fine-tuning on pre-trained models. Previous fine-tuning approaches were typically tailored to specific downstream tasks or scenarios, which meant separate fine-tuning for each task, requiring extensive training resources and posing challenges in terms of deployment and maintenance. Furthermore, these approaches failed to leverage the inherent interconnectedness among different code-related tasks. To overcome these limitations, we present a multi-task fine-tuning framework, MFTcoder, that enables simultaneous and parallel fine-tuning on multiple tasks. By incorporating various loss functions, we effectively address common challenges in multi-task learning, such as data imbalance, varying difficulty levels, and inconsistent convergence speeds. Extensive experiments have conclusively demonstrated that our multi-task fine-tuning approach outperforms both individual fine-tuning on single tasks and fine-tuning on a mixed ensemble of tasks. Moreover, MFTcoder offers efficient training capabilities, including efficient data tokenization modes and PEFT fine-tuning, resulting in significantly improved speed compared to traditional fine-tuning methods. MFTcoder seamlessly integrates with several mainstream open-source LLMs, such as CodeLLama and Qwen. Leveraging the CodeLLama foundation, our MFTcoder fine-tuned model, \textsc{CodeFuse-CodeLLama-34B}, achieves an impressive pass@1 score of 74.4\% on the HumaneEval benchmark, surpassing GPT-4 performance (67\%, zero-shot). MFTCoder is open-sourced at \url{https://github.com/codefuse-ai/MFTCOder}

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

↑