{"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/generalization-in-graph-neural-networks","title":"Generalization in Graph Neural Networks: Improved PAC-Bayesian Bounds on Graph Diffusion","arxiv_id":"2302.04451","date":"2023-02-09","proceeding":null,"authors":["Haotian Ju","Dongyue Li","Aneesh Sharma","Hongyang R. Zhang"],"abstract":"Graph neural networks are widely used tools for graph prediction tasks. Motivated by their empirical performance, prior works have developed generalization bounds for graph neural networks, which scale with graph structures in terms of the maximum degree. In this paper, we present generalization bounds that instead scale with the largest singular value of the graph neural network's feature diffusion matrix. These bounds are numerically much smaller than prior bounds for real-world graphs. We also construct a lower bound of the generalization gap that matches our upper bound asymptotically. To achieve these results, we analyze a unified model that includes prior works' settings (i.e., convolutional and message-passing networks) and new settings (i.e., graph isomorphism networks). Our key idea is to measure the stability of graph neural networks against noise perturbations using Hessians. Empirically, we find that Hessian-based measurements correlate with the observed generalization gaps of graph neural networks accurately. Optimizing noise stability properties for fine-tuning pretrained graph neural networks also improves test performance on several graph-level classification tasks.","url_abs":"https://arxiv.org/abs/2302.04451v3","url_pdf":"https://arxiv.org/pdf/2302.04451v3.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":"generalization-in-graph-neural-networks","repo_url":"https://github.com/neu-statsml-research/generalization-in-graph-neural-networks","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"generalization-in-graph-neural-networks","repo_url":"https://github.com/virtuosoresearch/generalization-in-graph-neural-networks","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"generalization-bounds","task_name":"Generalization Bounds"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2302.04451","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2302.04451"}},"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/virtuosoresearch/generalization-in-graph-neural-networks","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/neu-statsml-research/generalization-in-graph-neural-networks","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":4,"ran_draft_wrong":2,"unverified":6},"by_repo_kind":{"official":{"samples":12,"ran":6,"repositories":2}},"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":"47c29243e21dd172","entry":"compute_hessians_quantity","repo":"virtuosoresearch/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/compute_hessian_spectra.py","file_url":"https://github.com/virtuosoresearch/generalization-in-graph-neural-networks/blob/HEAD/src/compute_hessian_spectra.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":"47c29243e21dd172"}},{"code_sha256_prefix":"a869544c3ef6df3b","entry":"compute_hessians_trace","repo":"virtuosoresearch/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/compute_hessian_spectra.py","file_url":"https://github.com/virtuosoresearch/generalization-in-graph-neural-networks/blob/HEAD/src/compute_hessian_spectra.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":"a869544c3ef6df3b"}},{"code_sha256_prefix":"c9ab4e1ae3be9759","entry":"eval","repo":"virtuosoresearch/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/finetune.py","file_url":"https://github.com/virtuosoresearch/generalization-in-graph-neural-networks/blob/HEAD/src/finetune.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":"c9ab4e1ae3be9759"}},{"code_sha256_prefix":"7144f95dffb38b67","entry":"get_weights","repo":"virtuosoresearch/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/compute_hessian_spectra.py","file_url":"https://github.com/virtuosoresearch/generalization-in-graph-neural-networks/blob/HEAD/src/compute_hessian_spectra.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7144f95dffb38b67"}},{"code_sha256_prefix":"287484b87212f47d","entry":"graph_data_obj_to_nx_simple","repo":"neu-statsml-research/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/loader.py","file_url":"https://github.com/neu-statsml-research/generalization-in-graph-neural-networks/blob/HEAD/src/loader.py","link_basis":"harvester_set","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":"287484b87212f47d"}},{"code_sha256_prefix":"6203c137185fa051","entry":"reset_idxes","repo":"neu-statsml-research/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/util.py","file_url":"https://github.com/neu-statsml-research/generalization-in-graph-neural-networks/blob/HEAD/src/util.py","link_basis":"harvester_set","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":"6203c137185fa051"}},{"code_sha256_prefix":"f97515ae0c7bb673","entry":"add_penalty","repo":"neu-statsml-research/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/utils/constraint.py","file_url":"https://github.com/neu-statsml-research/generalization-in-graph-neural-networks/blob/HEAD/src/utils/constraint.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":"f97515ae0c7bb673"}},{"code_sha256_prefix":"160e009a6d205294","entry":"compute_hessians_quantity","repo":"neu-statsml-research/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/compute_hessian_norm.py","file_url":"https://github.com/neu-statsml-research/generalization-in-graph-neural-networks/blob/HEAD/src/compute_hessian_norm.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":"160e009a6d205294"}},{"code_sha256_prefix":"b354514b745d77fc","entry":"compute_hessians_trace","repo":"neu-statsml-research/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/compute_hessian_norm.py","file_url":"https://github.com/neu-statsml-research/generalization-in-graph-neural-networks/blob/HEAD/src/compute_hessian_norm.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":"b354514b745d77fc"}},{"code_sha256_prefix":"d2ee7320cf52c3fc","entry":"deep_copy","repo":"neu-statsml-research/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/utils/constraint.py","file_url":"https://github.com/neu-statsml-research/generalization-in-graph-neural-networks/blob/HEAD/src/utils/constraint.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":"d2ee7320cf52c3fc"}},{"code_sha256_prefix":"7a2bb855a3e02bfe","entry":"get_test_acc","repo":"neu-statsml-research/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/parse_result.py","file_url":"https://github.com/neu-statsml-research/generalization-in-graph-neural-networks/blob/HEAD/src/parse_result.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":"7a2bb855a3e02bfe"}},{"code_sha256_prefix":"7f274d9139984ff5","entry":"get_weights","repo":"neu-statsml-research/generalization-in-graph-neural-networks","repo_kind":"official","path":"src/compute_hessian_norm.py","file_url":"https://github.com/neu-statsml-research/generalization-in-graph-neural-networks/blob/HEAD/src/compute_hessian_norm.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":"7f274d9139984ff5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}