{"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/graphmetro-mitigating-complex-distribution","title":"GraphMETRO: Mitigating Complex Graph Distribution Shifts via Mixture of Aligned Experts","arxiv_id":"2312.04693","date":"2023-12-07","proceeding":null,"authors":["Shirley Wu","Kaidi Cao","Bruno Ribeiro","James Zou","Jure Leskovec"],"abstract":"Graph data are inherently complex and heterogeneous, leading to a high natural diversity of distributional shifts. However, it remains unclear how to build machine learning architectures that generalize to the complex distributional shifts naturally occurring in the real world. Here, we develop GraphMETRO, a Graph Neural Network architecture that models natural diversity and captures complex distributional shifts. GraphMETRO employs a Mixture-of-Experts (MoE) architecture with a gating model and multiple expert models, where each expert model targets a specific distributional shift to produce a referential representation w.r.t. a reference model, and the gating model identifies shift components. Additionally, we design a novel objective that aligns the representations from different expert models to ensure reliable optimization. GraphMETRO achieves state-of-the-art results on four datasets from the GOOD benchmark, which is comprised of complex and natural real-world distribution shifts, improving by 67% and 4.2% on the WebKB and Twitch datasets. Code and data are available at https://github.com/Wuyxin/GraphMETRO.","url_abs":"https://arxiv.org/abs/2312.04693v3","url_pdf":"https://arxiv.org/pdf/2312.04693v3.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":"graphmetro-mitigating-complex-distribution","repo_url":"https://github.com/wuyxin/graphmetro","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"graph-neural-network","task_name":"Graph Neural Network"},{"task_slug":"mixture-of-experts","task_name":"Mixture-of-Experts"}],"methods":[{"method_slug":"graph-neural-network","method_name":"Graph Neural Network"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2312.04693","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.04693"}},"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/wuyxin/graphmetro","reach":{"status":"ok"}}],"summary":{"ran":6,"unverified":3},"by_repo_kind":{"official":{"samples":9,"ran":6,"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":9,"samples":[{"code_sha256_prefix":"3c726e8fd7a6c81d","entry":"compute_loss","repo":"wuyxin/graphmetro","repo_kind":"official","path":"graphmetro/train/loss.py","file_url":"https://github.com/wuyxin/graphmetro/blob/HEAD/graphmetro/train/loss.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":"3c726e8fd7a6c81d"}},{"code_sha256_prefix":"67c80a52cdf44979","entry":"dict_to_matrix","repo":"wuyxin/graphmetro","repo_kind":"official","path":"graphmetro/models/utils.py","file_url":"https://github.com/wuyxin/graphmetro/blob/HEAD/graphmetro/models/utils.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":"67c80a52cdf44979"}},{"code_sha256_prefix":"00c77e7f9cc8177c","entry":"get_fname","repo":"wuyxin/graphmetro","repo_kind":"official","path":"graphmetro/config.py","file_url":"https://github.com/wuyxin/graphmetro/blob/HEAD/graphmetro/config.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"00c77e7f9cc8177c"}},{"code_sha256_prefix":"7a4a5a8ac6ec94f3","entry":"global_add_pool","repo":"wuyxin/graphmetro","repo_kind":"official","path":"graphmetro/models/layers.py","file_url":"https://github.com/wuyxin/graphmetro/blob/HEAD/graphmetro/models/layers.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":"7a4a5a8ac6ec94f3"}},{"code_sha256_prefix":"624fe74da087e5e4","entry":"inductive_rand_split","repo":"wuyxin/graphmetro","repo_kind":"official","path":"graphmetro/datasets/utils.py","file_url":"https://github.com/wuyxin/graphmetro/blob/HEAD/graphmetro/datasets/utils.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":"624fe74da087e5e4"}},{"code_sha256_prefix":"386952f91d72e5d2","entry":"matrix_to_dict","repo":"wuyxin/graphmetro","repo_kind":"official","path":"graphmetro/models/utils.py","file_url":"https://github.com/wuyxin/graphmetro/blob/HEAD/graphmetro/models/utils.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":"386952f91d72e5d2"}},{"code_sha256_prefix":"fec1fe08d443426c","entry":"from_config","repo":"wuyxin/graphmetro","repo_kind":"official","path":"graphmetro/config.py","file_url":"https://github.com/wuyxin/graphmetro/blob/HEAD/graphmetro/config.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":"fec1fe08d443426c"}},{"code_sha256_prefix":"43f873a921a2b856","entry":"set_cfg","repo":"wuyxin/graphmetro","repo_kind":"official","path":"graphmetro/config.py","file_url":"https://github.com/wuyxin/graphmetro/blob/HEAD/graphmetro/config.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":"43f873a921a2b856"}},{"code_sha256_prefix":"faa5aecbc87bc130","entry":"to_target_index","repo":"wuyxin/graphmetro","repo_kind":"official","path":"graphmetro/models/utils.py","file_url":"https://github.com/wuyxin/graphmetro/blob/HEAD/graphmetro/models/utils.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":"faa5aecbc87bc130"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}