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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhu, Qiming, Cao, Jialun, Chen, Xuanang, Zhang, Weili, Lu, Yaojie, Lin, Hongyu, Han, Xianpei, Sun, Le, Cheung, Shing-Chi
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915943910735872
author Zhu, Qiming
Cao, Jialun
Chen, Xuanang
Zhang, Weili
Lu, Yaojie
Lin, Hongyu
Han, Xianpei
Sun, Le
Cheung, Shing-Chi
author_facet Zhu, Qiming
Cao, Jialun
Chen, Xuanang
Zhang, Weili
Lu, Yaojie
Lin, Hongyu
Han, Xianpei
Sun, Le
Cheung, Shing-Chi
contents 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
format Preprint
id arxiv_https___arxiv_org_abs_2506_03535
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Across Programming Language Silos: A Study on Cross-Lingual Retrieval-augmented Code Generation
Zhu, Qiming
Cao, Jialun
Chen, Xuanang
Zhang, Weili
Lu, Yaojie
Lin, Hongyu
Han, Xianpei
Sun, Le
Cheung, Shing-Chi
Software Engineering
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
title Across Programming Language Silos: A Study on Cross-Lingual Retrieval-augmented Code Generation
topic Software Engineering
url https://arxiv.org/abs/2506.03535