SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2002.10118 · ICML · 2020

Being Bayesian, Even Just a Bit, Fixes Overconfidence in ReLU Networks

Agustinus Kristiadi, Matthias Hein, Philipp Hennig

arXiv · PDF · Open in the Atlas

Code that ran

4 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 4 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/2002.10118.json · badge: /api/ran/2002.10118.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
wiseodd/last_layer_laplace canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FunctionStatusWhere it lives
estimate_variance Ran
ran on a synthesized input
wiseodd/last_layer_laplace/paper/laplace/llla_binary.py
code served (permissive licence) · get_code("5443601dbad4011c")
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 3, dtype family float; no output shape is stated. 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 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)

# Small tensors: batch size 2, dimension 4
n = 4
mu = torch.randn(n, n)
H = torch.randn(n, n) + torch.eye(n) * 2  # Add identity to ensure invertibility

hessians = [mu, H]

var0 = torch.tensor(0.5)

ARGS = {
    "var0": var0,
    "hessians": hessians,
    "invert": True
}
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 3, 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
exact_hessian_diagonal_blocks Ran
ran on a synthesized input
wiseodd/last_layer_laplace/hessian.py
code served (permissive licence) · get_code("5394a11ff85532c6")
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 torch.nn as nn

torch.manual_seed(0)

# Create a simple scalar function that depends on some parameters
# We'll create parameters and a simple loss function
param1 = torch.tensor([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], requires_grad=True)
param2 = torch.tensor([0.5, 1.5], requires_grad=True)

# Define a simple scalar function f
def create_f(params):
    """Create a closure that returns a scalar"""
    def f():
        # Simple quadratic function: sum of squares
        result = (params[0] ** 2).sum() + (params[1] ** 2).sum()
        return result
    return f

# Get the scalar tensor
parameters = [param1, param2]
f_value = (param1 ** 2).sum() + (param2 ** 2).sum()

# Ensure f_value is a scalar
if f_value.dim() > 0:
    f_value = f_value.sum()

ARGS = {
    "f": f_value,
    "parameters": parameters,
    "show_progress": False
}
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 — 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
predict Ran
ran on a synthesized input
wiseodd/last_layer_laplace/paper/laplace/util.py
code served (permissive licence) · get_code("00e88cac1828a093")
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 2, dtype family float, shape (4, 3) as a later run recorded it. 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, 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 model that has forward_sample method
class BayesianModel(nn.Module):
    def __init__(self, input_dim=4, output_dim=3):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward_sample(self, x):
        return self.linear(x)

# Create a minimal test loader (list of (x, y) tuples)
test_loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,)))
]

# Create model instance
model = BayesianModel(input_dim=4, output_dim=3)

# Define all arguments
ARGS = {
    'test_loader': test_loader,
    'model': model,
    'n_samples': 20,
    'apply_softmax': True,
    'return_targets': False,
    'delta': 1
}
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 2, dtype family float, shape (4, 3) — shape (4, 3) 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
predict_binary Ran
ran on a synthesized input
wiseodd/last_layer_laplace/paper/laplace/util.py
code served (permissive licence) · get_code("10e8331ba1520ebc")
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 float, shape (4,) as a later run recorded it. 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, 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)

# Define a minimal model that has forward_sample method
class BayesianModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward_sample(self, x):
        # Returns output with shape (batch_size, 1) for sigmoid + squeeze
        return self.linear(x).sum(dim=1, keepdim=True)

# Create a tiny test loader with 2 batches
test_loader = [
    (torch.randn(2, 4), torch.randint(0, 2, (2,))),
    (torch.randn(2, 4), torch.randint(0, 2, (2,)))
]

# Create model
model = BayesianModel()
model.eval()

# Define ARGS dict with all parameters
ARGS = {
    'test_loader': test_loader,
    'model': model,
    'n_samples': 100,
    'return_targets': False,
    'delta': 1
}
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 float, 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
estimate_variance Not yet run
unverified (harvested, no recorded run)
wiseodd/last_layer_laplace/paper/laplace/llla.py
code served (permissive licence) · get_code("1caed47ba8deae4f")
How it ran

no invocation recorded.

exact_hessian Not yet run
unverified (harvested, no recorded run)
wiseodd/last_layer_laplace/hessian.py
code served (permissive licence) · get_code("45fe82066cc3473a")
How it ran

no invocation recorded.

gridsearch_var0 Not yet run
unverified (harvested, no recorded run)
wiseodd/last_layer_laplace/paper/laplace/llla.py
code served (permissive licence) · get_code("9a87d1611a5e5414")
How it ran

no invocation recorded.

gridsearch_var0 Not yet run
unverified (harvested, no recorded run)
wiseodd/last_layer_laplace/paper/laplace/llla_binary.py
code served (permissive licence) · get_code("e8a7b6aaaa1ca3ce")
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-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

The point estimates of ReLU classification networks-arguably the most widely used neural network architecture-have been shown to yield arbitrarily high confidence far away from the training data. This architecture, in conjunction with a maximum a posteriori estimation scheme, is thus not calibrated nor robust. Approximate Bayesian inference has been empirically demonstrated to improve predictive uncertainty in neural networks, although the theoretical analysis of such Bayesian approximations is limited. We theoretically analyze approximate Gaussian distributions on the weights of ReLU networks and show that they fix the overconfidence problem. Furthermore, we show that even a simplistic, thus cheap, Bayesian approximation, also fixes these issues. This indicates that a sufficient condition for a calibrated uncertainty on a ReLU network is "to be a bit Bayesian". These theoretical results validate the usage of last-layer Bayesian approximation and motivate a range of a fidelity-cost trade-off. We further validate these findings empirically via various standard experiments using common deep ReLU networks and Laplace approximations.

For agents

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

get_harvested_code_for_paper("2002.10118")
get_code_for_paper("2002.10118")
have("2002.10118")

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

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

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

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

Connect an agent — have() is free.