[Paper Review] MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generation
This paper introduces MultiPL-E, a scalable and extensible framework that translates unit test-driven code generation benchmarks from Python to 18 additional programming languages, enabling multi-language evaluation of neural code models. The key contribution is the creation of parallel, multilingual benchmarks (MultiPL-HumanEval and MultiPL-MBPP) that reveal Codex outperforms Python on several non-Python languages, challenging assumptions about language-specific performance and model generalization.
Large language models have demonstrated the ability to generate both natural language and programming language text. Such models open up the possibility of multi-language code generation: could code generation models generalize knowledge from one language to another? Although contemporary code generation models can generate semantically correct Python code, little is known about their abilities with other languages. We propose MultiPL-E, a system for translating unit test-driven code generation benchmarks to new languages. We create the first massively multilingual code generation benchmark by using MultiPL-E to translate two popular Python code generation benchmarks to 18 additional programming languages. We use MultiPL-E to extend the HumanEval benchmark and MBPP benchmark to 18 languages that encompass a range of programming paradigms and popularity. Using these new parallel benchmarks, we evaluate the multi-language performance of three state-of-the-art code generation models: Codex, CodeGen, and InCoder. We find that Codex matches or even exceeds its performance on Python for several other languages. The range of programming languages represented in MultiPL-E allow us to explore the impact of language frequency and language features on model performance. Finally, the MultiPL-E approach of compiling code generation benchmarks to new programming languages is both scalable and extensible, making it straightforward to evaluate new models, benchmarks, and languages.
Motivation & Objective
- To address the lack of multi-language evaluation in neural code generation by extending existing Python-centric benchmarks to other languages.
- To enable consistent, parallel evaluation of code generation models across diverse programming languages with varying paradigms and popularity.
- To investigate how language features, popularity, and prompt design affect model performance in code generation.
- To develop a reusable, extensible framework for benchmarking code generation models in new languages without full compiler overhead.
Proposed method
- MultiPL-E uses lightweight, rule-based compilers (~200 LOC each) to translate four components: function signatures, unit tests, docstrings, and type annotations from Python to target languages.
- It employs a language-appropriate terminology translation module to adapt Python-specific terms (e.g., 'list' → 'vector' in C++) for better prompt clarity.
- A containerized sandbox environment executes generated code with timeouts, validates outputs against unit tests, and classifies results as correct, syntax error, or runtime error.
- The framework supports 18 languages spanning multiple paradigms and popularity levels, with evaluation scripts of ~20 LOC per language.
- It reuses existing benchmarks—HumanEval and MBPP—by translating their test cases and prompts into new languages while preserving semantic equivalence.
- The system enables zero-shot evaluation of code generation models across languages using consistent problem sets.
Experimental results
Research questions
- RQ1Can code generation models generalize knowledge from Python to other programming languages, and how does performance vary across languages?
- RQ2How do language popularity and syntactic features (e.g., static typing) affect model performance in code generation?
- RQ3Does model perplexity correlate with code correctness across different languages?
- RQ4How sensitive is model performance to prompt design and language-specific terminology in multilingual settings?
- RQ5To what extent do type annotations improve or hinder code generation in statically typed languages?
Key findings
- Codex matches or exceeds its Python performance on JavaScript, C++, Scala, and TypeScript, indicating strong cross-lingual generalization.
- Model performance shows a moderate correlation with language popularity, but niche languages like Racket and Swift perform comparably to mainstream ones.
- There is no strong correlation between model perplexity and code correctness, suggesting perplexity is a weak proxy for code generation quality.
- Static typing does not significantly improve or degrade model performance, indicating that type annotations are neither a major help nor hindrance.
- Prompt design sensitivity is evident across both popular and niche languages, with model output quality varying significantly with prompt formulation.
- Error analysis reveals language-specific pitfalls such as incorrect string indexing in Swift and input handling issues in Python, highlighting model limitations in handling language-specific idioms.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.