SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.00301 · 2022

Can we learn from developer mistakes? Learning to localize and repair real bugs from real bug fixes

arXiv · PDF · Open in the Atlas

Code that ran

9 of 13 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 9 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/2207.00301.json · badge: /api/ran/2207.00301.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
cedricrupb/nbfbaselines canonical (classifier label)
classifier basis not recorded on the link
9 ran · 4 no recorded run
FunctionStatusWhere it lives
beam_search Ran
ran on a synthesized input
cedricrupb/nbfbaselines/nbfbaselines/nbfbase.py
code served (permissive licence) · get_code("3de1111ec7a95d67")
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 2, 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

torch.manual_seed(0)

# loc_logprobs: tensor of shape (num_locations,) with log probabilities
# The function calls .topk() on it and indexes it with integers
loc_logprobs = torch.randn(4)

# repair_logprobs: tensor of shape (num_locations, num_repairs) with log probabilities
# The function indexes it with loc_tk_index values and calls .topk() on each row
repair_logprobs = torch.randn(4, 3)

# beam_width: integer controlling the beam width for search
beam_width = 2

ARGS = {
    "loc_logprobs": loc_logprobs,
    "repair_logprobs": repair_logprobs,
    "beam_width": beam_width,
}
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 2, 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
cluster_beam_search Ran
ran on a synthesized input
cedricrupb/nbfbaselines/nbfbaselines/nbfbase.py
code served (permissive licence) · get_code("99f7631d379a21ec")
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 2, 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

torch.manual_seed(0)

# cluster_beam_search parameters:
# - cluster_assign: 1D tensor of cluster assignments
# - loc_logprobs: 1D tensor of location log probabilities
# - repair_logprobs: 2D tensor of repair log probabilities (num_locs x num_repairs)
# - beam_width: integer

# Create cluster_assign: assigns each repair to a cluster
# Let's say we have 5 repairs assigned to 3 clusters
cluster_assign = torch.tensor([0, 0, 1, 1, 2])

# Create loc_logprobs: log probabilities for 4 locations
loc_logprobs = torch.log(torch.tensor([0.4, 0.3, 0.2, 0.1]))

# Create repair_logprobs: 4 locations x 5 repairs
# Each location has probabilities over 5 possible repairs
repair_logprobs = torch.log(torch.tensor([
    [0.2, 0.2, 0.2, 0.2, 0.2],
    [0.3, 0.3, 0.2, 0.1, 0.1],
    [0.1, 0.1, 0.1, 0.3, 0.4],
    [0.25, 0.25, 0.25, 0.15, 0.1]
]))

# beam_width: controls how many candidates to keep
beam_width = 3

ARGS = {
    "cluster_assign": cluster_assign,
    "loc_logprobs": loc_logprobs,
    "repair_logprobs": repair_logprobs,
    "beam_width": beam_width
}
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 2, 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
compute_repair_cluster Ran
ran on a synthesized input
cedricrupb/nbfbaselines/nbfbaselines/nbfbase.py
code served (permissive licence) · get_code("ca8e831b75f8c49b")
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 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.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - tokens: iterated over, checked with 'not in' operator, appended to cluster_assign
# - target_vocabulary: optional, iterated over if not None, checked with 'not in' operator
# Both can be lists or any iterable of hashable objects (strings, ints, etc.)

ARGS = {
    "tokens": ["hello", "world", "hello", "foo"],
    "target_vocabulary": ["hello", "bar", "baz"]
}
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 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
config_from_model_size Ran
ran on a synthesized input
cedricrupb/nbfbaselines/nbfbaselines/models/encoder/transformer.py
code served (permissive licence) · get_code("8bec0b9f4c427128")
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 TransformerConfig. 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 numpy as np
from dataclasses import dataclass

torch.manual_seed(0)

@dataclass
class TransformerConfig:
    embedding_size: int = 512
    hidden_size: int = 512
    intermediate_size: int = 2048
    num_layers: int = 6
    num_heads: int = 8
    max_length: int = 512
    dropout: float = 0.1
    pad_token_id: int = 0
    sinoid: bool = True
    relative_attention: bool = False

    def copy_from_nbfconfig(self, nbf_config):
        self.embedding_size = nbf_config.embedding_size
        self.max_length = nbf_config.max_sequence_length
        self.hidden_size = nbf_config.hidden_size
        self.pad_token_id = nbf_config.pad_token_id

def small_model_config():
    return TransformerConfig(embedding_size=512, hidden_size=512, intermediate_size=2048, num_layers=4, num_heads=8)

def medium_model_config():
    return TransformerConfig()

def config_from_model_size(model_size):
    if model_size == 'small':
        return small_model_config()
    if model_size == 'medium':
        return medium_model_config()
    raise ValueError('Unknown model size: %s' % model_size)

ARGS = {
    'model_size': 'small'
}
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 TransformerConfig — a TransformerConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a TransformerConfig 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
detect_to_hf_config Ran
ran on a synthesized input
cedricrupb/nbfbaselines/nbfbaselines/models/encoder/transformer.py
code served (permissive licence) · get_code("499aab65a443dd65")
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 BertConfig. 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 torch.nn as nn
from transformers import BertModel, BertConfig

torch.manual_seed(0)

class DetectConfig:
    """Stand-in config class matching the attributes accessed in detect_to_hf_config"""
    def __init__(self):
        self.hidden_size = 128
        self.intermediate_size = 512
        self.num_layers = 4
        self.num_heads = 8
        self.max_length = 256
        self.dropout = 0.1
        self.pad_token_id = 0
        self.relative_attention = False

config = DetectConfig()

ARGS = {
    "config": config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BertConfig — a BertConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BertConfig 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
embedding_from_config Ran
ran on a synthesized input
cedricrupb/nbfbaselines/nbfbaselines/models/embeddings.py
code served (permissive licence) · get_code("438f85d475301aa5")
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 SubtokenEmbeddings. 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 torch import nn

torch.manual_seed(0)

class Config:
    def __init__(self, embedding_type, vocabulary_size, embedding_size, pad_token_id):
        self.embedding_type = embedding_type
        self.vocabulary_size = vocabulary_size
        self.embedding_size = embedding_size
        self.pad_token_id = pad_token_id
        self.vocab_size = vocabulary_size

config = Config(
    embedding_type='max_pool',
    vocabulary_size=100,
    embedding_size=16,
    pad_token_id=0
)

ARGS = {
    'config': config
}
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 SubtokenEmbeddings — a SubtokenEmbeddings output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SubtokenEmbeddings 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
load_model_directory Ran
ran on a synthesized input
cedricrupb/nbfbaselines/nbfbaselines/utils.py
code served (permissive licence) · get_code("89d1192e626d5f31")
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 os
import tempfile
import shutil

# Create a temporary directory to act as a mock local cache
temp_dir = tempfile.mkdtemp()

# Create a mock model directory structure
mock_model_name = "test_model"
mock_model_path = os.path.join(temp_dir, mock_model_name)
os.makedirs(mock_model_path, exist_ok=True)

# Create a dummy file in the model directory to make it a valid directory
with open(os.path.join(mock_model_path, "dummy.txt"), "w") as f:
    f.write("test")

# Test with an existing path
ARGS = {
    "name_or_path": mock_model_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — 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
pprint_simple Ran
ran on a synthesized input
cedricrupb/nbfbaselines/nbfbaselines/tokenizer/code_tokenizer.py
code served (permissive licence) · get_code("9a084ad2923860d1")
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 torch

torch.manual_seed(0)

# The function pprint_simple takes tokens and joins them with spaces
# tokens should be a list or iterable of strings
tokens = ["hello", "world", "test"]

ARGS = {
    "tokens": tokens
}
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 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
preprocessor_from_config Ran
ran on a synthesized input
cedricrupb/nbfbaselines/nbfbaselines/tokenizer/preprocessors.py
code served (permissive licence) · get_code("67a0d12451d90eb7")
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 Preprocessor. 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 numpy as np

class Config:
    def __init__(self, add_special_tokens=True, str_cutoff=10):
        self.add_special_tokens = add_special_tokens
        self.str_cutoff = str_cutoff

config = Config(add_special_tokens=True, str_cutoff=10)
target_vocab = ["hello", "world", "fix", "bug"]

ARGS = {
    "config": config,
    "target_vocab": target_vocab
}
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 Preprocessor — a Preprocessor output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Preprocessor 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
convert_target_to_mask Not yet run
unverified (harvested, no recorded run)
cedricrupb/nbfbaselines/nbfbaselines/models/heads.py
code served (permissive licence) · get_code("dbd8052b8ff6d85b")
How it ran

no invocation recorded.

download_model Not yet run
unverified (harvested, no recorded run)
cedricrupb/nbfbaselines/nbfbaselines/utils.py
code served (permissive licence) · get_code("01d60c8ad17b5931")
How it ran

no invocation recorded.

nbf_head_from_config Not yet run
unverified (harvested, no recorded run)
cedricrupb/nbfbaselines/nbfbaselines/models/heads.py
code served (permissive licence) · get_code("fdde973d0528d05f")
How it ran

no invocation recorded.

pretty_print Not yet run
unverified (harvested, no recorded run)
cedricrupb/nbfbaselines/nbfbaselines/tokenizer/code_tokenizer.py
code served (permissive licence) · get_code("0cab7c1484be7abc")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

Real bug fixes found in open source repositories seem to be the perfect source for learning to localize and repair real bugs. However, the absence of large scale bug fix collections has made it difficult to effectively exploit real bug fixes in the training of larger neural models in the past. In contrast, artificial bugs -- produced by mutating existing source code -- can be easily obtained at a sufficient scale and are therefore often preferred in the training of existing approaches. Still, localization and repair models that are trained on artificial bugs usually underperform when faced with real bugs. This raises the question whether bug localization and repair models trained on real bug fixes are more effective in localizing and repairing real bugs. We address this question by introducing RealiT, a pre-train-and-fine-tune approach for effectively learning to localize and repair real bugs from real bug fixes. RealiT is first pre-trained on a large number of artificial bugs produced by traditional mutation operators and then fine-tuned on a smaller set of real bug fixes. Fine-tuning does not require any modifications of the learning algorithm and hence can be easily adopted in various training scenarios for bug localization or repair (even when real training data is scarce). In addition, we found that training on real bug fixes with RealiT is empirically powerful by nearly doubling the localization performance of an existing model on real bugs while maintaining or even improving the repair performance.

For agents

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

get_harvested_code_for_paper("2207.00301")
get_code_for_paper("2207.00301")
have("2207.00301")

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

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

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

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

Connect an agent — have() is free.