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

走出BLEU:我们应如何评估代码生成模型的质量?

Out of the BLEU: how should we assess quality of the Code Generation models?

JetBrains Research(JetBrains研究院);JetBrains

Mikhail Evtikhiev, Egor Bogomolov, Yaroslav Sokolov, Timofey Bryksin

AI总结:

本研究评估了六种自动指标在代码生成模型质量评估中的适用性,发现ChrF优于BLEU和CodeBLEU,并指出在CoNaLa和HearthStone数据集上需分别达到5分和2分的分数差才能可靠判断模型优劣。

摘要:

近年来,研究人员创建并引入了大量不同的代码生成模型。由于对每个新模型版本进行人工评估不可行,社区采用了诸如BLEU之类的自动评估指标来近似人工评判的结果。这些指标源于机器翻译领域,尚不清楚它们是否适用于代码生成任务,以及它们在该任务上与人工评估的一致性如何。还有其他指标,如CodeBLEU和RUBY,专为估计代码相似性而开发,考虑了源代码的特性。然而,对于这些指标,几乎没有关于它们与人工评估一致性的研究。尽管如此,在最近的论文中,指标分数的微小差异已被用来宣称某些代码生成模型优于其他模型。\n在本文中,我们针对六个指标——BLEU、ROUGE-L、METEOR、ChrF、CodeBLEU和RUBY——在代码生成模型评估中的适用性进行了研究。我们在两个不同的代码生成数据集上进行了研究,并让人工标注者评估所有模型在这些数据集上的输出质量。结果表明,对于包含Python单行代码的CoNaLa数据集,如果模型分数差异小于5分,没有任何指标能够以超过95%的置信度正确模拟人工判断哪个模型更好。对于由特定结构类组成的HearthStone数据集,模型分数差异至少2分就足以宣称一个模型优于另一个。我们的发现表明,ChrF指标比常用的BLEU和CodeBLEU更适合评估代码生成模型。然而,要找到一种与人工评估高度一致的代码生成指标,仍需进一步的工作。

英文摘要:

In recent years, researchers have created and introduced a significant number of various code generation models. As human evaluation of every new model version is unfeasible, the community adopted automatic evaluation metrics such as BLEU to approximate the results of human judgement. These metrics originate from the machine translation domain and it is unclear whether they are applicable for the code generation tasks and how well they agree with the human evaluation on this task. There are also other metrics, CodeBLEU and RUBY, developed to estimate the similarity of code, that take into account the properties of source code. However, for these metrics there are hardly any studies on their agreement with the human evaluation. Despite all that, minimal differences in the metric scores have been used in recent papers to claim superiority of some code generation models over the others. In this paper, we present a study on the applicability of six metrics -- BLEU, ROUGE-L, METEOR, ChrF, CodeBLEU, and RUBY -- for evaluation of code generation models. We conduct a study on two different code generation datasets and use human annotators to assess the quality of all models run on these datasets. The results indicate that for the CoNaLa dataset of Python one-liners, none of the metrics can correctly emulate human judgement on which model is better with >95% certainty if the difference in model scores is less than 5 points. For the HearthStone dataset, which consists of classes of a particular structure, a difference in model scores of at least 2 points is enough to claim the superiority of one model over the other. Our findings suggest that the ChrF metric is a better fit for the evaluation of code generation models than the commonly used BLEU and CodeBLEU. Yet, finding a metric for code generation that closely agrees with humans requires additional work.

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

↑