A Study on the Impact of Natural Language Differences in Prompts on Automatic Code Generation Using LLMs
Haruka Tokumasu, Masanari Kondo, Alexander Serebrenik, Dong Wang, Kei Koyanagi, Kotaro Noguchi, Naoyasu Ubayashi, Yasutaka Kamei
Key points
From the paper's conclusion- To quantify the language bias on code generation, each problem is presented in English, Japanese, and Chinese using seven LLMs and assessed for Accuracy on AtCoder, LeetCode, and BigCodeBench.
- The languages officially supported by each dataset achieved the highest median Accuracy, and translation improved Accuracy but its effectiveness was not consistent.
- Natural language significantly affects LLM code generation accuracy, and translation can mitigate language bias but its effectiveness depends on the dataset and model type.
Abstract
Large Language Models (LLMs) have demonstrated remarkable performance in automatic code generation tasks, thereby encouraging new research in this area. Although numerous studies have explored LLM-based code generation, the impact of the natural language in input prompts remains unexplored (language bias). This study aims to (1) quantify how the natural language of input prompts influences LLM-based code generation performance and (2) evaluate a mitigation strategy to reduce language bias in code generation. We assess code generation Accuracy on AtCoder, LeetCode, and BigCodeBench. To quantify the language bias on code generation, each problem is presented in English, Japanese, and Chinese. We use seven LLMs (GPT-4o, o3-mini, DeepSeek-V3.2, Llama-3, Qwen2.5-Coder-14B, Qwen2.5-Coder-0.5B, and GitHub Copilot) and assess their performance in terms of Accuracy (the number of problems for which generated code passes all test cases). We compare Accuracy before and after translation to evaluate the effectiveness of translation as a mitigation strategy. We observed that the natural language of problem statements affects LLM-based code generation performance. Specifically, the languages officially supported by each dataset achieved the highest median Accuracy. Also, translation improved Accuracy, but its effectiveness was not consistent across datasets and model types. We found that AtCoder contained a particularly high proportion of narrative-style problem statements and longer problem statements. Natural language significantly affects LLM code generation accuracy. Translation can mitigate language bias in some settings, but its effectiveness depends on the dataset and model type. Furthermore, the narrative aspects and context length of input prompts are important factors related to language bias and the effectiveness of translation as a mitigation strategy.
Read the paper
Discussion · 1
Science Skim's AI key points, plus readers' public thoughts
- To quantify the language bias on code generation, each problem is presented in English, Japanese, and Chinese using seven LLMs and assessed for Accuracy on AtCoder, LeetCode, and BigCodeBench.
- The languages officially supported by each dataset achieved the highest median Accuracy, and translation improved Accuracy but its effectiveness was not consistent.
- Natural language significantly affects LLM code generation accuracy, and translation can mitigate language bias but its effectiveness depends on the dataset and model type.
Readers' thoughts
No reader thoughts yet.
Related papers
- Large Language Models for Code Generation from Multilingual Prompts: A Curated Benchmark and a Study on Code QualityACM Transactions on Software Engineering and Methodology · 2026
- CodeTransBenchmark: evaluating LLM-based code translation and repair across programming languagesEmpirical Software Engineering · 2026
- TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution AlignmentProceedings of the ACM on software engineering. · 2026
- Large Language Models for Programming: Actually Fixing or Reimplementing Incorrect Code?arXiv · 2026
- Hallucinations of Large Language Models in Cross-Language Code Translation: Phenomena and MitigationarXiv · 2026
- SWE-Journey: Towards More Realistic Evaluation of Coding Assistants through Long-Horizon, Multi-Turn InteractionarXiv · 2026