arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.07487cs.CL

多智能体协作的多语言代码指令调优

Multi-Agent Collaboration for Multilingual Code Instruction Tuning

Alibaba Group(阿里巴巴集团);Shanghai Jiao Tong University(上海交通大学);Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences(中国科学院深圳先进技术研究院);University of Chinese Academy of Sciences(中国科学院大学)

Jian Yang, Wei Zhang, Jiaxi Yang, Yibo Miao, Shanghaoran Quan, Zhenhe Wu, Qiyao Peng, Liqun Yang, Tianyu Liu, Zeyu Cui, Binyuan Hui, Junyang Lin

AI总结:

针对现有代码指令调优孤立处理编程语言、忽略知识迁移的问题,提出带生成记忆的多智能体协作框架,通过特定语言智能体协同生成多语言指令数据并迁移知识,训练的Qwen2.5-xCoder在跨语言知识共享上表现更优。

摘要:

代码理解与生成领域的最新进展表明,在高质量指令数据集上微调的代码大语言模型(LLMs)可获得强大能力,解决各类代码相关任务。然而,多数现有方法孤立看待各编程语言,忽略了不同语言间的知识迁移。为弥合这一差距,我们提出一种新型多智能体协作框架,以增强代码LLMs的多语言指令调优——该框架中,多个带生成记忆的特定语言智能体组件协同工作,高效地将知识从一种语言迁移至另一种语言。具体而言,我们首先从代码片段生成特定语言的指令数据,将其作为特定语言智能体的种子数据;多个特定语言智能体通过讨论协作,生成新指令及其对应解决方案(新编程语言或现有语言);为进一步促进跨语言迁移,每个智能体将生成历史存储为记忆,并总结其优缺点。最终,高质量多语言指令数据用于促进不同编程语言间的知识迁移,以训练Qwen2.5-xCoder。多语言编程基准测试结果显示,Qwen2.5-xCoder在共享通用知识方面表现卓越,凸显其缩小跨语言差距的潜力。

英文摘要:

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.

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

↑