{"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/probabilistic-circuits-for-variational","title":"Probabilistic Circuits for Variational Inference in Discrete Graphical Models","arxiv_id":"2010.11446","date":"2020-10-22","proceeding":"NeurIPS 2020 12","authors":["Andy Shih","Stefano Ermon"],"abstract":"Inference in discrete graphical models with variational methods is difficult because of the inability to re-parameterize gradients of the Evidence Lower Bound (ELBO). Many sampling-based methods have been proposed for estimating these gradients, but they suffer from high bias or variance. In this paper, we propose a new approach that leverages the tractability of probabilistic circuit models, such as Sum Product Networks (SPN), to compute ELBO gradients exactly (without sampling) for a certain class of densities. In particular, we show that selective-SPNs are suitable as an expressive variational distribution, and prove that when the log-density of the target model is a polynomial the corresponding ELBO can be computed analytically. To scale to graphical models with thousands of variables, we develop an efficient and effective construction of selective-SPNs with size $O(kn)$, where $n$ is the number of variables and $k$ is an adjustable hyperparameter. We demonstrate our approach on three types of graphical models -- Ising models, Latent Dirichlet Allocation, and factor graphs from the UAI Inference Competition. Selective-SPNs give a better lower bound than mean-field and structured mean-field, and is competitive with approximations that do not provide a lower bound, such as Loopy Belief Propagation and Tree-Reweighted Belief Propagation. Our results show that probabilistic circuits are promising tools for variational inference in discrete graphical models as they combine tractability and expressivity.","url_abs":"https://arxiv.org/abs/2010.11446v1","url_pdf":"https://arxiv.org/pdf/2010.11446v1.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":"probabilistic-circuits-for-variational","repo_url":"https://github.com/AndyShih12/SPN_Variational_Inference","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"variational-inference","task_name":"Variational Inference"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2010.11446","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2010.11446"}},"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/AndyShih12/SPN_Variational_Inference","reach":null}],"summary":{"ran":3,"unverified":2},"by_repo_kind":{"official":{"samples":5,"ran":3,"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":5,"samples":[{"code_sha256_prefix":"fcb59642886be283","entry":"BernoulliLayer","repo":"AndyShih12/SPN_Variational_Inference","repo_kind":"official","path":"codebase/models/spns/spn.py","file_url":"https://github.com/AndyShih12/SPN_Variational_Inference/blob/HEAD/codebase/models/spns/spn.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":"fcb59642886be283"}},{"code_sha256_prefix":"b1a16a011006d5fc","entry":"ProductLayer","repo":"AndyShih12/SPN_Variational_Inference","repo_kind":"official","path":"codebase/models/spns/spn.py","file_url":"https://github.com/AndyShih12/SPN_Variational_Inference/blob/HEAD/codebase/models/spns/spn.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":"b1a16a011006d5fc"}},{"code_sha256_prefix":"ddb09a7b20558b0d","entry":"SumLayer","repo":"AndyShih12/SPN_Variational_Inference","repo_kind":"official","path":"codebase/models/spns/spn.py","file_url":"https://github.com/AndyShih12/SPN_Variational_Inference/blob/HEAD/codebase/models/spns/spn.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":"ddb09a7b20558b0d"}},{"code_sha256_prefix":"a2b8d23bce2563af","entry":"NodeLayer","repo":"AndyShih12/SPN_Variational_Inference","repo_kind":"official","path":"codebase/models/spns/spn.py","file_url":"https://github.com/AndyShih12/SPN_Variational_Inference/blob/HEAD/codebase/models/spns/spn.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":"a2b8d23bce2563af"}},{"code_sha256_prefix":"1f02068f18cb0491","entry":"SPN","repo":"AndyShih12/SPN_Variational_Inference","repo_kind":"official","path":"codebase/models/spns/spn.py","file_url":"https://github.com/AndyShih12/SPN_Variational_Inference/blob/HEAD/codebase/models/spns/spn.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":"1f02068f18cb0491"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}