SteloCoder:一种用于多语言到Python代码翻译的仅解码器大语言模型
SteloCoder: a Decoder-Only LLM for Multi-Language to Python Code Translation
AI总结:
针对现有大语言模型代码翻译能力与训练效率的不足,研究团队基于StarCoder架构融合MoE、LoRA与课程学习技术,提出多语言到Python代码翻译模型SteloCoder,在XLCoST数据集上取得超越现有最优水平3.5以上的CodeBLEU得分,且训练成本极低。
摘要:
随着近期大语言模型(LLM)受到广泛关注,StarCoder(Li等人,2023)和Code Llama(Rozière等人,2023)均在代码生成任务中展现出优异性能,但代码翻译功能及配套的高效训练技术仍有提升空间。针对这一问题,我们提出SteloCoder——一种基于StarCoder的仅解码器LLM,专门用于多编程语言到Python的代码翻译任务,尤其可在无需指定输入编程语言的前提下,实现C++、C#、JavaScript、Java或PHP到Python的代码翻译。我们对StarCoder的模型架构进行了修改,引入混合专家(MoE)技术,配置5个专家和一个门控网络以处理多任务,专家模型通过对StarCoder微调得到。具体而言,我们采用低秩适配方法(LoRA),将每个专家的参数量控制在仅为StarCoder参数总数的0.06%。同时,为提升时间维度上的训练效率,我们采用课程学习策略,并使用自指令数据实现高效微调。最终,每个专家仅需在单张80Gb A100 HBM显卡上训练6小时即可完成。在XLCoST数据集上的实验结果显示,SteloCoder在多编程语言到Python的翻译任务中平均CodeBLEU得分达到73.76,较排行榜最优性能至少高出3.5。取得这一成果仅需在StarCoder骨干网络基础上增加45M额外参数,且在单张80GB A100 HBM上的有效训练时长为32小时。源代码已发布于:https://github.com/sade-adrien/SteloCoder。
英文摘要:
With the recent focus on Large Language Models (LLMs), both StarCoder (Li et al., 2023) and Code Llama (Rozière et al., 2023) have demonstrated remarkable performance in code generation. However, there is still a need for improvement in code translation functionality with efficient training techniques. In response to this, we introduce SteloCoder, a decoder-only StarCoder-based LLM designed specifically for multi-programming language-to-Python code translation. In particular, SteloCoder achieves C++, C#, JavaScript, Java, or PHP-to-Python code translation without specifying the input programming language. We modified StarCoder model architecture by incorporating a Mixture-of-Experts (MoE) technique featuring five experts and a gating network for multi-task handling. Experts are obtained by StarCoder fine-tuning. Specifically, we use a Low-Rank Adaptive Method (LoRA) technique, limiting each expert size as only 0.06% of number of StarCoder's parameters. At the same time, to enhance training efficiency in terms of time, we adopt curriculum learning strategy and use self-instruct data for efficient fine-tuning. As a result, each expert takes only 6 hours to train on one single 80Gb A100 HBM. With experiments on XLCoST datasets, SteloCoder achieves an average of 73.76 CodeBLEU score in multi-programming language-to-Python translation, surpassing the top performance from the leaderboard by at least 3.5. This accomplishment is attributed to only 45M extra parameters with StarCoder as the backbone and 32 hours of valid training on one 80GB A100 HBM. The source code is release here: https://github.com/sade-adrien/SteloCoder.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。