SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2009.10297 · 2020

CodeBLEU: a Method for Automatic Evaluation of Code Synthesis

arXiv · PDF · Open in the Atlas

Code that ran

5 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 2 failures of our instrument; 10 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2009.10297.json · badge: /api/ran/2009.10297.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
k4black/codebleu community (classifier label)
classifier basis not recorded on the link
5 ran · 10 no recorded run
FunctionStatusWhere it lives
DFG_csharp Ran
ran; our contract draft was wrong, not the code
k4black/codebleu/codebleu/parser/DFG.py
pointer only (licence: MIT); the stored copy get_code serves, from alex-haochenli/reco, is pointer only (licence: NONE) · get_code("ec263cd21fc00661")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from alex-haochenli/reco, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

pad_sequence Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
k4black/codebleu/codebleu/utils.py
code served (permissive licence) · get_code("43586244d847bf2e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned chain. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from itertools import chain

torch.manual_seed(0)

# Based on the function signature and docstring examples:
# - sequence: can be a list or iterable
# - n: integer representing ngram degree
# - pad_left: boolean
# - pad_right: boolean
# - left_pad_symbol: any object (string in examples)
# - right_pad_symbol: any object (string in examples)

ARGS = {
    "sequence": [1, 2, 3, 4, 5],
    "n": 2,
    "pad_left": True,
    "pad_right": True,
    "left_pad_symbol": "<s>",
    "right_pad_symbol": "</s>"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type chain — a chain output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a chain output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
remove_comments_and_docstrings Ran
ran on a synthesized input
k4black/codebleu/codebleu/parser/utils.py
code served (permissive licence) · get_code("415f22596f6fd32f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re
import tokenize
from io import StringIO

# Test with Python source code
python_source = '''
def hello():
    # This is a comment
    """This is a docstring"""
    x = 5  # inline comment
    return x
'''

# Test with C-style source code
c_source = '''
int main() {
    // This is a comment
    /* This is a block comment */
    int x = 5; // inline comment
    return x;
}
'''

# Test with Ruby source code
ruby_source = '''
def hello
  # This is a comment
  x = 5
  return x
end
'''

ARGS = {
    'source': python_source,
    'lang': 'python'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tree_to_token_index Ran
ran on a synthesized input
k4black/codebleu/codebleu/parser/utils.py
code served (permissive licence) · get_code("fd03d6988376fcfc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 3, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class TreeNode:
    def __init__(self, start_point, end_point, node_type, children=None):
        self.start_point = start_point
        self.end_point = end_point
        self.type = node_type
        self.children = children if children is not None else []

# Create a simple tree structure
leaf1 = TreeNode((0, 0), (0, 5), 'identifier')
leaf2 = TreeNode((0, 6), (0, 7), 'operator')
leaf3 = TreeNode((0, 8), (0, 9), 'string_literal')

parent = TreeNode((0, 0), (0, 9), 'expression', children=[leaf1, leaf2, leaf3])

root_node = TreeNode((0, 0), (1, 0), 'program', children=[parent])

ARGS = {
    'root_node': root_node
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 3, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tree_to_variable_index Ran
ran on a synthesized input
k4black/codebleu/codebleu/parser/utils.py
code served (permissive licence) · get_code("e94d80eee26382a1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from typing import Tuple, Dict, Any

class TreeNode:
    """Mock tree node class for AST traversal"""
    def __init__(self, node_type: str, start_point: Tuple[int, int], end_point: Tuple[int, int], children=None):
        self.type = node_type
        self.start_point = start_point
        self.end_point = end_point
        self.children = children if children is not None else []

# Build a simple tree structure
leaf_node_1 = TreeNode(
    node_type='identifier',
    start_point=(0, 0),
    end_point=(0, 3),
    children=[]
)

leaf_node_2 = TreeNode(
    node_type='number',
    start_point=(0, 5),
    end_point=(0, 6),
    children=[]
)

leaf_node_3 = TreeNode(
    node_type='string_literal',
    start_point=(1, 0),
    end_point=(1, 5),
    children=[]
)

parent_node = TreeNode(
    node_type='expression',
    start_point=(0, 0),
    end_point=(1, 5),
    children=[leaf_node_1, leaf_node_2, leaf_node_3]
)

root_node = TreeNode(
    node_type='program',
    start_point=(0, 0),
    end_point=(2, 0),
    children=[parent_node]
)

# Build index_to_code dictionary mapping (start_point, end_point) to (something, code_type)
index_to_code = {
    ((0, 0), (0, 3)): (None, 'identifier'),
    ((0, 5), (0, 6)): (None, 'number'),
    ((1, 0), (1, 5)): (None, 'string_literal'),
    ((0, 0), (1, 5)): (None, 'expression'),
    ((0, 0), (2, 0)): (None, 'program'),
}

ARGS = {
    'root_node': root_node,
    'index_to_code': index_to_code,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
DFG_java Not yet run
unverified (harvested, no recorded run)
k4black/codebleu/codebleu/parser/DFG.py
pointer only (licence: MIT); the stored copy get_code serves, from alex-haochenli/reco, is pointer only (licence: NONE) · get_code("8ad8aef57770407f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from alex-haochenli/reco, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

DFG_python Not yet run
unverified (harvested, no recorded run)
k4black/codebleu/codebleu/parser/DFG.py
pointer only (licence: MIT); the stored copy get_code serves, from alex-haochenli/reco, is pointer only (licence: NONE) · get_code("e9c213ae4e45bf1b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from alex-haochenli/reco, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

calc_codebleu Not yet run
unverified (harvested, no recorded run)
k4black/codebleu/codebleu/codebleu.py
code served (permissive licence) · get_code("38213de5abb9cc32")
How it ran

no invocation recorded.

corpus_bleu Not yet run
unverified (harvested, no recorded run)
k4black/codebleu/codebleu/bleu.py
code served (permissive licence) · get_code("2b511bace1ccabdd")
How it ran

no invocation recorded.

corpus_bleu Not yet run
unverified (harvested, no recorded run)
k4black/codebleu/codebleu/weighted_ngram_match.py
code served (permissive licence) · get_code("8d6567463aef1687")
How it ran

no invocation recorded.

get_data_flow Not yet run
unverified (harvested, no recorded run)
k4black/codebleu/codebleu/dataflow_match.py
code served (permissive licence) · get_code("5a7c7ae6af7f3761")
How it ran

no invocation recorded.

modified_precision Not yet run
unverified (harvested, no recorded run)
k4black/codebleu/codebleu/bleu.py
code served (permissive licence) · get_code("68e6098d18d043f3")
How it ran

no invocation recorded.

modified_recall Not yet run
unverified (harvested, no recorded run)
k4black/codebleu/codebleu/weighted_ngram_match.py
code served (permissive licence) · get_code("f0ec27f9d891d5bd")
How it ran

no invocation recorded.

sentence_bleu Not yet run
unverified (harvested, no recorded run)
k4black/codebleu/codebleu/bleu.py
code served (permissive licence) · get_code("25785b97398bb5cb")
How it ran

no invocation recorded.

sentence_bleu Not yet run
unverified (harvested, no recorded run)
k4black/codebleu/codebleu/weighted_ngram_match.py
code served (permissive licence) · get_code("24b6b81d4ef778a6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 5 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 4 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
pad_sequence 10 other papers
2 dated earlier, 8 later
1909.09436 (2019-09)
CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
1911.04700 (2019-11)
A Pre-training Based Personalized Dialogue Generation Model with Persona-sparse Data
2106.06169 (2021-06)
BoB: BERT Over BERT for Training Persona-based Dialogue Models from Limited Personalized Data
and 7 more not named here
DFG_csharp 1 other paper
1 later
2401.04514 (2024-01)
Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search
DFG_java 1 other paper
1 later
2401.04514 (2024-01)
Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search
DFG_python 1 other paper
1 later
2401.04514 (2024-01)
Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search
sentence_bleu 1 other paper
1 the same month
2009.07396 (2020-09)
Grounded Adaptation for Zero-shot Executable Semantic Parsing

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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 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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2009.10297")
get_code_for_paper("2009.10297")
have("2009.10297")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2009.10297.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2009.10297.svg)](https://syntology.ai/paper/2009.10297)

Connect an agent — have() is free.