Papers › CodeBLEU: a Method for Automatic Evaluation of Code Synthesis

CodeBLEU: a Method for Automatic Evaluation of Code Synthesis

22 Sep 2020arXiv:2009.10297archive 2025-07-28

Shuo Ren, Daya Guo, Shuai Lu, Long Zhou, Shujie Liu, Duyu Tang, Neel Sundaresan, Ming Zhou, Ambrosio Blanco, Shuai Ma

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.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 15 code samples harvested from 1 repository linked to this paper: 5 ran (of which 0 constructed an object rather than computing a result; 5 with no instrument failure: 0 honoured, 0 violated, 5 with no contract checked; 0 where Syntology's instrument failed) · 10 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code; here there are none.

By repository: community (archive-listed): 15 samples from 1 repository, 5 ran (5 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 1 of its repositories that Syntology harvested for other papers:

Levels written on 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

THUDM/CodeGeeX mentioned on GitHubmindsporeApache-2.0Syntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-X (arXiv:2303.17568; that paper's own run record: 6 ran (of which 0 constructed an object rather than computing a result; 6 with no instrument failure: 0 honoured, 0 violated, 6 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method. report
codefuse-ai/codefuse-evaluation mentioned on GitHubpytorchNOASSERTIONSyntology: not harvested report
k4black/codebleu mentioned on GitHubMITSyntology: 15 samples, 5 ran (0 instrument-failed) · 10 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

15 samples harvested: 5 ran (of which 0 constructed an object rather than computing a result; 5 with no instrument failure: 0 honoured, 0 violated, 5 with no contract checked; 0 where Syntology's instrument failed) · 10 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

5ran
10unverified

Licence: 3 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. For 3 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from k4black/codebleu. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

k4black/codebleu community (archive-listed) 15 samples, 5 ran (0 instrument-failed) · 10 unverified
DFG_csharp codebleu/parser/DFG.py ran MIT (permissive) here; the stored copy is pointer only · ec263cd21fc00661 · report fixture: signature root_node:MockNode/0/?, index_to_code:dict/0/?, states:dict/0/? · returned tuple · level recorded 2026-09-24
pad_sequence in 46 papers codebleu/utils.py ran MIT (permissive) · 43586244d847bf2e · report fixture: signature sequence:list/1/int, n:int/0/int, pad_left:bool/0/bool, pad_right:bool/0/bool, left_pad_symbol:str/0/str, right_pad_symbol:str/0/str · returned chain · level recorded 2026-09-24
remove_comments_and_docstrings codebleu/parser/utils.py ran fingerprinted MIT (permissive) · 415f22596f6fd32f · report fixture: signature source:str/0/str, lang:str/0/str · returned str · level recorded 2026-09-24
tree_to_token_index codebleu/parser/utils.py ran MIT (permissive) · fd03d6988376fcfc · report fixture: signature root_node:TreeNode/0/? · returned list · level recorded 2026-09-24
tree_to_variable_index codebleu/parser/utils.py ran MIT (permissive) · e94d80eee26382a1 · report fixture: signature root_node:TreeNode/0/?, index_to_code:dict/0/? · returned list · level recorded 2026-09-24
DFG_java codebleu/parser/DFG.py unverified MIT (permissive) here; the stored copy is pointer only · 8ad8aef57770407f · report
DFG_python codebleu/parser/DFG.py unverified MIT (permissive) here; the stored copy is pointer only · e9c213ae4e45bf1b · report
calc_codebleu codebleu/codebleu.py unverified MIT (permissive) · 38213de5abb9cc32 · report
corpus_bleu in 9 papers codebleu/bleu.py unverified MIT (permissive) · 2b511bace1ccabdd · report
corpus_bleu in 9 papers codebleu/weighted_ngram_match.py unverified MIT (permissive) · 8d6567463aef1687 · report
get_data_flow codebleu/dataflow_match.py unverified MIT (permissive) · 5a7c7ae6af7f3761 · report
modified_precision in 9 papers codebleu/bleu.py unverified MIT (permissive) · 68e6098d18d043f3 · report
modified_recall codebleu/weighted_ngram_match.py unverified MIT (permissive) · f0ec27f9d891d5bd · report
sentence_bleu codebleu/bleu.py unverified MIT (permissive) · 25785b97398bb5cb · report
sentence_bleu codebleu/weighted_ngram_match.py unverified MIT (permissive) · 24b6b81d4ef778a6 · report

Tasks

Code TranslationTranslation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections