CodeBLEU: a Method for Automatic Evaluation of Code Synthesis
Shuo Ren, Daya Guo, Shuai Lu, Long Zhou, Shujie Liu, Duyu Tang, Neel, Sundaresan, Ming Zhou, Ambrosio Blanco, Shuai Ma

TL;DR
This paper introduces CodeBLEU, a new automatic evaluation metric for code synthesis that incorporates syntax and semantics to better correlate with human judgment than traditional metrics like BLEU.
Contribution
The paper proposes CodeBLEU, which enhances BLEU with syntax and semantic features, providing a more accurate automatic evaluation for code generation tasks.
Findings
CodeBLEU correlates better with human judgment than BLEU.
It improves evaluation accuracy across multiple code synthesis tasks.
Experimental results validate the effectiveness of CodeBLEU.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Software Reliability and Analysis Research
