Papers › Are Bayesian neural networks intrinsically good at out-of-distribution detection?

Are Bayesian neural networks intrinsically good at out-of-distribution detection?

26 Jul 2021arXiv:2107.12248archive 2025-07-28

Christian Henning, Francesco D'Angelo, Benjamin F. Grewe

The need to avoid confident predictions on unfamiliar data has sparked interest in out-of-distribution (OOD) detection. It is widely assumed that Bayesian neural networks (BNN) are well suited for this task, as the endowed epistemic uncertainty should lead to disagreement in predictions on outliers. In this paper, we question this assumption and provide empirical evidence that proper Bayesian inference with common neural network architectures does not necessarily lead to good OOD detection. To circumvent the use of approximate inference, we start by studying the infinite-width case, where Bayesian inference can be exact considering the corresponding Gaussian process. Strikingly, the kernels induced under common architectural choices lead to uncertainties that do not reflect the underlying data generating process and are therefore unsuited for OOD detection. Finally, we study finite-width networks using HMC, and observe OOD behavior that is consistent with the infinite-width case. Overall, our study discloses fundamental problems when naively using BNNs for OOD detection and opens interesting avenues for future research.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2107.12248")

Code

Syntology Ran 0 of 12 code samples harvested from 1 repository linked to this paper; 12 have no recorded run.

By repository: community (archive-listed): 12 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

chrhenning/uncertainty_based_ood mentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 0 ran; 0 honoured the contract we drafted; 12 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

12unverified

Licence: 0 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from chrhenning/uncertainty_based_ood. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

analytic_v_gaussian chrhenning/uncertainty_based_ood/nngp/rbf_net.py community (archive-listed) unverified Apache-2.0 (permissive) · 6e378b4df81a058c · report
calc_regression_acc chrhenning/uncertainty_based_ood/utils/misc.py community (archive-listed) unverified Apache-2.0 (permissive) · ef6d55e8d0d4a731 · report
cholesky_adaptive_noise chrhenning/uncertainty_based_ood/nngp/nngp.py community (archive-listed) unverified Apache-2.0 (permissive) · 57d4f077483e5f9e · report
cosine_1l_kernel chrhenning/uncertainty_based_ood/nngp/mlp_kernel.py community (archive-listed) unverified Apache-2.0 (permissive) · d0cf47683cde9160 · report
eval_grid_2d chrhenning/uncertainty_based_ood/utils/misc.py community (archive-listed) unverified Apache-2.0 (permissive) · bbd76be30158bd1b · report
gen_inference_kernels chrhenning/uncertainty_based_ood/nngp/nngp.py community (archive-listed) unverified Apache-2.0 (permissive) · 77214e4c21adc429 · report
inference_with_isotropic_gaussian_ll chrhenning/uncertainty_based_ood/nngp/nngp.py community (archive-listed) unverified Apache-2.0 (permissive) · f10a9936b81c32ba · report
init_kernel chrhenning/uncertainty_based_ood/nngp/mlp_kernel.py community (archive-listed) unverified Apache-2.0 (permissive) · 64aad04d13588379 · report
mc_v_gaussian chrhenning/uncertainty_based_ood/nngp/rbf_net.py community (archive-listed) unverified Apache-2.0 (permissive) · 897640ff43709859 · report
rbf chrhenning/uncertainty_based_ood/nngp/standard_kernels.py community (archive-listed) unverified Apache-2.0 (permissive) · 61768d8e87c1b06d · report
regular_grid chrhenning/uncertainty_based_ood/finite_width/ridgelet_prior.py community (archive-listed) unverified Apache-2.0 (permissive) · 3c790a7efb74000c · report
relu_recursion_lee chrhenning/uncertainty_based_ood/nngp/mlp_kernel.py community (archive-listed) unverified Apache-2.0 (permissive) · da5aabdd5b3d3cbe · report

Tasks

Bayesian InferenceOut of Distribution (OOD) DetectionOut-of-Distribution Detection

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections