arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.18131cs.SEcs.AI
收藏

全方位评估最新大型语言模型在代码生成中的表现

Holistic Evaluation of State-of-the-Art LLMs for Code Generation

Le Zhang, Suresh Kothari

AI总结:

本研究评估了六个最新大型语言模型在代码生成中的表现,发现DeepSeek-R1和GPT-4.1在正确性、效率和鲁棒性方面表现最佳,强调了提示工程和人类监督的重要性。

摘要:

本研究对六个最先进的大型语言模型(LLMs)在代码生成中的表现进行了全面的实证评估,包括通用型和专门用于代码的模型。使用包含944个真实世界LeetCode问题的五种编程语言的数据集,我们通过严格指标评估模型性能:编译时错误、运行时错误、功能失败和算法次优情况。结果揭示了显著的性能差异,DeepSeek-R1和GPT-4.1在正确性、效率和鲁棒性方面始终优于其他模型。通过详细的案例研究,我们识别了常见的失败场景,如语法错误、逻辑缺陷和次优算法,突显了提示工程和人类监督在提高结果中的关键作用。基于这些发现,我们为开发者和实践者提供了可操作的建议,强调成功的LLM部署取决于仔细的模型选择、有效的提示设计和情境感知使用,以确保在现实软件开发任务中可靠地生成代码。

英文摘要:

This study presents a comprehensive empirical evaluation of six state-of-the-art large language models (LLMs) for code generation, including both general-purpose and code-specialized models. Using a dataset of 944 real-world LeetCode problems across five programming languages, we assess model performance using rigorous metrics: compile-time errors, runtime errors, functional failures, and algorithmic suboptimalities. The results reveal significant performance variations, with DeepSeek-R1 and GPT-4.1 consistently outperform others in terms of correctness, efficiency, and robustness. Through detailed case studies, we identify common failure scenarios such as syntax errors, logical flaws, and suboptimal algorithms, highlighting the critical role of prompt engineering and human oversight in improving results. Based on these findings, we provide actionable recommendations for developers and practitioners, emphasizing that successful LLM deployment depends on careful model selection, effective prompt design, and context-aware usage to ensure reliable code generation in real-world software development tasks.

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

↑