SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2208.03133 · 2022

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

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 1 failure of our instrument; 0 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/2208.03133.json · badge: /api/ran/2208.03133.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
JetBrains-Research/codegen-metrics canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
ast_match Ran
ran, honoured the contract we drafted
JetBrains-Research/codegen-metrics/metrics_evaluation/metrics/codebleu/codebleu.py
code served (permissive licence) · get_code("cae2293698e4d173")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 itertools

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

class MockTree:
    def __init__(self, root_node):
        self.root_node = root_node

class MockParser:
    def parse(self, code_bytes):
        # Simple mock parser that creates a tree structure
        # For valid code, return a tree; for invalid, raise exception
        code_str = code_bytes.decode('utf8')
        
        if code_str.strip() == "":
            raise ValueError("Empty code")
        
        if "error" in code_str.lower():
            raise ValueError("Parse error")
        
        # Create a simple tree structure for valid input
        leaf1 = MockNode("identifier")
        leaf2 = MockNode("number")
        branch = MockNode("expression", [leaf1, leaf2])
        root = MockNode("program", [branch])
        
        return MockTree(root)

# Create reference and candidate code strings
reference_code = "x = 42"
candidate_code = "y = 42"

# Create parser instance
parser = MockParser()

ARGS = {
    "reference": reference_code,
    "candidate": candidate_code,
    "parser": parser
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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_match Ran
ran, honoured the contract we drafted
JetBrains-Research/codegen-metrics/metrics_evaluation/metrics/codebleu/codebleu.py
code served (permissive licence) · get_code("cc2207e2b988a83d")
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 int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 networkx as nx

# Mock module for AstGraphGenerator
class MockAstGraphGenerator:
    def __init__(self, code, lattice):
        self.code = code
        self.lattice = lattice
    
    def build(self):
        # Return a minimal valid graph structure
        return {
            'token-sequence': [0, 1, 2],
            'nodes': {0: 'a', 1: 'b', 2: 'c'},
            'edges': {
                'NEXT_USE': {0: [1], 1: [2]},
                'OCCURRENCE_OF': {0: [0], 1: [1], 2: [2]}
            }
        }

# Mock module that contains AstGraphGenerator
class gg:
    @staticmethod
    def AstGraphGenerator(code, lattice):
        return MockAstGraphGenerator(code, lattice)

# Inject the mock into the module namespace
import sys
mock_module = type(sys)('gg')
mock_module.AstGraphGenerator = MockAstGraphGenerator
sys.modules['gg'] = mock_module

# Define minimal arguments for dfg_match
ARGS = {
    'reference': 'int x = 5;',
    'candidate': 'int y = 5;',
    'lattice': {'dummy': True}
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
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
tokenize_builtin Ran
ran; our contract draft was wrong, not the code
JetBrains-Research/codegen-metrics/metrics_evaluation/metrics/codebleu/codebleu.py
code served (permissive licence) · get_code("90b57eda04fc0532")
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 tokenize
import re
from io import BytesIO
from typing import List, Optional, Union, Any

def tokenize_tranx(code: str) -> List[str]:
    """The tokenizer taken from https://github.com/pcyin/tranX
    Originally from Wang Ling et al.,
    Latent Predictor Networks for Code Generation (2016)
    @param code: string containing a code snippet
    @return: list of code tokens
    """
    code = re.sub('([^A-Za-z0-9_])', ' \\1 ', code)
    code = re.sub('([a-z])([A-Z])', '\\1 \\2', code)
    code = re.sub('\\s+', ' ', code)
    code = code.replace('"', '`')
    code = code.replace("'", '`')
    tokens = [t for t in code.split(' ') if t]
    return tokens

def tokenize_builtin(code: str) -> List[str]:
    try:
        tokens = list(tokenize.tokenize(BytesIO(code.encode('utf-8')).readline))[1:-1]
        tokens = [token.string for token in tokens]
        return tokens
    except tokenize.TokenError:
        return tokenize_tranx(code)

# Setup code
ARGS = {
    "code": "def hello(x):\n    return x + 1"
}
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 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

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 3 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.

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

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.

For agents

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

get_harvested_code_for_paper("2208.03133")
get_code_for_paper("2208.03133")
have("2208.03133")

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

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

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

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

Connect an agent — have() is free.