{"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/divide-and-conquer-predictive-coding-a","title":"Divide-and-Conquer Predictive Coding: a structured Bayesian inference algorithm","arxiv_id":"2408.05834","date":"2024-08-11","proceeding":null,"authors":["Eli Sennesh","Hao Wu","Tommaso Salvatori"],"abstract":"Unexpected stimuli induce \"error\" or \"surprise\" signals in the brain. The theory of predictive coding promises to explain these observations in terms of Bayesian inference by suggesting that the cortex implements variational inference in a probabilistic graphical model. However, when applied to machine learning tasks, this family of algorithms has yet to perform on par with other variational approaches in high-dimensional, structured inference problems. To address this, we introduce a novel predictive coding algorithm for structured generative models, that we call divide-and-conquer predictive coding (DCPC). DCPC differs from other formulations of predictive coding, as it respects the correlation structure of the generative model and provably performs maximum-likelihood updates of model parameters, all without sacrificing biological plausibility. Empirically, DCPC achieves better numerical performance than competing algorithms and provides accurate inference in a number of problems not previously addressed with predictive coding. We provide an open implementation of DCPC in Pyro on Github.","url_abs":"https://arxiv.org/abs/2408.05834v2","url_pdf":"https://arxiv.org/pdf/2408.05834v2.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":"divide-and-conquer-predictive-coding-a","repo_url":"https://github.com/esennesh/dcpc_paper","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"divide-and-conquer-predictive-coding-a","repo_url":"https://github.com/esennesh/ppc_experiments","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"bayesian-inference","task_name":"Bayesian Inference"},{"task_slug":"variational-inference","task_name":"Variational Inference"}],"methods":[{"method_slug":"variational-inference","method_name":"Variational Inference"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2408.05834","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.05834"}},"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/esennesh/ppc_experiments","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/esennesh/dcpc_paper","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":5},"by_repo_kind":{"official":{"samples":5,"ran":5,"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":"f4111be52c4ca4b1","entry":"dist_params","repo":"esennesh/dcpc_paper","repo_kind":"official","path":"model/inference.py","file_url":"https://github.com/esennesh/dcpc_paper/blob/HEAD/model/inference.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":"f4111be52c4ca4b1"}},{"code_sha256_prefix":"2348e39e81f3fcc2","entry":"ess","repo":"esennesh/dcpc_paper","repo_kind":"official","path":"model/metric.py","file_url":"https://github.com/esennesh/dcpc_paper/blob/HEAD/model/metric.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":"2348e39e81f3fcc2"}},{"code_sha256_prefix":"c5079a5673beb46b","entry":"mlp_amortizer","repo":"esennesh/dcpc_paper","repo_kind":"official","path":"model/inference.py","file_url":"https://github.com/esennesh/dcpc_paper/blob/HEAD/model/inference.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":"c5079a5673beb46b"}},{"code_sha256_prefix":"bf7d23ff7a8f9748","entry":"soft_clamp","repo":"esennesh/dcpc_paper","repo_kind":"official","path":"utils/thirdparty.py","file_url":"https://github.com/esennesh/dcpc_paper/blob/HEAD/utils/thirdparty.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":"bf7d23ff7a8f9748"}},{"code_sha256_prefix":"7cf7761f7f1af544","entry":"systematic_resample","repo":"esennesh/dcpc_paper","repo_kind":"official","path":"model/inference.py","file_url":"https://github.com/esennesh/dcpc_paper/blob/HEAD/model/inference.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":"7cf7761f7f1af544"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}