SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1910.12656 · 2019

Beyond temperature scaling: Obtaining well-calibrated multiclass probabilities with Dirichlet calibration

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 2 have no contract verdict; 4 failures of our instrument; 1 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/1910.12656.json · badge: /api/ran/1910.12656.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
AnanyaKumar/verified_calibration canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
get_equal_bins Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AnanyaKumar/verified_calibration/calibration/utils.py
code served (permissive licence) · get_code("7dc9736cdb2847c4")
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 numpy as np
from typing import List

def split(sequence: List, parts: int) -> List[List]:
    assert parts <= len(sequence)
    array_splits = np.array_split(sequence, parts)
    splits = [list(l) for l in array_splits]
    assert len(splits) == parts
    return splits

def get_equal_bins(probs: List[float], num_bins: int=10) -> List[float]:
    """Get bins that contain approximately an equal number of data points."""
    sorted_probs = sorted(probs)
    if num_bins > len(sorted_probs):
        num_bins = len(sorted_probs)
    binned_data = split(sorted_probs, num_bins)
    bins: List[float] = []
    for i in range(len(binned_data) - 1):
        last_prob = binned_data[i][-1]
        next_first_prob = binned_data[i + 1][0]
        bins.append((last_prob + next_first_prob) / 2.0)
    bins.append(1.0)
    bins = sorted(list(set(bins)))
    return bins

# Create test arguments
probs_list = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 1.0]
num_bins_value = 5

ARGS = {
    "probs": probs_list,
    "num_bins": num_bins_value
}
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 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_equal_prob_bins Ran
ran; our contract draft was wrong, not the code
AnanyaKumar/verified_calibration/calibration/utils.py
code served (permissive licence) · get_code("d1ebc0d7093a4203")
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 numpy as np
from typing import List

torch.manual_seed(0)

# Construct arguments for get_equal_prob_bins
probs = [0.1, 0.2, 0.3, 0.4]
num_bins = 10

ARGS = {
    "probs": probs,
    "num_bins": num_bins
}
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 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_estimates Ran
ran on a synthesized input
AnanyaKumar/verified_calibration/experiments/debiased_estimator/estimation_error_vs_bins.py
code served (permissive licence) · get_code("ca51b3357d101746")
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, 100) 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

# Define small estimator functions that take (probs, labels) and return a scalar estimate
def estimator_1(probs, labels):
    """Simple mean accuracy estimator"""
    if len(labels) == 0:
        return 0.0
    return np.mean(labels)

def estimator_2(probs, labels):
    """Weighted estimator based on confidence"""
    if len(labels) == 0:
        return 0.0
    weights = np.array(probs)
    labels_arr = np.array(labels)
    return np.average(labels_arr, weights=weights)

def estimator_3(probs, labels):
    """Simple count-based estimator"""
    if len(labels) == 0:
        return 0.0
    return float(sum(labels)) / len(labels)

# Create verification data
np.random.seed(0)
verification_size = 10
verification_probs = [0.7, 0.8, 0.6, 0.9, 0.5, 0.75, 0.85, 0.65, 0.55, 0.95]
verification_labels = [1, 1, 0, 1, 0, 1, 1, 0, 0, 1]
verification_sizes = [3, 5]
estimators = [estimator_1, estimator_2, estimator_3]

ARGS = {
    "estimators": estimators,
    "verification_probs": verification_probs,
    "verification_labels": verification_labels,
    "verification_sizes": verification_sizes,
    "num_resamples": 100
}
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, 100) — shape (3, 2, 100) 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
platt_function Ran
ran; our contract draft was wrong, not the code
AnanyaKumar/verified_calibration/experiments/synthetic/synthetic.py
code served (permissive licence) · get_code("56cc136e85aa5fe3")
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 vectorize. 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

# The platt_function takes two parameters: a and b
# These are used as scalar coefficients in a linear transformation
# Looking at the function body:
#   x = a * x + b
# Both a and b should be scalar values (floats or numpy scalars)

