CodeBLEU: a Method for Automatic Evaluation of Code Synthesis

By Shuo Ren, Daya Guo, Shuai Lu, Long Zhou, Shujie Liu, Duyu Tang, M. Zhou, Ambrosio Blanco, Shuai Ma. 2020

902 citations recorded by the source corpus.

Evaluation metrics play a vital role in the growth of an area as it defines the standard of distinguishing between good and bad models. In the area of code synthesis, the commonly used evaluation metric is BLEU or perfect accuracy, but they are not suitable enough to evaluate codes, because BLEU is originally designed to evaluate the natural language, neglecting important syntactic and semantic features of codes, and perfect accuracy is too strict thus it underestimates different outputs with the same semantic logic. To remedy this, we introduce a new automatic evaluation metric, dubbed CodeBLEU. It absorbs the strength of BLEU in the n-gram match and further injects code syntax via abstract syntax trees (AST) and code semantics via data-flow. We conduct experiments by evaluating the correlation coefficient between CodeBLEU and quality scores assigned by the programmers on three code synthesis tasks, i.e., text-to-code, code translation, and code refinement. Experimental results show that our proposed CodeBLEU can achieve a better correlation with programmer assigned scores compared with BLEU and accuracy.

Subfields: Information Systems, Software, Evaluation & Benchmarks

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Information Systems

  1. Yanqiao Zhu
  2. Yichen Xu
  3. Yue Wang
  4. Steven C. H. Hoi
  5. Xinyun Chen
  6. Nan Duan
  7. Daya Guo
  8. Neel Sundaresan

In Software

  1. Yue Wang
  2. Steven C. H. Hoi
  3. Neel Sundaresan
  4. Alexey Svyatkovskiy
  5. Daya Guo
  6. Nan Duan
  7. Xinyun Chen
  8. Yanqiao Zhu

In Evaluation & Benchmarks

  1. Duyu Tang
  2. Steven C. H. Hoi
  3. Zhilin Yang
  4. Shuyan Zhou
  5. Shafiq R. Joty
  6. Graham Neubig
  7. Egor Bogomolov
  8. Zhiruo Wang

Citations in the corpus