{"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/causal-discovery-in-heterogeneous","title":"Causal Discovery in Heterogeneous Environments Under the Sparse Mechanism Shift Hypothesis","arxiv_id":"2206.02013","date":"2022-06-04","proceeding":null,"authors":["Ronan Perry","Julius von Kügelgen","Bernhard Schölkopf"],"abstract":"Machine learning approaches commonly rely on the assumption of independent and identically distributed (i.i.d.) data. In reality, however, this assumption is almost always violated due to distribution shifts between environments. Although valuable learning signals can be provided by heterogeneous data from changing distributions, it is also known that learning under arbitrary (adversarial) changes is impossible. Causality provides a useful framework for modeling distribution shifts, since causal models encode both observational and interventional distributions. In this work, we explore the sparse mechanism shift hypothesis, which posits that distribution shifts occur due to a small number of changing causal conditionals. Motivated by this idea, we apply it to learning causal structure from heterogeneous environments, where i.i.d. data only allows for learning an equivalence class of graphs without restrictive assumptions. We propose the Mechanism Shift Score (MSS), a score-based approach amenable to various empirical estimators, which provably identifies the entire causal structure with high probability if the sparse mechanism shift hypothesis holds. Empirically, we verify behavior predicted by the theory and compare multiple estimators and score functions to identify the best approaches in practice. Compared to other methods, we show how MSS bridges a gap by both being nonparametric as well as explicitly leveraging sparse changes.","url_abs":"https://arxiv.org/abs/2206.02013v2","url_pdf":"https://arxiv.org/pdf/2206.02013v2.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":"causal-discovery-in-heterogeneous","repo_url":"https://github.com/rflperry/sparse_shift","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"causal-discovery","task_name":"Causal Discovery"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2206.02013","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2206.02013"}},"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/rflperry/sparse_shift","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":13},"by_repo_kind":{"official":{"samples":13,"ran":0,"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":"f7644dd1aeb0743b","entry":"barabasi_albert_dag","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/datasets/dags.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/datasets/dags.py","link_basis":"harvester_set","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":"f7644dd1aeb0743b"}},{"code_sha256_prefix":"ebb3c0ef7ce41cdf","entry":"check_2d","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/utils.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/utils.py","link_basis":"harvester_set","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":"ebb3c0ef7ce41cdf"}},{"code_sha256_prefix":"f7acbd0b944b4a8f","entry":"connected_erdos_renyi_dag","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/datasets/dags.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/datasets/dags.py","link_basis":"harvester_set","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":"f7acbd0b944b4a8f"}},{"code_sha256_prefix":"512d1d9329fe5bfb","entry":"create_causal_learn_dag","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/utils.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/utils.py","link_basis":"harvester_set","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":"512d1d9329fe5bfb"}},{"code_sha256_prefix":"6558d096cb46076e","entry":"dag_false_orientations","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/metrics.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/metrics.py","link_basis":"harvester_set","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":"6558d096cb46076e"}},{"code_sha256_prefix":"663cfcf0d8a32ecb","entry":"dag_precision","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/metrics.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/metrics.py","link_basis":"harvester_set","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":"663cfcf0d8a32ecb"}},{"code_sha256_prefix":"44aeee3d1759c4cf","entry":"dag_true_orientations","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/metrics.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/metrics.py","link_basis":"harvester_set","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":"44aeee3d1759c4cf"}},{"code_sha256_prefix":"695484581db8290c","entry":"dags2mechanisms","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/utils.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/utils.py","link_basis":"harvester_set","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":"695484581db8290c"}},{"code_sha256_prefix":"f3a29a6b0cda9be5","entry":"erdos_renyi_dag","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/datasets/dags.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/datasets/dags.py","link_basis":"harvester_set","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":"f3a29a6b0cda9be5"}},{"code_sha256_prefix":"4a0e4c099e30b2a5","entry":"invariant_residual_test","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/independence_tests.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/independence_tests.py","link_basis":"harvester_set","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":"4a0e4c099e30b2a5"}},{"code_sha256_prefix":"79215bd3cdbd5127","entry":"sample_cdnod_sim","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/datasets/simulations.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/datasets/simulations.py","link_basis":"harvester_set","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":"79215bd3cdbd5127"}},{"code_sha256_prefix":"f42ebf028c5ec1ac","entry":"sample_nonlinear_icp_sim","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/datasets/simulations.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/datasets/simulations.py","link_basis":"harvester_set","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":"f42ebf028c5ec1ac"}},{"code_sha256_prefix":"65287b9d099a5288","entry":"sample_topological","repo":"rflperry/sparse_shift","repo_kind":"official","path":"sparse_shift/datasets/simulations.py","file_url":"https://github.com/rflperry/sparse_shift/blob/HEAD/sparse_shift/datasets/simulations.py","link_basis":"harvester_set","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":"65287b9d099a5288"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}