{"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/sum-of-squares-circuits","title":"Sum of Squares Circuits","arxiv_id":"2408.11778","date":"2024-08-21","proceeding":null,"authors":["Lorenzo Loconte","Stefan Mengel","Antonio Vergari"],"abstract":"Designing expressive generative models that support exact and efficient inference is a core question in probabilistic ML. Probabilistic circuits (PCs) offer a framework where this tractability-vs-expressiveness trade-off can be analyzed theoretically. Recently, squared PCs encoding subtractive mixtures via negative parameters have emerged as tractable models that can be exponentially more expressive than monotonic PCs, i.e., PCs with positive parameters only. In this paper, we provide a more precise theoretical characterization of the expressiveness relationships among these models. First, we prove that squared PCs can be less expressive than monotonic ones. Second, we formalize a novel class of PCs -- sum of squares PCs -- that can be exponentially more expressive than both squared and monotonic PCs. Around sum of squares PCs, we build an expressiveness hierarchy that allows us to precisely unify and separate different tractable model classes such as Born Machines and PSD models, and other recently introduced tractable probabilistic models by using complex parameters. Finally, we empirically show the effectiveness of sum of squares circuits in performing distribution estimation.","url_abs":"https://arxiv.org/abs/2408.11778v3","url_pdf":"https://arxiv.org/pdf/2408.11778v3.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":"sum-of-squares-circuits","repo_url":"https://github.com/april-tools/sos-npcs","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"sum-of-squares-circuits","repo_url":"https://github.com/anon-npc/squared-npcs","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"GPL-3.0"}},{"paper_slug":"sum-of-squares-circuits","repo_url":"https://github.com/april-tools/squared-npcs","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2408.11778","atlas_url":"https://app.syntology.ai/?focus=2408.11778","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.11778"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/anon-npc/squared-npcs","reach":{"status":"ok","spdx":"GPL-3.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/april-tools/squared-npcs","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/april-tools/sos-npcs","reach":null}],"summary":{"ran":12,"ran_draft_wrong":5},"by_repo_kind":{"official":{"samples":2,"ran":2,"repositories":1},"listed":{"samples":12,"ran":12,"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":17,"samples":[{"code_sha256_prefix":"eacdb22f5eefb5d5","entry":"buffer_to_image","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/graphics/utils.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/graphics/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"eacdb22f5eefb5d5"}},{"code_sha256_prefix":"c0d74e939e75280c","entry":"build_command_string","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"c0d74e939e75280c"}},{"code_sha256_prefix":"fab203f5b6ecbb28","entry":"check_random_state","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/pcs/utils.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/pcs/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"fab203f5b6ecbb28"}},{"code_sha256_prefix":"4d77a736574f9185","entry":"csv_2_numpy","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/datasets/loaders.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/datasets/loaders.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"4d77a736574f9185"}},{"code_sha256_prefix":"b89bd908b0455c50","entry":"discrete_samples_hmap","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/graphics/distributions.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/graphics/distributions.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"b89bd908b0455c50"}},{"code_sha256_prefix":"8d8c8801ff44a2d9","entry":"expand_hparams_grid","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"8d8c8801ff44a2d9"}},{"code_sha256_prefix":"7746745799ad0ab6","entry":"expand_hparams_grid","repo":"april-tools/sos-npcs","repo_kind":"official","path":"src/scripts/grid.py","file_url":"https://github.com/april-tools/sos-npcs/blob/HEAD/src/scripts/grid.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"7746745799ad0ab6"}},{"code_sha256_prefix":"3a19f6640f6ef263","entry":"load_binary_dataset","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/datasets/loaders.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/datasets/loaders.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"3a19f6640f6ef263"}},{"code_sha256_prefix":"2aca30b37dd7ce52","entry":"load_small_uci_dataset","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/datasets/loaders.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/datasets/loaders.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"2aca30b37dd7ce52"}},{"code_sha256_prefix":"6b32c122c9131461","entry":"log_binomial","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/pcs/utils.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/pcs/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"6b32c122c9131461"}},{"code_sha256_prefix":"91e3b397098a38a8","entry":"matplotlib_buffer_to_image","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/graphics/utils.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/graphics/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"91e3b397098a38a8"}},{"code_sha256_prefix":"3ca57844af5358f9","entry":"model_hparams","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"3ca57844af5358f9"}},{"code_sha256_prefix":"dd5e6dd5f354baf7","entry":"model_hparams","repo":"april-tools/sos-npcs","repo_kind":"official","path":"src/scripts/grid.py","file_url":"https://github.com/april-tools/sos-npcs/blob/HEAD/src/scripts/grid.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"dd5e6dd5f354baf7"}},{"code_sha256_prefix":"ef985b93b7854c9f","entry":"nll","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/pcs/losses.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/pcs/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"ef985b93b7854c9f"}},{"code_sha256_prefix":"1591f37e9f3e25fc","entry":"retrieve_default_dtype","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/pcs/utils.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/pcs/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"1591f37e9f3e25fc"}},{"code_sha256_prefix":"6a655f054c264d71","entry":"setup_loss","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/pcs/losses.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/pcs/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"6a655f054c264d71"}},{"code_sha256_prefix":"d5335bb3b5b07df3","entry":"setup_optimizer","repo":"anon-npc/squared-npcs","repo_kind":"listed","path":"src/pcs/optimizers.py","file_url":"https://github.com/anon-npc/squared-npcs/blob/HEAD/src/pcs/optimizers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"d5335bb3b5b07df3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}