mHumanEval - A Multilingual Benchmark to Evaluate Large Language Models for Code Generation

Md. Nishat Raihan, Antonios Anastasopoulos, Marcos ZampieriNAACL 2025

Introduction

While Large Language Models (LLMs) have revolutionized software development, their evaluation has remained largely English-centric. Benchmarks like OpenAI’s HumanEval primarily measure performance based on English prompts, creating a significant accessibility gap for developers worldwide. mHumanEval addresses this "digital divide" by providing a massive new benchmark designed to test code generation across 204 different natural languages. The study reveals that while top-tier models like Claude 3.5 and GPT-4o are remarkably robust, many specialized models suffer a performance collapse when moving from high-resource languages to low-resource ones like Nyanja or Zulu.

Methodology

The researchers constructed mHumanEval by extending the original 164 HumanEval tasks through a rigorous automated and human-validated pipeline.

  1. Prompt Extraction: Docstrings containing natural language instructions were manually extracted from the original Python tasks.
  2. Massive Translation: Using three state-of-the-art translation strategies—GPT-4o, Meta’s NLLB, and Google Translate—the team generated 13 candidate translations for every prompt into 204 target languages.
  3. Automated Quality Selection: To ensure accuracy, the researchers employed a "best-of-N" approach. Candidates were evaluated using BERTScore (measuring contextual similarity via round-trip translation) and CometKiwi (a reference-free quality estimator).
The mHumanEval automated translation and selection pipeline using round-trip translation and quality metrics.

To validate this automated pipeline, the authors created mHumanEval-Expert, a gold-standard subset featuring human-translated and expert-validated prompts for 15 diverse languages across all resource levels.

Dataset Overview

The resulting benchmark is unprecedented in scale and diversity:

  • mHumanEval: Contains 33,456 prompts (164 tasks × 204 natural languages).
  • Programming Languages: Covers 25 programming languages (PLs), including four newly added ones: MATLAB, Visual Basic, Fortran, and COBOL.
  • Language Classes: Natural languages are categorized into six classes (0–5) based on digital resource availability, ranging from "Rare" (Class 0) to "High Resource" (Class 5).

Key Results and Analysis

The evaluation of leading models across these 204 languages yielded several critical insights:

The Performance Gap

For most models, there is a clear downward trend in Pass@1 scores as resource availability decreases. However, proprietary models like Claude 3.5 and GPT-4o demonstrated impressive stability, maintaining Pass@1 scores above 0.70 across most language classes in Python.

Claude 3.5 performance (Pass@1) across different language resource classes, showing relative robustness compared to smaller models.

Failure Modes: The "Translation Hallucination" Bug

A primary failure mode in low-resource settings is "over-translation." When prompted in languages like Nyanja, some models attempt to translate standard programming keywords (e.g., if, for, or return) into the target natural language, which results in immediate syntax errors and compilation failure.

Model Robustness

  • Proprietary vs. Open Source: While specialized open-source models like WizardCoder perform excellently in English, their performance often drops to near 0% for low-resource languages.
  • Aya’s Consistency: The Aya model, fine-tuned specifically for multilinguality, showed the most consistent performance across all language classes, highlighting the importance of multilingual pre-training for global accessibility.
  • DeepSeek-Coder-V2: This model was unique in achieving its peak performance with a Chinese-Python pair rather than English-Python.

Conclusion and Future Work

The authors demonstrate that automated translation selection pipelines can produce prompts functionally equivalent to human translations for code generation tasks. While mHumanEval currently focuses on standalone functions, future work aims to expand the benchmark to include more complex, multi-file software engineering tasks and to explore transfer learning techniques that could boost performance for the most underserved (Class 0) languages. By providing this comprehensive framework, the researchers hope to bridge the cross-lingual gap in AI-assisted coding.

Summary updated

BibTeX
@inproceedings{raihan2025mhumaneval,
  author = {Md. Nishat Raihan and Antonios Anastasopoulos and Marcos Zampieri},
  title = {{mHumanEval - A Multilingual Benchmark to Evaluate Large Language Models for Code Generation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.570},
}
Figure