[论文解读] A Survey on Evaluating Large Language Models in Code Generation Tasks
对在代码生成中评估大型语言模型的方法和度量的全面综述,包括基准、评估方案和未来挑战。
This paper provides a comprehensive review of the current methods and metrics used to evaluate the performance of Large Language Models (LLMs) in code generation tasks. With the rapid growth in demand for automated software development, LLMs have demonstrated significant potential in the field of code generation. The paper begins by reviewing the historical development of LLMs and their applications in code generation. Next, it details various methods and metrics for assessing the code generation capabilities of LLMs, including code correctness, efficiency, readability, and evaluation methods based on expert review and user experience. The paper also evaluates the widely used benchmark datasets, identifying their limitations and proposing directions for future improvements. Specifically, the paper analyzes the performance of code generation models across different tasks by combining multiple evaluation metrics, such as code compilation/interpretation success rates, unit test pass rates, and performance and efficiency metrics, to comprehensively assess the practical application of LLMs in code generation. Finally, the paper discusses the challenges faced in evaluating LLMs in code generation, particularly how to ensure the comprehensiveness and accuracy of evaluation methods and how to adapt to the evolving practices of software development. These analyses and discussions provide valuable insights for further optimizing and improving the application of LLMs in code generation tasks.
研究动机与目标
- 评估大型语言模型在代码生成中的正确性、效率和可读性的方法。
- 总结用于代码生成任务的基准数据集及其局限性。
- 分析评估方法学,包括专家评审和用户体验。
- 识别可扩展、多语言、具备安全性与鲁棒性的评估面临的挑战与未来方向。
提出的方法
- 将评估指标分为相似度基、执行基和反馈基三类。
- 评审诸如 CodeBLEU 的代码特定指标以及数据流/AST 基于的评估。
- 总结如 HumanEval、MBPP、CodeXGLUE 和 CoderUJB 等基准测试套件,并讨论其局限性。
- 讨论可扩展性、多语言泛化、安全性、鲁棒性和实用性方面的挑战。

实验结果
研究问题
- RQ1用于评估代码生成中 LLMs 的评估指标有哪些,它们的局限性是什么?
- RQ2用于代码生成评估的基准有哪些,它们在多大程度上反映现实世界的编码任务?
- RQ3在评估代码生成中的 LLMs 时存在哪些挑战,未来工作的方向是什么?
- RQ4不同的评估方法(相似度、执行与反馈)如何在评估代码生成质量方面相互补充?
主要发现
- CodeBLEU 通过引入代码的句法和语义方面优于 BLEU。
- 编译/解释成功率和单元测试通过率是核心的执行基指标。
- 基于反馈的评估包括盲评同行评审和真实世界应用测试以提升客观性。
- 像 HumanEval 和 MBPP 这样的基准专注于 Python,可能无法充分反映实际的软件任务。
- 基准的变体(如 Java 的 CoderUJB)显示了 LLMs 在特定任务上的优劣势与局限。

更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。