{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/dangers-of-bayesian-model-averaging-under","title":"Dangers of Bayesian Model Averaging under Covariate Shift","arxiv_id":"2106.11905","date":"2021-06-22","proceeding":"NeurIPS 2021 12","authors":["Pavel Izmailov","Patrick Nicholson","Sanae Lotfi","Andrew Gordon Wilson"],"abstract":"Approximate Bayesian inference for neural networks is considered a robust alternative to standard training, often providing good performance on out-of-distribution data. However, Bayesian neural networks (BNNs) with high-fidelity approximate inference via full-batch Hamiltonian Monte Carlo achieve poor generalization under covariate shift, even underperforming classical estimation. We explain this surprising result, showing how a Bayesian model average can in fact be problematic under covariate shift, particularly in cases where linear dependencies in the input features cause a lack of posterior contraction. We additionally show why the same issue does not affect many approximate inference procedures, or classical maximum a-posteriori (MAP) training. Finally, we propose novel priors that improve the robustness of BNNs to many sources of covariate shift.","url_abs":"https://arxiv.org/abs/2106.11905v2","url_pdf":"https://arxiv.org/pdf/2106.11905v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"dangers-of-bayesian-model-averaging-under","repo_url":"https://github.com/izmailovpavel/bnn_covariate_shift","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"jax","reach":null}],"tasks":[{"task_slug":"bayesian-inference","task_name":"Bayesian Inference"},{"task_slug":"model","task_name":"model"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2106.11905","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.11905"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/google-research/google-research","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/izmailovpavel/bnn_covariate_shift","reach":null}],"summary":{"ran_honours":2,"ran_draft_wrong":3},"by_repo_kind":{"official":{"samples":4,"ran":4,"repositories":1},"found_in_text":{"samples":1,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"9e184ccfacbc9e0b","entry":"get_kinetic_energy_diff","repo":"izmailovpavel/bnn_covariate_shift","repo_kind":"official","path":"bnn_hmc/core/hmc.py","file_url":"https://github.com/izmailovpavel/bnn_covariate_shift/blob/HEAD/bnn_hmc/core/hmc.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9e184ccfacbc9e0b"}},{"code_sha256_prefix":"dfcc30d93baf6385","entry":"make_accept_prob","repo":"izmailovpavel/bnn_covariate_shift","repo_kind":"official","path":"bnn_hmc/core/hmc.py","file_url":"https://github.com/izmailovpavel/bnn_covariate_shift/blob/HEAD/bnn_hmc/core/hmc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dfcc30d93baf6385"}},{"code_sha256_prefix":"9be31c26360e4981","entry":"make_leapfrog","repo":"izmailovpavel/bnn_covariate_shift","repo_kind":"official","path":"bnn_hmc/core/hmc.py","file_url":"https://github.com/izmailovpavel/bnn_covariate_shift/blob/HEAD/bnn_hmc/core/hmc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9be31c26360e4981"}},{"code_sha256_prefix":"6feadab44591aaef","entry":"make_student_t_log_prior","repo":"izmailovpavel/bnn_covariate_shift","repo_kind":"official","path":"bnn_hmc/utils/losses.py","file_url":"https://github.com/izmailovpavel/bnn_covariate_shift/blob/HEAD/bnn_hmc/utils/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6feadab44591aaef"}},{"code_sha256_prefix":"d942f42494790446","entry":"uniform","repo":"google-research/google-research","repo_kind":"found_in_text","path":"mir_uai24/priors.py","file_url":"https://github.com/google-research/google-research/blob/HEAD/mir_uai24/priors.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d942f42494790446"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}