{"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/enhancing-size-generalization-in-graph-neural","title":"Enhancing Size Generalization in Graph Neural Networks through Disentangled Representation Learning","arxiv_id":"2406.04601","date":"2024-06-07","proceeding":null,"authors":["Zheng Huang","Qihui Yang","Dawei Zhou","Yujun Yan"],"abstract":"Although most graph neural networks (GNNs) can operate on graphs of any size, their classification performance often declines on graphs larger than those encountered during training. Existing methods insufficiently address the removal of size information from graph representations, resulting in sub-optimal performance and reliance on backbone models. In response, we propose DISGEN, a novel and model-agnostic framework designed to disentangle size factors from graph representations. DISGEN employs size- and task-invariant augmentations and introduces a decoupling loss that minimizes shared information in hidden representations, with theoretical guarantees for its effectiveness. Our empirical results show that DISGEN outperforms the state-of-the-art models by up to 6% on real-world datasets, underscoring its effectiveness in enhancing the size generalizability of GNNs. Our codes are available at: https://github.com/GraphmindDartmouth/DISGEN.","url_abs":"https://arxiv.org/abs/2406.04601v3","url_pdf":"https://arxiv.org/pdf/2406.04601v3.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":"enhancing-size-generalization-in-graph-neural","repo_url":"https://github.com/graphminddartmouth/disgen","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"representation-learning","task_name":"Representation Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.04601","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.04601"}},"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/graphminddartmouth/disgen","reach":{"status":"ok"}}],"summary":{"ran":13,"ran_honours":1,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":18,"ran":15,"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":18,"samples":[{"code_sha256_prefix":"a75d5816d752d0e5","entry":"check_silo_data","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/util_new.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/util_new.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":"a75d5816d752d0e5"}},{"code_sha256_prefix":"149e64821bdf2fa7","entry":"create_structural_feature","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/datapreprocessing.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/datapreprocessing.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":"149e64821bdf2fa7"}},{"code_sha256_prefix":"43b70be4ca4a732e","entry":"eval_rocauc","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/train_util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/train_util.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":"43b70be4ca4a732e"}},{"code_sha256_prefix":"062c9d71e9d3f5e6","entry":"find_size_idx","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/util.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":"062c9d71e9d3f5e6"}},{"code_sha256_prefix":"976aeab585b3d8eb","entry":"graph_aug_size_change_label_unchange","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/aug_util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/aug_util.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":"976aeab585b3d8eb"}},{"code_sha256_prefix":"bc45d2d5f2331fc0","entry":"l2_loss","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/criteria_util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/criteria_util.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":"bc45d2d5f2331fc0"}},{"code_sha256_prefix":"d501ac9794d5c880","entry":"load_idx_files","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/util.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":"d501ac9794d5c880"}},{"code_sha256_prefix":"1af7d0e5f943d366","entry":"load_iid_idx_files","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/util.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":"1af7d0e5f943d366"}},{"code_sha256_prefix":"a0a9578d357f0198","entry":"pair_loss","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/criteria_util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/criteria_util.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":"a0a9578d357f0198"}},{"code_sha256_prefix":"01b834528c818ffa","entry":"pair_loss_cos","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/criteria_util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/criteria_util.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":"01b834528c818ffa"}},{"code_sha256_prefix":"eedec99dead946f2","entry":"quick_test_data_prep","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/datapreprocessing.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/datapreprocessing.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":"eedec99dead946f2"}},{"code_sha256_prefix":"60ccd1c98038811b","entry":"read_file","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/graphsst2_dataset.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/graphsst2_dataset.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"60ccd1c98038811b"}},{"code_sha256_prefix":"fe7d97d9abf11937","entry":"split","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/graphsst2_dataset.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/graphsst2_dataset.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":"fe7d97d9abf11937"}},{"code_sha256_prefix":"93792408ad287326","entry":"train_step","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/train_util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/train_util.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":"93792408ad287326"}},{"code_sha256_prefix":"dde52a0f318548b4","entry":"undirected_graph","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/graphsst2_dataset.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/graphsst2_dataset.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dde52a0f318548b4"}},{"code_sha256_prefix":"9f95db60d3c2c127","entry":"cal_edge_grad","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/aug_util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/aug_util.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":"9f95db60d3c2c127"}},{"code_sha256_prefix":"8dd72428904bc682","entry":"eval_step","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/train_util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/train_util.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":"8dd72428904bc682"}},{"code_sha256_prefix":"87208e7a715a064c","entry":"graph_explainer","repo":"graphminddartmouth/disgen","repo_kind":"official","path":"src/aug_util.py","file_url":"https://github.com/graphminddartmouth/disgen/blob/HEAD/src/aug_util.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":"87208e7a715a064c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}