arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2506.03535cs.SE
收藏

跨越编程语言壁垒:关于跨语言检索增强型代码生成的研讨

Across Programming Language Silos: A Study on Cross-Lingual Retrieval-augmented Code Generation

Chinese Information Processing Laboratory, Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所中文信息处理实验室);University of Chinese Academy of Sciences(中国科学院大学);The Hong Kong University of Science and Technology(香港科技大学)

Qiming Zhu, Jialun Cao, Xuanang Chen, Weili Zhang, Yaojie Lu, Hongyu Lin, Xianpei Han, Le Sun, Shing-Chi Cheung

AI总结:

本文研究了跨语言检索增强型代码生成中的知识转移,通过构建13种编程语言的14000个实例数据集,发现跨语言知识转移非 trivial,且依赖语言亲和力和预训练语料多样性。

摘要:

当前关于大语言模型(LLMs)的检索增强型代码生成(RACG)研究主要集中在单语言设置,跨语言有效性研究不足。多语言RACG系统在迁移和重用代码跨编程语言(PLs)中日益重要。为系统研究RACG中的跨语言代码知识转移,我们构建了一个涵盖13种PLs的14000个实例的数据集。实验揭示三个关键发现:(1)即使使用直接注入,跨PLs的RACG知识转移也非 trivial。(2)RACG在跨语言知识转移上表现不均,其效果依赖于PL对的语言亲和力和LLM预训练语料的多样性。(3)当配备代码专用检索器时,RACG对代码中嵌入的自然语言信息依赖有限。这些发现为设计有效的多语言RACG系统提供了实践指导。

英文摘要:

Current research on large language models (LLMs) with retrieval-augmented code generation (RACG) has largely focused on single-language settings, leaving their cross-lingual effectiveness underexplored. Multilingual RACG systems are increasingly important for migrating and reusing code across programming languages (PLs), a common yet challenging task in modern software development. To systematically study cross-lingual code knowledge transfer in RACG, we construct a dataset covering 13 PLs with nearly 14K instances. Our experiments reveal three key insights: (1) Knowledge transfer in RACG across PLs is non-trivial even using direct injection. (2) RACG exhibits unequal cross-lingual knowledge transfer, and its efficacy depends on linguistic affinity of PL pair and diversity of LLM pretraining corpus. (3) RACG shows limited reliance on natural language information embedded in code when equipped with a code-specific retriever. These findings provide practical guidance for designing effective multilingual RACG systems. https://github.com/icip-cas/Cross-Lingual-RACG

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

↑