# Create scalar parameters for the Platt function
a = 0.5  # scaling parameter
b = 0.2  # bias parameter

ARGS = {
    "a": a,
    "b": b,
}
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 vectorize — a vectorize output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a vectorize 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
sample Ran
ran on a synthesized input
AnanyaKumar/verified_calibration/experiments/synthetic/synthetic.py
code served (permissive licence) · get_code("fd20403a2948aca9")
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 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 numpy as np
from scipy import stats

np.random.seed(0)

# Define z_dist: a callable that takes size=n and returns n samples
# The function calls z_dist(size=n), so we need a callable with a size parameter
z_dist = lambda size: np.random.normal(loc=0.0, scale=1.0, size=size)

# Define f: a function that takes zs (array of shape (n,)) and returns ps (probabilities in [0,1])
# The function calls f(zs) and expects output ps that can be used with np.random.binomial
def f(zs):
    # Simple sigmoid to map real values to [0, 1]
    return 1.0 / (1.0 + np.exp(-zs))

# n: number of samples
n = 5

ARGS = {
    "f": f,
    "z_dist": z_dist,
    "n": n
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, 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
split Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AnanyaKumar/verified_calibration/calibration/utils.py
code served (permissive licence) · get_code("8e9dfd4ba4bf9fa3")
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. 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 typing import List, TypeVar

T = TypeVar('T')

# Set seed for reproducibility
torch.manual_seed(0)
np.random.seed(0)

# The function takes a sequence (List[T]) and an integer parts
# It uses np.array_split to split the sequence into parts
# The sequence can be any list-like object

# Create a simple test sequence
test_sequence = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
num_parts = 3

ARGS = {
    "sequence": test_sequence,
    "parts": num_parts
}
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 — a list 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
noisy_platt_function Not yet run
unverified (harvested, no recorded run)
AnanyaKumar/verified_calibration/experiments/synthetic/synthetic.py
code served (permissive licence) · get_code("67827229f7eabf76")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
get_equal_bins 2 other papers
2 later
2312.04021 (2023-12)
A Study on the Calibration of In-context Learning
2410.10414 (2024-10)
On Calibration of LLM-based Guard Models for Reliable Content Moderation
get_equal_prob_bins 2 other papers
2 later
2312.04021 (2023-12)
A Study on the Calibration of In-context Learning
2410.10414 (2024-10)
On Calibration of LLM-based Guard Models for Reliable Content Moderation
split 2 other papers
2 later
2312.04021 (2023-12)
A Study on the Calibration of In-context Learning
2410.10414 (2024-10)
On Calibration of LLM-based Guard Models for Reliable Content Moderation
platt_function 1 other paper
1 dated earlier
1909.10155 (2019-09)
Verified Uncertainty Calibration

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

Class probabilities predicted by most multiclass classifiers are uncalibrated, often tending towards over-confidence. With neural networks, calibration can be improved by temperature scaling, a method to learn a single corrective multiplicative factor for inputs to the last softmax layer. On non-neural models the existing methods apply binary calibration in a pairwise or one-vs-rest fashion. We propose a natively multiclass calibration method applicable to classifiers from any model class, derived from Dirichlet distributions and generalising the beta calibration method from binary classification. It is easily implemented with neural nets since it is equivalent to log-transforming the uncalibrated probabilities, followed by one linear layer and softmax. Experiments demonstrate improved probabilistic predictions according to multiple measures (confidence-ECE, classwise-ECE, log-loss, Brier score) across a wide range of datasets and classifiers. Parameters of the learned Dirichlet calibration map provide insights to the biases in the uncalibrated model.

For agents

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

get_harvested_code_for_paper("1910.12656")
get_code_for_paper("1910.12656")
have("1910.12656")

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

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

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

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

Connect an agent — have() is free.