SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.12620 · NeurIPS · 2023

Promises and Pitfalls of Threshold-based Auto-labeling

Frederic Sala, Harit Vishwakarma, Heguang Lin, Ramya Korlakai

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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 5 have no contract verdict; 0 failures of our instrument; 3 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/2211.12620.json · badge: /api/ran/2211.12620.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
harit7/tbal-neurips-23 canonical (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
FunctionStatusWhere it lives
determine_threshold Ran
ran on a synthesized input
harit7/tbal-neurips-23/core/threshold_estimation.py
code served (permissive licence) · get_code("999cea17d0121cdc")
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. 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 numpy as np
from unittest.mock import MagicMock

# Create a simple logger mock
logger = MagicMock()
logger.debug = MagicMock()
logger.info = MagicMock()

# Create a mock validation dataset with Y attribute
val_ds = MagicMock()
val_ds.Y = np.array([0, 1, 0, 1, 2, 0, 1, 2, 0, 1])

# Create inference output dictionary with required keys
n_samples = 10
inf_out = {
    'labels': np.array([0, 1, 0, 1, 2, 0, 1, 2, 1, 0]),
    'confidence': np.array([0.95, 0.87, 0.92, 0.88, 0.91, 0.89, 0.85, 0.93, 0.82, 0.90]),
    'abs_logit': np.array([2.5, 2.1, 2.3, 2.2, 2.4, 2.15, 2.0, 2.6, 1.8, 2.35]),
    'energy_score': np.array([0.1, 0.15, 0.12, 0.14, 0.11, 0.13, 0.16, 0.09, 0.18, 0.10]),
}

# Create auto_lbl_conf dictionary
auto_lbl_conf = {
    'score_type': 'confidence',
    'C_1': 0.5,
    'ucb': 'hoeffding',
    'class_wise': 'independent',
}

# Create validation indices
val_idcs = list(range(n_samples))

# Create list of classes
lst_classes = [0, 1, 2]

ARGS = {
    'lst_classes': lst_classes,
    'inf_out': inf_out,
    'auto_lbl_conf': auto_lbl_conf,
    'val_ds': val_ds,
    'val_idcs': val_idcs,
    'logger': logger,
    'err_threshold': 0.01,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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_counts Ran
ran on a synthesized input
harit7/tbal-neurips-23/core/eval_utils.py
code served (permissive licence) · get_code("714479c11c15e671")
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 torch.nn as nn
import pandas as pd
from unittest.mock import Mock, MagicMock
import logging

torch.manual_seed(0)

# Create a mock logger
logger = Mock()
logger.info = Mock()

# Create a simple classifier
class SimpleClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)

# Create mock dataset class
class MockDataset:
    def __init__(self, size=10, num_features=4):
        self.X = torch.randn(size, num_features)
        self.Y = torch.randint(0, 2, (size,)).numpy()
        self.size = size

# Create a mock self object (the class instance)
class MockSelf:
    def __init__(self):
        self.logger = logger
        self.cur_clf = SimpleClassifier()
        self.conf = {
            'inference_conf': {'batch_size': 2}
        }
        
        # Create meta_df with required columns
        self.meta_df = pd.DataFrame({
            'idx': range(10),
            'label': [0, 1, 0, 1, 0, 1, 0, 1, 0, 1],
            'human_labeled': [True, True, False, False, False, False, True, True, False, False],
            'is_auto_labeled': [False, False, True, True, True, False, False, False, True, True],
            'is_val': [False, False, True, False, False, False, False, False, True, False]
        })
    
    def get_current_validation_count(self):
        return 2
    
    def get_current_unlabeled_count(self):
        return 3
    
    def get_training_data(self):
        return MockDataset(size=4, num_features=4)
    
    def get_test_error(self, clf, dataset, conf):
        # Return a mock test error
        return 0.15

mock_self = MockSelf()

# Create train and test sets
train_set = MockDataset(size=10, num_features=4)
test_set = MockDataset(size=5, num_features=4)

ARGS = {
    'self': mock_self,
    'train_set': train_set,
    'test_set': test_set
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, 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
get_test_error Ran
ran on a synthesized input
harit7/tbal-neurips-23/core/eval_utils.py
code served (permissive licence) · get_code("8f3979a6b9c23717")
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 torch
import numpy as np
from sklearn.metrics import accuracy_score

torch.manual_seed(0)

class MockClassifier:
    def predict(self, test_ds, inference_conf):
        # Must return a dict with 'labels' key
        batch_size = len(test_ds.Y)
        predicted_labels = np.random.randint(0, 2, size=batch_size)
        return {'labels': predicted_labels}

class MockDataset:
    def __init__(self):
        self.Y = np.array([0, 1, 0, 1])

class MockInferenceConfig:
    def __init__(self):
        self.threshold = 0.5

class MockSelf:
    pass

clf = MockClassifier()
test_ds = MockDataset()
inference_conf = MockInferenceConfig()
mock_self = MockSelf()

ARGS = {
    'self': mock_self,
    'clf': clf,
    'test_ds': test_ds,
    'inference_conf': inference_conf
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — 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
get_test_error Ran
ran on a synthesized input
harit7/tbal-neurips-23/core/model_utils.py
code served (permissive licence) · get_code("3e9ddafcf8019ef9")
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 torch
import numpy as np
from sklearn.metrics import accuracy_score

torch.manual_seed(0)

# Create a minimal classifier that implements predict()
class MinimalClassifier:
    def predict(self, test_ds, inference_conf):
        # Predict random labels matching the test set size
        num_samples = len(test_ds.Y)
        predicted_labels = np.random.randint(0, 2, num_samples)
        return {'labels': predicted_labels}

# Create a minimal test dataset
class MinimalTestDataset:
    def __init__(self):
        # True labels for test set (3 samples, binary classification)
        self.Y = np.array([0, 1, 1])
    
    def __len__(self):
        return len(self.Y)

# Create inference config as a simple dict
inference_conf = {'model_type': 'test', 'threshold': 0.5}

# Instantiate objects
clf = MinimalClassifier()
test_ds = MinimalTestDataset()

ARGS = {
    'clf': clf,
    'test_ds': test_ds,
    'inference_conf': inference_conf
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — 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
run_inference Ran
ran on a synthesized input
harit7/tbal-neurips-23/core/model_utils.py
code served (permissive licence) · get_code("11ad02da29544252")
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 Tensor, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal dataset (list of batches with (x, y) tuples)
class MinimalDataset:
    def __init__(self):
        self.data = [
            (torch.randn(2, 4), torch.randint(0, 2, (2,))),
            (torch.randn(2, 4), torch.randint(0, 2, (2,)))
        ]
    
    def __iter__(self):
        return iter(self.data)
    
    def __len__(self):
        return len(self.data)

# Create a minimal classifier with predict method
class MinimalClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)
    
    def predict(self, ds, inference_conf):
        predictions = []
        for x, y in ds:
            logits = self.forward(x)
            preds = torch.argmax(logits, dim=1)
            predictions.append(preds)
        return torch.cat(predictions, dim=0)

# Create inference config
class InferenceConfig:
    def __init__(self):
        self.batch_size = 2
        self.num_workers = 0

# Create a minimal logger
class MinimalLogger:
    def info(self, msg):
        pass
    
    def debug(self, msg):
        pass
    
    def warning(self, msg):
        pass

# Construct arguments
ds = MinimalDataset()
clf = MinimalClassifier()
inference_conf = InferenceConfig()
logger = MinimalLogger()

ARGS = {
    "ds": ds,
    "clf": clf,
    "inference_conf": inference_conf,
    "logger": logger
}
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 Tensor, 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
run_active_learnling_auto_labeling Not yet run
unverified (harvested, no recorded run)
harit7/tbal-neurips-23/core/run_lib.py
code served (permissive licence) · get_code("06b3caad923b59ac")
How it ran

no invocation recorded.

run_passive_labeling_auto_labeling Not yet run
unverified (harvested, no recorded run)
harit7/tbal-neurips-23/core/run_lib.py
code served (permissive licence) · get_code("e64b9a09effe7244")
How it ran

no invocation recorded.

run_tbal_conf Not yet run
unverified (harvested, no recorded run)
harit7/tbal-neurips-23/core/run_lib.py
code served (permissive licence) · get_code("c2d5eb14dae211a1")
How it ran

no invocation recorded.

Also present in other papers' code

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

Creating large-scale high-quality labeled datasets is a major bottleneck in supervised machine learning workflows. Threshold-based auto-labeling (TBAL), where validation data obtained from humans is used to find a confidence threshold above which the data is machine-labeled, reduces reliance on manual annotation. TBAL is emerging as a widely-used solution in practice. Given the long shelf-life and diverse usage of the resulting datasets, understanding when the data obtained by such auto-labeling systems can be relied on is crucial. This is the first work to analyze TBAL systems and derive sample complexity bounds on the amount of human-labeled validation data required for guaranteeing the quality of machine-labeled data. Our results provide two crucial insights. First, reasonable chunks of unlabeled data can be automatically and accurately labeled by seemingly bad models. Second, a hidden downside of TBAL systems is potentially prohibitive validation data usage. Together, these insights describe the promise and pitfalls of using such systems. We validate our theoretical guarantees with extensive experiments on synthetic and real datasets. 1 2

For agents

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

get_harvested_code_for_paper("2211.12620")
get_code_for_paper("2211.12620")
have("2211.12620")

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

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

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

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

Connect an agent — have() is free.