Skip to main content
QUICK REVIEW

[论文解读] The Fault in our Stars: Quality Assessment of Code Generation Benchmarks

Mohammed Latif Siddiq, Simantika Dristi|arXiv (Cornell University)|Apr 15, 2024
Model-Driven Software Engineering TechniquesComputer Science被引用 3
一句话总结

本文对代码生成基准中的提示质量进行了首次全面研究,分析了9个基准中3,566个提示。研究发现广泛存在语法错误、意图不明确以及文档风格差等问题,表明修复这些问题可提升Python代码生成性能——尽管对Java的提升不显著——同时提供了GPT-3.5-Turbo和CodeGen-2.5模型存在数据污染的证据。

ABSTRACT

Large Language Models (LLMs) are gaining popularity among software engineers. A crucial aspect of developing effective code generation LLMs is to evaluate these models using a robust benchmark. Evaluation benchmarks with quality issues can provide a false sense of performance. In this work, we conduct the first-of-its-kind study of the quality of prompts within benchmarks used to compare the performance of different code generation models. To conduct this study, we analyzed 3,566 prompts from 9 code generation benchmarks to identify quality issues in them. We also investigated whether fixing the identified quality issues in the benchmarks' prompts affects a model's performance. We also studied memorization issues of the evaluation dataset, which can put into question a benchmark's trustworthiness. We found that code generation evaluation benchmarks mainly focused on Python and coding exercises and had very limited contextual dependencies to challenge the model. These datasets and the developers' prompts suffer from quality issues like spelling and grammatical errors, unclear sentences to express developers' intent, and not using proper documentation style. Fixing all these issues in the benchmarks can lead to a better performance for Python code generation, but not a significant improvement was observed for Java code generation. We also found evidence that GPT-3.5-Turbo and CodeGen-2.5 models may have data contamination issues.

研究动机与目标

  • 调查用于代码生成基准的提示质量,这些提示对于评估大语言模型至关重要。
  • 识别可能误导或阻碍代码生成模型的提示中常见质量问题。
  • 评估提升提示质量是否能带来代码生成性能的可测量提升。
  • 检查主流基准是否因测试集污染而影响评估的可靠性。
  • 将基准提示与现实世界中开发者使用的提示进行比较,以评估其代表性与实际相关性。

提出的方法

  • 系统分析了9个代码生成基准中的3,566个提示,重点关注Python和Java。
  • 将质量问题分类为三类:格式错误、行为规范模糊或错误,以及多余标记(噪声)。
  • 应用自动化修复技术,修正拼写、语法和文档风格(例如,统一标准化docstrings和JavaDoc)。
  • 使用GPT-3.5-Turbo和CodeGen-2.5对原始提示和清理后的提示重新评估模型性能。
  • 通过检查模型输出是否与基准中已知解法匹配,开展污染分析,采用相似性度量和基于检索的检查方法。
  • 将基准提示与来自ChatGPT交互的现实世界开发者提示进行比较,以评估其真实性和质量。

实验结果

研究问题

  • RQ1RQ1:现有代码生成基准中使用的提示普遍存在哪些质量问题?
  • RQ2RQ2:这些质量问题如何影响代码生成模型的性能?
  • RQ3RQ3:提升提示质量(例如,修正语法和文档)在多大程度上能增强模型性能?
  • RQ4RQ4:是否存在针对GPT-3.5-Turbo和CodeGen-2.5的流行代码生成基准中测试集污染的实证证据?
  • RQ5RQ5:基准提示中的质量问题与LLM实际使用中现实世界开发者提示中的问题相比如何?

主要发现

  • 分析了来自9个基准的3,566个提示,发现格式、清晰度和文档风格方面存在广泛问题。
  • 修复拼写、语法并标准化docstrings后,Python代码生成性能得到可测量的提升,但Java的提升不显著。
  • 在GPT-3.5-Turbo和CodeGen-2.5中均发现了测试集污染的证据,表明这些模型可能已记忆基准解法。
  • 这些基准表现出有限的上下文依赖性,且严重偏向Python和简单的编程练习。
  • 与用于ChatGPT的现实世界开发者提示相比,基准提示在清晰度和专业风格方面较差。
  • 本研究指出,当前基准可能无法反映真实世界开发场景,可能导致模型评估产生误导。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。