English

A Multi-Language Perspective on the Robustness of LLM Code Generation

Software Engineering 2026-05-05 v6

Abstract

Large language models have gained significant traction and popularity in recent times, extending their usage to code-generation tasks. While this field has garnered considerable attention, the exploration of testing and evaluating the robustness of code generation models remains an ongoing endeavor. Previous studies have primarily focused on code generation models specifically for the Python language, overlooking other widely used programming languages. In this work, we conduct a comprehensive comparative analysis to assess the robustness performance of several prominent code generation models and investigate whether robustness can be improved by repairing perturbed docstrings using an LLM. Furthermore, we investigate how their performance varies across different programming languages. To accomplish this, we introduce perturbations in four key areas of the prompt: DocString, function name, syntax, and format. We have compiled and released a dedicated dataset for this purpose. Our results show that all models consistently degrade under perturbations across all three languages, but vary in magnitude depending on the language and perturbation type. Larger model size does not reliably improve robustness, and semantic perturbations prove at least as disruptive as syntactic ones. Our LLM-based docString repair yields only marginal gains for simple perturbations and can degrade performance for semantic ones, highlighting the limits of prompt-level mitigation.

Keywords

Cite

@article{arxiv.2504.19108,
  title  = {A Multi-Language Perspective on the Robustness of LLM Code Generation},
  author = {Fazle Rabbi and Zishuo Ding and Jinqiu Yang},
  journal= {arXiv preprint arXiv:2504.19108},
  year   = {2026}
}

Comments

50 pages, 10 figures, 16 tables

R2 v1 2026-06-28T23:12:41.925Z