SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2107.07511 · 2021

A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification

arXiv · PDF · Open in the Atlas

Code that ran

6 of 12 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 6 have no contract verdict; 0 failures of our instrument; 6 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/2107.07511.json · badge: /api/ran/2107.07511.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
aangelopoulos/conformal-prediction canonical (classifier label)
classifier basis: census
6 ran · 6 no recorded run
FunctionStatusWhere it lives
get_all_predictions Ran
ran on a synthesized input
aangelopoulos/conformal-prediction/generation-scripts/generate-toxic-text.py
code served (permissive licence) · get_code("b1487d43d9b82b8e")
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 torch.nn as nn

torch.manual_seed(0)

class MockToxicityModel(nn.Module):
    """Minimal model that implements the predict method used by get_all_predictions"""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def predict(self, input_batch):
        """
        Takes a batch of inputs and returns a dict with 'toxicity' key
        containing a list of toxicity scores.
        """
        # input_batch is a list of strings or tokens
        batch_size = len(input_batch)
        # Return a dict with 'toxicity' key containing a list
        toxicity_scores = [0.1 * i for i in range(batch_size)]
        return {'toxicity': toxicity_scores}

# Create model instance
model = MockToxicityModel()

# Create input_list with 500 text samples (to test batching with step_size=200)
input_list = [f"sample text {i}" for i in range(500)]

# step_size parameter
step_size = 200

ARGS = {
    'model': model,
    'input_list': input_list,
    'step_size': step_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
get_all_predictions Ran
ran on a synthesized input
aangelopoulos/conformal-prediction/generation-scripts/generate-weather.py
code served (permissive licence) · get_code("efa4ce1b7f9169bf")
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 3, dtype family float, shape (3, 2, 2) 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

class SimpleModel:
    """Minimal model that implements predict method"""
    def predict(self, features_df):
        """Return predictions as [num_samples x 2] array of [mean, variance]"""
        num_samples = len(features_df)
        # Return array with shape (num_samples, 2)
        return np.random.randn(num_samples, 2)

# Create a small features dataframe-like object (using dict with array values)
features_df = {
    'feature_1': np.array([1.0, 2.0]),
    'feature_2': np.array([3.0, 4.0])
}

# Create a list of models
models_list = [
    SimpleModel(),
    SimpleModel(),
    SimpleModel()
]

ARGS = {
    'features_df': features_df,
    'models_list': models_list
}
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 3, dtype family float, shape (3, 2, 2) — shape (3, 2, 2) 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_correspondences Ran
ran on a synthesized input
aangelopoulos/conformal-prediction/generation-scripts/coco_utils/custom_coco_dataloader.py
code served (permissive licence) · get_code("1325ba1c4cdd1fdb")
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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# - model_arr: needs .shape[0] to work (array-like with shape attribute)
# - dset_dict: needs .keys() method (dict-like)
# The function iterates through model_arr.shape[0] items and maps them to keys from dset_dict

# Create model_arr as a numpy array with shape (3, 4)
model_arr = np.zeros((3, 4))

# Create dset_dict with 3 keys (to match model_arr.shape[0])
dset_dict = {
    'key_0': 'value_0',
    'key_1': 'value_1',
    'key_2': 'value_2'
}

ARGS = {
    'model_arr': model_arr,
    'dset_dict': dset_dict
}
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 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_scores_targets Ran
ran on a synthesized input
aangelopoulos/conformal-prediction/generation-scripts/generate-coco.py
code served (permissive licence) · get_code("300f5a8e0756977f")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np

torch.manual_seed(0)

# Build a minimal model that takes input and outputs logits
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 80)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

# Build a minimal loader-like object
class SimpleLoader:
    def __init__(self):
        self.dataset = SimpleDataset()
    
    def __iter__(self):
        return iter(self.dataset)

class SimpleDataset:
    def __init__(self):
        self.data = [
            (torch.randn(2, 4), torch.randint(0, 2, (2, 80)), ("path1.txt", "path2.txt")),
            (torch.randn(2, 4), torch.randint(0, 2, (2, 80)), ("path3.txt", "path4.txt")),
        ]
    
    def __len__(self):
        return 4
    
    def __iter__(self):
        for item in self.data:
            yield item

loader = SimpleLoader()

ARGS = {
    "model": model,
    "loader": loader,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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
process_data Ran
ran on a synthesized input
aangelopoulos/conformal-prediction/generation-scripts/generate-meps.py
code served (permissive licence) · get_code("2d8548445f52ae8b")
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 sklearn.preprocessing import StandardScaler

# Create small sample data for the function
np.random.seed(0)

# X_train: shape (5, 4) - 5 samples, 4 features
X_train = np.random.randn(5, 4).astype(np.float32)

# X_val: shape (3, 4) - 3 samples, 4 features
X_val = np.random.randn(3, 4).astype(np.float32)

# y_train: shape (5,) or (5, 1) - 5 targets
y_train = np.random.rand(5, 1).astype(np.float32) * 10

# y_val: shape (3,) or (3, 1) - 3 targets
y_val = np.random.rand(3, 1).astype(np.float32) * 10

ARGS = {
    "X_train": X_train,
    "X_val": X_val,
    "y_train": y_train,
    "y_val": y_val,
}
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
shuffle_split Ran
ran on a synthesized input
aangelopoulos/conformal-prediction/generation-scripts/generate-meps.py
code served (permissive licence) · get_code("8d492647823d7514")
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

# Set seed for reproducibility
np.random.seed(42)

# Create small sample data
# X: feature matrix with shape (4, 3) - 4 samples, 3 features
X = np.array([
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0],
    [7.0, 8.0, 9.0],
    [10.0, 11.0, 12.0]
])

# y: labels with shape (4,) - 4 labels
y = np.array([0, 1, 0, 1])

ARGS = {
    "X": X,
    "y": y
}
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 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
active_group Not yet run
unverified (harvested, no recorded run)
aangelopoulos/conformal-prediction/generation-scripts/coco_utils/inplace_abn/group.py
code served (permissive licence) · get_code("5b799a07abfc017d")
How it ran

no invocation recorded.

get_num_examples Not yet run
unverified (harvested, no recorded run)
aangelopoulos/conformal-prediction/generation-scripts/generate-polyps.py
code served (permissive licence) · get_code("9d4ce078da66a9c2")
How it ran

no invocation recorded.

get_predictions Not yet run
unverified (harvested, no recorded run)
aangelopoulos/conformal-prediction/generation-scripts/generate-weather.py
code served (permissive licence) · get_code("e59f13aa6b501cde")
How it ran

no invocation recorded.

inplace_abn Not yet run
unverified (harvested, no recorded run)
aangelopoulos/conformal-prediction/generation-scripts/coco_utils/inplace_abn/functions.py
code served (permissive licence) · get_code("44c99d4e4336bbd2")
How it ran

no invocation recorded.

inplace_abn_sync Not yet run
unverified (harvested, no recorded run)
aangelopoulos/conformal-prediction/generation-scripts/coco_utils/inplace_abn/functions.py
code served (permissive licence) · get_code("99d9977c14c7d1cd")
How it ran

no invocation recorded.

optimize_params_GBR Not yet run
unverified (harvested, no recorded run)
aangelopoulos/conformal-prediction/generation-scripts/generate-meps.py
code served (permissive licence) · get_code("28bd6e53199d53c5")
How it ran

no invocation recorded.

Also present in other papers' code

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

Black-box machine learning models are now routinely used in high-risk settings, like medical diagnostics, which demand uncertainty quantification to avoid consequential model failures. Conformal prediction is a user-friendly paradigm for creating statistically rigorous uncertainty sets/intervals for the predictions of such models. Critically, the sets are valid in a distribution-free sense: they possess explicit, non-asymptotic guarantees even without distributional assumptions or model assumptions. One can use conformal prediction with any pre-trained model, such as a neural network, to produce sets that are guaranteed to contain the ground truth with a user-specified probability, such as 90%. It is easy-to-understand, easy-to-use, and general, applying naturally to problems arising in the fields of computer vision, natural language processing, deep reinforcement learning, and so on. This hands-on introduction is aimed to provide the reader a working understanding of conformal prediction and related distribution-free uncertainty quantification techniques with one self-contained document. We lead the reader through practical theory for and examples of conformal prediction and describe its extensions to complex machine learning tasks involving structured outputs, distribution shift, time-series, outliers, models that abstain, and more. Throughout, there are many explanatory illustrations, examples, and code samples in Python. With each code sample comes a Jupyter notebook implementing the method on a real-data example; the notebooks can be accessed and easily run using our codebase.

For agents

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

get_harvested_code_for_paper("2107.07511")
get_code_for_paper("2107.07511")
have("2107.07511")

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

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

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

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

Connect an agent — have() is free.