{"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/flat-posterior-does-matter-for-bayesian","title":"Flat Posterior Does Matter For Bayesian Model Averaging","arxiv_id":"2406.15664","date":"2024-06-21","proceeding":null,"authors":["Sungjun Lim","Jeyoon Yeom","Sooyon Kim","Hoyoon Byun","Jinho Kang","Yohan Jung","Jiyoung Jung","Kyungwoo Song"],"abstract":"Bayesian neural network (BNN) approximates the posterior distribution of model parameters and utilizes the posterior for prediction via Bayesian Model Averaging (BMA). The quality of the posterior approximation is critical for achieving accurate and robust predictions. It is known that flatness in the loss landscape is strongly associated with generalization performance, and it necessitates consideration to improve the quality of the posterior approximation. In this work, we empirically demonstrate that BNNs often struggle to capture the flatness. Moreover, we provide both experimental and theoretical evidence showing that BMA can be ineffective without ensuring flatness. To address this, we propose Sharpness-Aware Bayesian Model Averaging (SA-BMA), a novel optimizer that seeks flat posteriors by calculating divergence in the parameter space. SA-BMA aligns with the intrinsic nature of BNN and the generalized version of existing sharpness-aware optimizers for DNN. In addition, we suggest a Bayesian Transfer Learning scheme to efficiently leverage pre-trained DNN. We validate the efficacy of SA-BMA in enhancing generalization performance in few-shot classification and distribution shift by ensuring flat posterior.","url_abs":"https://arxiv.org/abs/2406.15664v3","url_pdf":"https://arxiv.org/pdf/2406.15664v3.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":"flat-posterior-does-matter-for-bayesian","repo_url":"https://github.com/mlai-yonsei/sa-bma","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"transfer-learning","task_name":"Transfer Learning"},{"task_slug":"uncertainty-quantification","task_name":"Uncertainty Quantification"},{"task_slug":"model","task_name":"model"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.15664","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.15664"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mlai-yonsei/sa-bma","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":2,"ran":2,"unverified":3},"by_repo_kind":{"official":{"samples":7,"ran":4,"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":7,"samples":[{"code_sha256_prefix":"d9def42110729a85","entry":"conv1x1","repo":"mlai-yonsei/sa-bma","repo_kind":"official","path":"utils/models/resnet.py","file_url":"https://github.com/mlai-yonsei/sa-bma/blob/HEAD/utils/models/resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d9def42110729a85"}},{"code_sha256_prefix":"160bb14bd76201b4","entry":"conv3x3","repo":"mlai-yonsei/sa-bma","repo_kind":"official","path":"utils/models/resnet.py","file_url":"https://github.com/mlai-yonsei/sa-bma/blob/HEAD/utils/models/resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"160bb14bd76201b4"}},{"code_sha256_prefix":"9580bd36777af2c8","entry":"set_save_path","repo":"mlai-yonsei/sa-bma","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/mlai-yonsei/sa-bma/blob/HEAD/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9580bd36777af2c8"}},{"code_sha256_prefix":"a4163eb8d1f8b35f","entry":"set_wandb_runname","repo":"mlai-yonsei/sa-bma","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/mlai-yonsei/sa-bma/blob/HEAD/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a4163eb8d1f8b35f"}},{"code_sha256_prefix":"db4ee3d0d6d174db","entry":"get_dataset","repo":"mlai-yonsei/sa-bma","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/mlai-yonsei/sa-bma/blob/HEAD/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"db4ee3d0d6d174db"}},{"code_sha256_prefix":"f7c4a2b1e09eb8f7","entry":"resnet14","repo":"mlai-yonsei/sa-bma","repo_kind":"official","path":"utils/models/resnet.py","file_url":"https://github.com/mlai-yonsei/sa-bma/blob/HEAD/utils/models/resnet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f7c4a2b1e09eb8f7"}},{"code_sha256_prefix":"35b692403405aeae","entry":"resnet18","repo":"mlai-yonsei/sa-bma","repo_kind":"official","path":"utils/models/resnet_noBN.py","file_url":"https://github.com/mlai-yonsei/sa-bma/blob/HEAD/utils/models/resnet_noBN.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"35b692403405aeae"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}