SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.12655 · 2021

CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Tasks

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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; 5 failures of our instrument; 2 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/2105.12655.json · badge: /api/ran/2105.12655.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
IBM/Project_CodeNet canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
FunctionStatusWhere it lives
augment_edge Ran
ran; our contract draft was wrong, not the code
IBM/Project_CodeNet/model-experiments/gnn-based-experiments/src/utils.py
code served (permissive licence) · get_code("0bcee4eb7018f213")
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 PyGDataStandIn. 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

torch.manual_seed(0)

class PyGDataStandIn:
    def __init__(self):
        self.edge_index = None
        self.edge_attr = None
        self.edge_type = None
        self.node_is_attributed = None

# Create a minimal PyG data object
data = PyGDataStandIn()

# edge_index: 2 x num_edges (node indices for edges)
# Let's create 3 edges
data.edge_index = torch.tensor([
    [0, 1, 2],
    [1, 2, 0]
], dtype=torch.long)

# edge_type: num_edges x 1, sparse one-hot indices for num_edge_type classes
# With num_edge_type=2, we need indices in range [0, 1]
num_edges = data.edge_index.size(1)
data.edge_type = torch.tensor([[0], [1], [0]], dtype=torch.long)

# node_is_attributed: binary mask for nodes that are attributed
# We have nodes 0, 1, 2, let's mark some as attributed
# The function uses torch.where to find attributed nodes and creates next-token edges
data.node_is_attributed = torch.tensor([1, 1, 1], dtype=torch.long).view(-1, 1)

# num_edge_type parameter
num_edge_type = 2

ARGS = {
    "data": data,
    "num_edge_type": num_edge_type,
}
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 PyGDataStandIn — a PyGDataStandIn output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PyGDataStandIn 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
get_pos_encoding_matrix Ran
ran, honoured the contract we drafted
IBM/Project_CodeNet/model-experiments/masked-language-model/pos_enc.py
code served (permissive licence) · get_code("184dc34775d243e0")
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 ndarray, ndim 2, dtype family float, shape (8, 4) 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 numpy as np

def get_pos_encoding_matrix(max_len, d_emb):
    pos_enc = np.array([[pos / np.power(10000, 2 * (j // 2) / d_emb) for j in range(d_emb)] if pos != 0 else np.zeros(d_emb) for pos in range(max_len)])
    pos_enc[1:, 0::2] = np.sin(pos_enc[1:, 0::2])
    pos_enc[1:, 1::2] = np.cos(pos_enc[1:, 1::2])
    return pos_enc

ARGS = {
    "max_len": 8,
    "d_emb": 4
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (8, 4) — shape (8, 4) 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
loadLabels Ran
ran, honoured the contract we drafted
IBM/Project_CodeNet/Contest/ExampleSimAnalysis/TestSetEval.py
code served (permissive licence) · get_code("a79df12da738da95")
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 ndarray, ndim 1, dtype family int, shape (4,) 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 os
import csv
import tempfile
import numpy as np

# Create a temporary CSV file with test labels
temp_dir = tempfile.mkdtemp()
labels_file = os.path.join(temp_dir, 'labels.csv')

with open(labels_file, 'w', newline='') as f:
    writer = csv.writer(f)
    writer.writerow(['num', 'label'])
    writer.writerow(['0', '1'])
    writer.writerow(['1', '0'])
    writer.writerow(['2', '1'])
    writer.writerow(['3', '1'])

ARGS = {
    'filename': labels_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (4,) — shape (4,) 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
load_checkpoint Ran
ran; our contract draft was wrong, not the code
IBM/Project_CodeNet/model-experiments/gnn-based-experiments/src/utils_file.py
code served (permissive licence) · get_code("2a6c452ca6abc754")
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 tuple, 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 torch.nn as nn
import tempfile
import os

torch.manual_seed(0)

# Create a minimal model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal optimizer
model = SimpleModel()
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

# Create a checkpoint file with the required structure
checkpoint_data = {
    'model': model.state_dict(),
    'optimizer': optimizer.state_dict(),
    'results': {'accuracy': 0.95, 'loss': 0.05},
    'epoch': 10
}

# Create temporary checkpoint file
with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.pt') as f:
    checkpoint_fn = f.name

torch.save(checkpoint_data, checkpoint_fn)

# Create fresh model and optimizer for loading
fresh_model = SimpleModel()
fresh_optimizer = torch.optim.SGD(fresh_model.parameters(), lr=0.01)

ARGS = {
    'checkpoint_fn': checkpoint_fn,
    'model': fresh_model,
    'optimizer': fresh_optimizer
}
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 tuple, ndim 1, dtype family float — a tuple 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
load_checkpoint_results Ran
ran; our contract draft was wrong, not the code
IBM/Project_CodeNet/model-experiments/gnn-based-experiments/src/utils_file.py
code served (permissive licence) · get_code("94de0ec6531dda49")
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 dict. 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
import tempfile
import os

torch.manual_seed(0)

# Create a temporary checkpoint file with results
temp_dir = tempfile.mkdtemp()
checkpoint_fn = os.path.join(temp_dir, "checkpoint.pt")

# Create a sample results dict
sample_results = {
    "accuracy": 0.95,
    "loss": 0.05,
    "epoch": 10,
    "metrics": {"precision": 0.93, "recall": 0.97}
}

# Save the checkpoint
checkpoint_data = {
    "results": sample_results,
    "model_state": None
}
torch.save(checkpoint_data, checkpoint_fn)

ARGS = {
    "checkpoint_fn": checkpoint_fn
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
summary_report Ran
ran; our contract draft was wrong, not the code
IBM/Project_CodeNet/model-experiments/gnn-based-experiments/src/utils_file.py
code served (permissive licence) · get_code("3639e3692a982ac9")
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 tuple, 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 statistics

def summary_report(val_list):
    return (sum(val_list) / len(val_list), statistics.stdev(val_list) if len(val_list) > 1 else 0)

# Construct arguments
val_list = [1.5, 2.3, 3.1, 4.2, 5.0]

ARGS = {
    "val_list": val_list
}
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 tuple, ndim 1, dtype family float — a tuple 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
tokenize Ran
ran; our contract draft was wrong, not the code
IBM/Project_CodeNet/model-experiments/masked-language-model/infer.py
code served (permissive licence) · get_code("2eea921b0bf4fe00")
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

def tokenize(text):
    return text.split()

ARGS = {
    "text": "hello world python"
}
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 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
makeDataset Not yet run
unverified (harvested, no recorded run)
IBM/Project_CodeNet/Contest/ExampleSimAnalysis/TestSetEval.py
code served (permissive licence) · get_code("60c85e9c72ac92a0")
How it ran

no invocation recorded.

tokenizeFile Not yet run
unverified (harvested, no recorded run)
IBM/Project_CodeNet/Contest/ExampleSimAnalysis/TestSetEval.py
code served (permissive licence) · get_code("4b2e20f1da5bb1d8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 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.

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

Over the last several decades, software has been woven into the fabric of every aspect of our society. As software development surges and code infrastructure of enterprise applications ages, it is now more critical than ever to increase software development productivity and modernize legacy applications. Advances in deep learning and machine learning algorithms have enabled numerous breakthroughs, motivating researchers to leverage AI techniques to improve software development efficiency. Thus, the fast-emerging research area of AI for Code has garnered new interest and gathered momentum. In this paper, we present a large-scale dataset CodeNet, consisting of over 14 million code samples and about 500 million lines of code in 55 different programming languages, which is aimed at teaching AI to code. In addition to its large scale, CodeNet has a rich set of high-quality annotations to benchmark and help accelerate research in AI techniques for a variety of critical coding tasks, including code similarity and classification, code translation between a large variety of programming languages, and code performance (runtime and memory) improvement techniques. Additionally, CodeNet provides sample input and output test sets for 98.5% of the code samples, which can be used as an oracle for determining code correctness and potentially guide reinforcement learning for code quality improvements. As a usability feature, we provide several pre-processing tools in CodeNet to transform source code into representations that can be readily used as inputs into machine learning models. Results of code classification and code similarity experiments using the CodeNet dataset are provided as a reference. We hope that the scale, diversity and rich, high-quality annotations of CodeNet will offer unprecedented research opportunities at the intersection of AI and Software Engineering.

For agents

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

get_harvested_code_for_paper("2105.12655")
get_code_for_paper("2105.12655")
have("2105.12655")

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

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

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

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

Connect an agent — have() is free.