{"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/the-self-loop-paradox-investigating-the","title":"The Self-Loop Paradox: Investigating the Impact of Self-Loops on Graph Neural Networks","arxiv_id":"2312.01721","date":"2023-12-04","proceeding":null,"authors":["Moritz Lampert","Ingo Scholtes"],"abstract":"Many Graph Neural Networks (GNNs) add self-loops to a graph to include feature information about a node itself at each layer. However, if the GNN consists of more than one layer, this information can return to its origin via cycles in the graph topology. Intuition suggests that this \"backflow\" of information should be larger in graphs with self-loops compared to graphs without. In this work, we counter this intuition and show that for certain GNN architectures, the information a node gains from itself can be smaller in graphs with self-loops compared to the same graphs without. We adopt an analytical approach for the study of statistical graph ensembles with a given degree sequence and show that this phenomenon, which we call the self-loop paradox, can depend both on the number of GNN layers $k$ and whether $k$ is even or odd. We experimentally validate our theoretical findings in a synthetic node classification task and investigate its practical relevance in 23 real-world graphs.","url_abs":"https://arxiv.org/abs/2312.01721v1","url_pdf":"https://arxiv.org/pdf/2312.01721v1.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":"the-self-loop-paradox-investigating-the","repo_url":"https://github.com/m-lampert/self-loop-paradox","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"AGPL-3.0"}}],"tasks":[{"task_slug":"node-classification","task_name":"Node Classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2312.01721","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.01721"}},"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/m-lampert/self-loop-paradox","reach":{"status":"ok","spdx":"AGPL-3.0"}}],"summary":{"ran":4},"by_repo_kind":{"official":{"samples":4,"ran":4,"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":4,"samples":[{"code_sha256_prefix":"817257ca0e31d6c5","entry":"compute_statistics","repo":"m-lampert/self-loop-paradox","repo_kind":"official","path":"src/stats/walk_statistics.py","file_url":"https://github.com/m-lampert/self-loop-paradox/blob/HEAD/src/stats/walk_statistics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"AGPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"817257ca0e31d6c5"}},{"code_sha256_prefix":"c423e1f8d2fa6c47","entry":"get_avg_closed_walks_ratio","repo":"m-lampert/self-loop-paradox","repo_kind":"official","path":"src/stats/walk_statistics.py","file_url":"https://github.com/m-lampert/self-loop-paradox/blob/HEAD/src/stats/walk_statistics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"AGPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"c423e1f8d2fa6c47"}},{"code_sha256_prefix":"95f57114f79a8413","entry":"get_box_plot_coords","repo":"m-lampert/self-loop-paradox","repo_kind":"official","path":"src/visualization/jupyter_utils.py","file_url":"https://github.com/m-lampert/self-loop-paradox/blob/HEAD/src/visualization/jupyter_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"AGPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"95f57114f79a8413"}},{"code_sha256_prefix":"d0af59f2adba3a06","entry":"get_ratio_estimates","repo":"m-lampert/self-loop-paradox","repo_kind":"official","path":"src/stats/walk_statistics.py","file_url":"https://github.com/m-lampert/self-loop-paradox/blob/HEAD/src/stats/walk_statistics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"AGPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"d0af59f2adba3a06"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}