Recent advancement in code understanding and generation demonstrates that code LLMs fine-tuned on a high-quality instruction dataset can gain powerful capabilities to address wide-ranging code-related tasks. However, most previous existing methods mainly view each programming language in isolation and ignore the knowledge transfer among different programming languages. To bridge the gap among different programming languages, we introduce a novel multi-agent collaboration framework to enhance multilingual instruction tuning for code LLMs, where multiple language-specific intelligent agent components with generation memory work together to transfer knowledge from one language to another efficiently and effectively. Specifically, we first generate the language-specific instruction data from the code snippets and then provide the generated data as the seed data for language-specific agents. Multiple language-specific agents discuss and collaborate to formulate a new instruction and its corresponding solution (A new programming language or existing programming language), To further encourage the cross-lingual transfer, each agent stores its generation history as memory and then summarizes its merits and faults. Finally, the high-quality multilingual instruction data is used to encourage knowledge transfer among different programming languages to train Qwen2.5-xCoder. Experimental results on multilingual programming benchmarks demonstrate the superior performance of Qwen2.5-xCoder in sharing common knowledge, highlighting its potential to reduce the cross-lingual gap.
翻译:近期在代码理解和生成方面的进展表明,基于高质量指令数据集微调的代码大语言模型能够获得强大的能力,以应对广泛的代码相关任务。然而,现有方法大多孤立地看待每种编程语言,忽略了不同编程语言之间的知识迁移。为弥合不同编程语言之间的差距,我们引入了一种新颖的多智能体协作框架,以增强代码大语言模型的多语言指令微调。该框架中,多个具备生成记忆的特定语言智能体组件协同工作,高效地将知识从一种语言迁移至另一种语言。具体而言,我们首先从代码片段生成特定语言的指令数据,随后将这些生成数据作为特定语言智能体的种子数据。多个特定语言智能体通过讨论与协作,共同构建新的指令及其对应解决方案(可以是新的编程语言或现有编程语言)。为进一步促进跨语言迁移,每个智能体将其生成历史存储为记忆,并总结其优劣之处。最终,利用高质量的多语言指令数据来促进不同编程语言间的知识迁移,以训练Qwen2.5-xCoder模型。在多语言编程基准测试上的实验结果表明,Qwen2.5-xCoder在共享通用知识方面表现卓越,凸显了其在缩小跨语言差距方面的潜力。