{"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/graph-out-of-distribution-generalization-via","title":"Graph Out-of-Distribution Generalization via Causal Intervention","arxiv_id":"2402.11494","date":"2024-02-18","proceeding":null,"authors":["Qitian Wu","Fan Nie","Chenxiao Yang","TianYi Bao","Junchi Yan"],"abstract":"Out-of-distribution (OOD) generalization has gained increasing attentions for learning on graphs, as graph neural networks (GNNs) often exhibit performance degradation with distribution shifts. The challenge is that distribution shifts on graphs involve intricate interconnections between nodes, and the environment labels are often absent in data. In this paper, we adopt a bottom-up data-generative perspective and reveal a key observation through causal analysis: the crux of GNNs' failure in OOD generalization lies in the latent confounding bias from the environment. The latter misguides the model to leverage environment-sensitive correlations between ego-graph features and target nodes' labels, resulting in undesirable generalization on new unseen nodes. Built upon this analysis, we introduce a conceptually simple yet principled approach for training robust GNNs under node-level distribution shifts, without prior knowledge of environment labels. Our method resorts to a new learning objective derived from causal inference that coordinates an environment estimator and a mixture-of-expert GNN predictor. The new approach can counteract the confounding bias in training data and facilitate learning generalizable predictive relations. Extensive experiment demonstrates that our model can effectively enhance generalization with various types of distribution shifts and yield up to 27.4\\% accuracy improvement over state-of-the-arts on graph OOD generalization benchmarks. Source codes are available at https://github.com/fannie1208/CaNet.","url_abs":"https://arxiv.org/abs/2402.11494v2","url_pdf":"https://arxiv.org/pdf/2402.11494v2.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":"graph-out-of-distribution-generalization-via","repo_url":"https://github.com/fannie1208/canet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"causal-inference","task_name":"Causal Inference"},{"task_slug":"out-of-distribution-generalization","task_name":"Out-of-Distribution Generalization"}],"methods":[{"method_slug":"causal-inference","method_name":"Causal inference"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.11494","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.11494"}},"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/fannie1208/canet","reach":{"status":"ok"}}],"summary":{"ran":2,"unverified":6},"by_repo_kind":{"official":{"samples":8,"ran":2,"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":8,"samples":[{"code_sha256_prefix":"8af7081a7caceae1","entry":"load_fixed_splits","repo":"fannie1208/canet","repo_kind":"official","path":"data_utils.py","file_url":"https://github.com/fannie1208/canet/blob/HEAD/data_utils.py","link_basis":"harvester_set","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":"8af7081a7caceae1"}},{"code_sha256_prefix":"f7d2020636698e09","entry":"rand_splits","repo":"fannie1208/canet","repo_kind":"official","path":"data_utils.py","file_url":"https://github.com/fannie1208/canet/blob/HEAD/data_utils.py","link_basis":"harvester_set","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":"f7d2020636698e09"}},{"code_sha256_prefix":"711b5792cfdf73cf","entry":"even_quantile_labels","repo":"fannie1208/canet","repo_kind":"official","path":"data_utils.py","file_url":"https://github.com/fannie1208/canet/blob/HEAD/data_utils.py","link_basis":"harvester_set","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":"711b5792cfdf73cf"}},{"code_sha256_prefix":"2cf31b6d1b1db7fc","entry":"load_arxiv_dataset","repo":"fannie1208/canet","repo_kind":"official","path":"dataset.py","file_url":"https://github.com/fannie1208/canet/blob/HEAD/dataset.py","link_basis":"harvester_set","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":"2cf31b6d1b1db7fc"}},{"code_sha256_prefix":"67fc014db49b3eba","entry":"load_fb100","repo":"fannie1208/canet","repo_kind":"official","path":"load_data.py","file_url":"https://github.com/fannie1208/canet/blob/HEAD/load_data.py","link_basis":"harvester_set","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":"67fc014db49b3eba"}},{"code_sha256_prefix":"86d16a6b534f0c22","entry":"load_synthetic_dataset","repo":"fannie1208/canet","repo_kind":"official","path":"dataset.py","file_url":"https://github.com/fannie1208/canet/blob/HEAD/dataset.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":"86d16a6b534f0c22"}},{"code_sha256_prefix":"985aeae95edfd025","entry":"load_twitch","repo":"fannie1208/canet","repo_kind":"official","path":"load_data.py","file_url":"https://github.com/fannie1208/canet/blob/HEAD/load_data.py","link_basis":"harvester_set","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":"985aeae95edfd025"}},{"code_sha256_prefix":"0e6a03667d73e916","entry":"load_twitch_dataset","repo":"fannie1208/canet","repo_kind":"official","path":"dataset.py","file_url":"https://github.com/fannie1208/canet/blob/HEAD/dataset.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":"0e6a03667d73e916"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}