{"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-neural-networks-for-link-prediction","title":"Graph Neural Networks for Link Prediction with Subgraph Sketching","arxiv_id":"2209.15486","date":"2022-09-30","proceeding":null,"authors":["Benjamin Paul Chamberlain","Sergey Shirobokov","Emanuele Rossi","Fabrizio Frasca","Thomas Markovich","Nils Hammerla","Michael M. Bronstein","Max Hansmire"],"abstract":"Many Graph Neural Networks (GNNs) perform poorly compared to simple heuristics on Link Prediction (LP) tasks. This is due to limitations in expressive power such as the inability to count triangles (the backbone of most LP heuristics) and because they can not distinguish automorphic nodes (those having identical structural roles). Both expressiveness issues can be alleviated by learning link (rather than node) representations and incorporating structural features such as triangle counts. Since explicit link representations are often prohibitively expensive, recent works resorted to subgraph-based methods, which have achieved state-of-the-art performance for LP, but suffer from poor efficiency due to high levels of redundancy between subgraphs. We analyze the components of subgraph GNN (SGNN) methods for link prediction. Based on our analysis, we propose a novel full-graph GNN called ELPH (Efficient Link Prediction with Hashing) that passes subgraph sketches as messages to approximate the key components of SGNNs without explicit subgraph construction. ELPH is provably more expressive than Message Passing GNNs (MPNNs). It outperforms existing SGNN models on many standard LP benchmarks while being orders of magnitude faster. However, it shares the common GNN limitation that it is only efficient when the dataset fits in GPU memory. Accordingly, we develop a highly scalable model, called BUDDY, which uses feature precomputation to circumvent this limitation without sacrificing predictive performance. Our experiments show that BUDDY also outperforms SGNNs on standard LP benchmarks while being highly scalable and faster than ELPH.","url_abs":"https://arxiv.org/abs/2209.15486v3","url_pdf":"https://arxiv.org/pdf/2209.15486v3.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-neural-networks-for-link-prediction","repo_url":"https://github.com/melifluos/subgraph-sketching","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":null,"task_name":"GPU"},{"task_slug":"link-prediction","task_name":"Link Prediction"},{"task_slug":"prediction","task_name":"Prediction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2209.15486","atlas_url":"https://app.syntology.ai/?focus=2209.15486","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2209.15486"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/melifluos/subgraph-sketching","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":15,"unverified":4},"by_repo_kind":{"official":{"samples":19,"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":0,"samples":[{"code_sha256_prefix":"9e2fa228f0c7b99a","entry":"drnl_hash_function","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/labelling_tricks.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/labelling_tricks.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9e2fa228f0c7b99a"}},{"code_sha256_prefix":"bbb365889e4b165c","entry":"evaluate_auc","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/evaluation.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/evaluation.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bbb365889e4b165c"}},{"code_sha256_prefix":"bc9abe71738a7d2f","entry":"evaluate_hits","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/evaluation.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/evaluation.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bc9abe71738a7d2f"}},{"code_sha256_prefix":"4cff9116494e7bb9","entry":"evaluate_mrr","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/evaluation.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/evaluation.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4cff9116494e7bb9"}},{"code_sha256_prefix":"f770abeaeee9beaa","entry":"filter_by_year","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/data.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/data.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f770abeaeee9beaa"}},{"code_sha256_prefix":"5b712cca0e34a904","entry":"get_drnl_lookup","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/labelling_tricks.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/labelling_tricks.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5b712cca0e34a904"}},{"code_sha256_prefix":"753dbda6996a11ba","entry":"get_max_label","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/labelling_tricks.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/labelling_tricks.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"753dbda6996a11ba"}},{"code_sha256_prefix":"e486ff744db8e7ad","entry":"get_node_mapper","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/lcc.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/lcc.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e486ff744db8e7ad"}},{"code_sha256_prefix":"913ad556c3d22e64","entry":"get_num_samples","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"913ad556c3d22e64"}},{"code_sha256_prefix":"0c02452b5464fd8f","entry":"get_pos_neg_edges","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0c02452b5464fd8f"}},{"code_sha256_prefix":"a4a4c600d0429619","entry":"get_seal_pos_neg_edges","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/datasets/seal.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/datasets/seal.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a4a4c600d0429619"}},{"code_sha256_prefix":"84b7101c953413ce","entry":"initialise_wandb","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/wandb_setup.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/wandb_setup.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"84b7101c953413ce"}},{"code_sha256_prefix":"bc63669ad631e647","entry":"remap_edges","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/lcc.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/lcc.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bc63669ad631e647"}},{"code_sha256_prefix":"fd09cb2e05ebf840","entry":"sample_data","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/datasets/seal.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/datasets/seal.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fd09cb2e05ebf840"}},{"code_sha256_prefix":"dedcc84d698c5384","entry":"select_embedding","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dedcc84d698c5384"}},{"code_sha256_prefix":"b87b2124cd8a4b25","entry":"AA","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/heuristics.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/heuristics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b87b2124cd8a4b25"}},{"code_sha256_prefix":"de33161146663fe9","entry":"CN","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/heuristics.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/heuristics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"de33161146663fe9"}},{"code_sha256_prefix":"0016582cc5b1db72","entry":"RA","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/heuristics.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/heuristics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0016582cc5b1db72"}},{"code_sha256_prefix":"b36878b25e3455a3","entry":"get_largest_connected_component","repo":"melifluos/subgraph-sketching","repo_kind":"official","path":"src/lcc.py","file_url":"https://github.com/melifluos/subgraph-sketching/blob/HEAD/src/lcc.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b36878b25e3455a3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}