arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2505.05063cs.LGcs.CL
收藏

CodeMixBench:评估大型语言模型在代码混合提示下的代码生成能力

CodeMixBench: Evaluating Large Language Models on Code Generation with Code-Mixed Prompts

Department of Computer Science(计算机科学系);Chandigarh University Punjab(昌迪加尔大学旁遮普);Department of Technology Management and Innovation(技术管理与创新系);New York University(纽约大学)

Manik Sheokand, Parth Sawant

AI总结:

本文提出CodeMixBench基准,通过在三种语言对的提示中引入受控代码混合,评估1.5B至15B开源代码生成模型的鲁棒性,发现代码混合提示一致降低Pass@1性能,为多语言代码生成研究提供新方向。

摘要:

大型语言模型(LLMs)在代码生成任务中取得了显著成功,推动了代码补全、调试和编程辅助等多种应用。然而,现有的基准测试如HumanEval、MBPP和BigCodeBench主要评估LLMs在纯英文提示下的表现,忽视了现实场景中多语言开发者经常使用代码混合语言与LLMs交互的情况。为填补这一空白,我们提出了CodeMixBench,一个旨在评估LLMs从代码混合提示生成代码的鲁棒性的新型基准。CodeMixBench基于BigCodeBench构建,在三种语言对的提示自然语言部分引入受控代码混合(CMD):印地英语(印地语-英语)、西班牙语-英语和中文拼音-英语。我们全面评估了一组参数规模从1.5B到15B的开源代码生成模型。结果表明,与纯英文提示相比,代码混合提示一致降低了Pass@1性能,且对于较小模型,性能下降幅度随CMD水平升高而增大。CodeMixBench为研究多语言代码生成提供了一个现实的评估框架,并揭示了构建在不同语言环境下具有良好泛化能力的鲁棒代码生成模型所面临的新挑战和方向。

英文摘要:

Large Language Models (LLMs) have achieved remarkable success in code generation tasks, powering various applications like code completion, debugging, and programming assistance. However, existing benchmarks such as HumanEval, MBPP, and BigCodeBench primarily evaluate LLMs on English-only prompts, overlooking the real-world scenario where multilingual developers often use code-mixed language while interacting with LLMs. To address this gap, we introduce CodeMixBench, a novel benchmark designed to evaluate the robustness of LLMs on code generation from code-mixed prompts. Built upon BigCodeBench, CodeMixBench introduces controlled code-mixing (CMD) into the natural language parts of prompts across three language pairs: Hinglish (Hindi-English), Spanish-English, and Chinese Pinyin-English. We comprehensively evaluate a diverse set of open-source code generation models ranging from 1.5B to 15B parameters. Our results show that code-mixed prompts consistently degrade Pass@1 performance compared to their English-only counterparts, with performance drops increasing under higher CMD levels for smaller models. CodeMixBench provides a realistic evaluation framework for studying multilingual code generation and highlights new challenges and directions for building robust code generation models that generalize well across diverse linguistic settings.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