TL;DR
While large language models (LLMs) excel at writing code in dominant languages like Python and Java, real-world software systems are inherently polyglot, often leaving lower-resource languages behind. This survey maps out the rapidly evolving landscape of multilingual code intelligence, exploring how models generate and translate code across diverse programming paradigms. It highlights a crucial shift from simple snippet generation to complex, repository-level cross-language software engineering.
What Problem Does This Paper Address?
State-of-the-art LLMs (such as GPT-5, Claude, and DeepSeek) demonstrate remarkable proficiency in understanding natural language and generating executable code. However, current research suffers from a severe "monolingual bias." While models achieve near-human expertise in high-resource languages, their capabilities degrade precipitously when applied to system-level or functional languages like C/C++, Rust, OCaml, or Lua.
This disparity is a major bottleneck because production software is rarely written in a single language; a typical stack might combine a Java backend, performance-critical C++ kernels, and Rust for memory safety. To address this, the paper formalizes and reviews two core tasks:
- Multilingual Code Generation: Synthesizing functional code in multiple target programming languages from a single natural language requirement.
- Multilingual Code Translation: Converting an existing program from a source language to a target language while strictly preserving its original semantics (e.g., migrating legacy C++ to memory-safe Rust).
Methods
The authors organize the methodological landscape into four complementary paradigms that attempt to elicit or embed multilingual capabilities:
- Prompt Engineering: The most lightweight approach, which leverages frozen LLMs. It uses zero-shot or few-shot prompts, or introduces intermediate representations—such as language-agnostic pseudocode or natural language explanations—to act as a "semantic bridge" between different programming languages.
- Model Pre-training and Fine-tuning: Parameter-centric approaches that internalize multilingual knowledge. This involves large-scale instruction tuning or using compiler-level Intermediate Representations (IR) during training to force the model to learn language-agnostic logic.
- Multi-Agent Collaborative Frameworks: Systems that break down complex coding and translation tasks into iterative, coordinated roles (e.g., separate agents for translation, static analysis, and repair). This is particularly vital for handling complex cross-file dependencies during large-scale code migrations.
- Retrieval-Augmented Generation (RAG): Techniques that inject external, project-specific knowledge (like class definitions, dependencies, or parallel code corpora) at inference time to ensure code buildability and idiomatic correctness.
Datasets
The survey compiles and categorizes a wide array of benchmarks used to evaluate these models, tracking a shift from lexical matching to execution-based verification:
- Comprehensive Multi-task Benchmarks: CodeNet (covering 55 languages), CodeXGLUE, xCodeEval (introducing rigorous execution-based verification across 11 languages), and McEval.
- Multilingual Code Generation Benchmarks: HumanEval-XL (12 programming languages), mHumanEval (supporting over 200 natural languages), and PSEUDOEVAL (which isolates logic by providing pseudocode inputs).
- Multilingual Code Translation Benchmarks: XLCoST (the first fine-grained parallel corpora for translation), G-TransEval, CodeTransOcean (45 languages), and RepoTransBench (focusing on repository-level translation).
Key Insights and Ideas
- Paradigms over Syntax: The true barrier to cross-language generalization isn't surface-level syntax formatting; it is the distinct abstractions and constraints embedded in different languages, such as Rust's ownership model or OCaml's type system.
- Asymmetric Translation Difficulties: Translating code into stricter type systems (like Rust) is significantly more challenging for LLMs than translating code into highly flexible, dynamic languages (like Python).
- Decoupling Logic from Syntax: Forcing a model to generate language-agnostic pseudocode before writing the actual source code effectively isolates logical reasoning from syntax errors, drastically improving performance in low-resource languages.
- The Evolution of Evaluation: Evaluation practices are undergoing a tri-axial evolution: moving from single-language to massively multilingual coverage, from simple lexical matching (like BLEU) to execution-based verification, and from isolated code snippets to repository-level complexity.
Key Results
As a survey paper, the text synthesizes overarching research trends rather than presenting new empirical experiments. It notes that while prompt engineering improves surface-level alignment, its performance is strictly bounded by the model's pretraining data distribution.
The current state-of-the-art for complex industrial applications (like software hardening and cross-platform porting) relies on hybrid systems. Combining parameter-level competence (fine-tuning) with structured reasoning (multi-agent loops) and external grounding (RAG) yields the highest reliability when navigating architectural complexities and cross-file dependencies.
Limitations and Future Work
The authors highlight several persistent challenges that define the frontier of the field:
- Data Scarcity & Imbalance: Public code repositories and tutorials remain heavily skewed toward a few popular languages, leaving a long tail of undersupported languages.
- Weak Cross-Paradigm Transfer: Models still struggle to maintain exact semantic equivalence when translating between fundamentally different programming paradigms (e.g., object-oriented to functional).
- Fragmented and Costly Evaluation: Setting up asymmetric execution environments for dozens of languages to verify repository-level code introduces massive toolchain and compilation complexities.
- Trustworthiness: Eliminating subtle semantic errors and ensuring absolute safety during automated code migration remains an open problem.
Summary updated