{"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/causally-invariant-predictor-with-shift","title":"Which Invariance Should We Transfer? A Causal Minimax Learning Approach","arxiv_id":"2107.01876","date":"2021-07-05","proceeding":null,"authors":["Mingzhou Liu","Xiangyu Zheng","Xinwei Sun","Fang Fang","Yizhou Wang"],"abstract":"A major barrier to deploying current machine learning models lies in their non-reliability to dataset shifts. To resolve this problem, most existing studies attempted to transfer stable information to unseen environments. Particularly, independent causal mechanisms-based methods proposed to remove mutable causal mechanisms via the do-operator. Compared to previous methods, the obtained stable predictors are more effective in identifying stable information. However, a key question remains: which subset of this whole stable information should the model transfer, in order to achieve optimal generalization ability? To answer this question, we present a comprehensive minimax analysis from a causal perspective. Specifically, we first provide a graphical condition for the whole stable set to be optimal. When this condition fails, we surprisingly find with an example that this whole stable set, although can fully exploit stable information, is not the optimal one to transfer. To identify the optimal subset under this case, we propose to estimate the worst-case risk with a novel optimization scheme over the intervention functions on mutable causal mechanisms. We then propose an efficient algorithm to search for the subset with minimal worst-case risk, based on a newly defined equivalence relation between stable subsets. Compared to the exponential cost of exhaustively searching over all subsets, our searching strategy enjoys a polynomial complexity. The effectiveness and efficiency of our methods are demonstrated on synthetic data and the diagnosis of Alzheimer's disease.","url_abs":"https://arxiv.org/abs/2107.01876v5","url_pdf":"https://arxiv.org/pdf/2107.01876v5.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":"causally-invariant-predictor-with-shift","repo_url":"https://github.com/lmz123321/which_invariance","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"domain-generalization","task_name":"Domain Generalization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2107.01876","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2107.01876"}},"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/lmz123321/which_invariance","reach":null}],"summary":{"ran":4,"ran_honours":3,"ran_draft_wrong":2,"unverified":2},"by_repo_kind":{"official":{"samples":11,"ran":9,"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":"8525b5bfafe1c30a","entry":"BaseSet","repo":"lmz123321/which_invariance","repo_kind":"official","path":"findoptset/findoptset.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/findoptset/findoptset.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":"8525b5bfafe1c30a"}},{"code_sha256_prefix":"3efc81b90aa688b0","entry":"EarlyStopping","repo":"lmz123321/which_invariance","repo_kind":"official","path":"findoptset/findoptset.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/findoptset/findoptset.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":"3efc81b90aa688b0"}},{"code_sha256_prefix":"42a16c34a54474ad","entry":"NonLinearF","repo":"lmz123321/which_invariance","repo_kind":"official","path":"findoptset/findoptset.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/findoptset/findoptset.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":"42a16c34a54474ad"}},{"code_sha256_prefix":"0ce589516bdf4ef9","entry":"StEq","repo":"lmz123321/which_invariance","repo_kind":"official","path":"findoptset/findoptset.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/findoptset/findoptset.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":"0ce589516bdf4ef9"}},{"code_sha256_prefix":"33d995585c147c9b","entry":"concat","repo":"lmz123321/which_invariance","repo_kind":"official","path":"findoptset/findoptset.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/findoptset/findoptset.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"33d995585c147c9b"}},{"code_sha256_prefix":"e4ac4ec9482c424f","entry":"dfTotensor","repo":"lmz123321/which_invariance","repo_kind":"official","path":"findoptset/findoptset.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/findoptset/findoptset.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e4ac4ec9482c424f"}},{"code_sha256_prefix":"fee338106eb0430c","entry":"order","repo":"lmz123321/which_invariance","repo_kind":"official","path":"causal_discovery/causal_discovery.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/causal_discovery/causal_discovery.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fee338106eb0430c"}},{"code_sha256_prefix":"a19bab3200fcd75c","entry":"regularizer","repo":"lmz123321/which_invariance","repo_kind":"official","path":"findoptset/findoptset.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/findoptset/findoptset.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a19bab3200fcd75c"}},{"code_sha256_prefix":"8db73106e0f2c5b7","entry":"sort_topology","repo":"lmz123321/which_invariance","repo_kind":"official","path":"findoptset/findoptset.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/findoptset/findoptset.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8db73106e0f2c5b7"}},{"code_sha256_prefix":"04f9916e300a43a2","entry":"OptSet","repo":"lmz123321/which_invariance","repo_kind":"official","path":"findoptset/findoptset.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/findoptset/findoptset.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":"04f9916e300a43a2"}},{"code_sha256_prefix":"d1540a9de04fa0fc","entry":"_weightcut","repo":"lmz123321/which_invariance","repo_kind":"official","path":"findoptset/findoptset.py","file_url":"https://github.com/lmz123321/which_invariance/blob/HEAD/findoptset/findoptset.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":"d1540a9de04fa0fc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}