{"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/bayesian-online-natural-gradient-bong","title":"Bayesian Online Natural Gradient (BONG)","arxiv_id":"2405.19681","date":"2024-05-30","proceeding":null,"authors":["Matt Jones","Peter Chang","Kevin Murphy"],"abstract":"We propose a novel approach to sequential Bayesian inference based on variational Bayes (VB). The key insight is that, in the online setting, we do not need to add the KL term to regularize to the prior (which comes from the posterior at the previous timestep); instead we can optimize just the expected log-likelihood, performing a single step of natural gradient descent starting at the prior predictive. We prove this method recovers exact Bayesian inference if the model is conjugate. We also show how to compute an efficient deterministic approximation to the VB objective, as well as our simplified objective, when the variational distribution is Gaussian or a sub-family, including the case of a diagonal plus low-rank precision matrix. We show empirically that our method outperforms other online VB methods in the non-conjugate setting, such as online learning for neural networks, especially when controlling for computational costs.","url_abs":"https://arxiv.org/abs/2405.19681v2","url_pdf":"https://arxiv.org/pdf/2405.19681v2.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":"bayesian-online-natural-gradient-bong","repo_url":"https://github.com/petergchang/bong","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"bayesian-inference","task_name":"Bayesian Inference"},{"task_slug":"sequential-bayesian-inference","task_name":"Sequential Bayesian Inference"}],"methods":[{"method_slug":"natural-gradient-descent","method_name":"Natural Gradient Descent"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.19681","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.19681"}},"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/petergchang/bong","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":8,"unverified":1},"by_repo_kind":{"official":{"samples":9,"ran":8,"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":"f09b9b2cdf4d7a92","entry":"calc_mse","repo":"petergchang/bong","repo_kind":"official","path":"bong/experiments/models.py","file_url":"https://github.com/petergchang/bong/blob/HEAD/bong/experiments/models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f09b9b2cdf4d7a92"}},{"code_sha256_prefix":"45e50c187002f770","entry":"generate_covariance_matrix","repo":"petergchang/bong","repo_kind":"official","path":"bong/src/experiment_utils.py","file_url":"https://github.com/petergchang/bong/blob/HEAD/bong/src/experiment_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"45e50c187002f770"}},{"code_sha256_prefix":"9fa4002541bed089","entry":"get_best_expt_per_agent","repo":"petergchang/bong","repo_kind":"official","path":"bong/experiments_parallel/score_utils.py","file_url":"https://github.com/petergchang/bong/blob/HEAD/bong/experiments_parallel/score_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9fa4002541bed089"}},{"code_sha256_prefix":"035f8759d7c9ba7e","entry":"get_scores_per_job","repo":"petergchang/bong","repo_kind":"official","path":"bong/experiments_parallel/score_utils.py","file_url":"https://github.com/petergchang/bong/blob/HEAD/bong/experiments_parallel/score_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"035f8759d7c9ba7e"}},{"code_sha256_prefix":"0b08467e8660ba13","entry":"needs_ef","repo":"petergchang/bong","repo_kind":"official","path":"bong/agents.py","file_url":"https://github.com/petergchang/bong/blob/HEAD/bong/agents.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0b08467e8660ba13"}},{"code_sha256_prefix":"0d323075d1808bb1","entry":"needs_rank","repo":"petergchang/bong","repo_kind":"official","path":"bong/agents.py","file_url":"https://github.com/petergchang/bong/blob/HEAD/bong/agents.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0d323075d1808bb1"}},{"code_sha256_prefix":"7947af79ac4c4dcb","entry":"nll_gauss","repo":"petergchang/bong","repo_kind":"official","path":"bong/experiments/models.py","file_url":"https://github.com/petergchang/bong/blob/HEAD/bong/experiments/models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7947af79ac4c4dcb"}},{"code_sha256_prefix":"03c0e3a373096d5d","entry":"process_dataset","repo":"petergchang/bong","repo_kind":"official","path":"bong/src/dataloaders.py","file_url":"https://github.com/petergchang/bong/blob/HEAD/bong/src/dataloaders.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"03c0e3a373096d5d"}},{"code_sha256_prefix":"c77cbc32dc6b08c2","entry":"generate_rotation_matrix","repo":"petergchang/bong","repo_kind":"official","path":"bong/src/experiment_utils.py","file_url":"https://github.com/petergchang/bong/blob/HEAD/bong/src/experiment_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c77cbc32dc6b08c2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}