{"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/neural-bellman-ford-networks-a-general-graph","title":"Neural Bellman-Ford Networks: A General Graph Neural Network Framework for Link Prediction","arxiv_id":"2106.06935","date":"2021-06-13","proceeding":"NeurIPS 2021 12","authors":["Zhaocheng Zhu","Zuobai Zhang","Louis-Pascal Xhonneux","Jian Tang"],"abstract":"Link prediction is a very fundamental task on graphs. Inspired by traditional path-based methods, in this paper we propose a general and flexible representation learning framework based on paths for link prediction. Specifically, we define the representation of a pair of nodes as the generalized sum of all path representations, with each path representation as the generalized product of the edge representations in the path. Motivated by the Bellman-Ford algorithm for solving the shortest path problem, we show that the proposed path formulation can be efficiently solved by the generalized Bellman-Ford algorithm. To further improve the capacity of the path formulation, we propose the Neural Bellman-Ford Network (NBFNet), a general graph neural network framework that solves the path formulation with learned operators in the generalized Bellman-Ford algorithm. The NBFNet parameterizes the generalized Bellman-Ford algorithm with 3 neural components, namely INDICATOR, MESSAGE and AGGREGATE functions, which corresponds to the boundary condition, multiplication operator, and summation operator respectively. The NBFNet is very general, covers many traditional path-based methods, and can be applied to both homogeneous graphs and multi-relational graphs (e.g., knowledge graphs) in both transductive and inductive settings. Experiments on both homogeneous graphs and knowledge graphs show that the proposed NBFNet outperforms existing methods by a large margin in both transductive and inductive settings, achieving new state-of-the-art results.","url_abs":"https://arxiv.org/abs/2106.06935v4","url_pdf":"https://arxiv.org/pdf/2106.06935v4.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":"neural-bellman-ford-networks-a-general-graph","repo_url":"https://github.com/DeepGraphLearning/NBFNet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"neural-bellman-ford-networks-a-general-graph","repo_url":"https://github.com/fs302/EasyLink","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"neural-bellman-ford-networks-a-general-graph","repo_url":"https://github.com/fs302/EasyLink/blob/main/example/ogbl_ppa_ra.py","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"graph-neural-network","task_name":"Graph Neural Network"},{"task_slug":"inductive-relation-prediction","task_name":"Inductive Relation Prediction"},{"task_slug":"knowledge-graph-completion","task_name":"Knowledge Graph Completion"},{"task_slug":"link-prediction","task_name":"Link Prediction"},{"task_slug":"link-property-prediction","task_name":"Link Property Prediction"}],"methods":[{"method_slug":"graph-neural-network","method_name":"Graph Neural Network"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/link-prediction-on-citeseer","task":"Link Prediction","dataset":"Citeseer","model":"NBFNet","rank_in_archive_order":9,"of":13,"metrics":{"AP":"93.6%","AUC":"92.3%"},"uses_additional_data":false},{"leaderboard":"/sota/link-prediction-on-cora","task":"Link Prediction","dataset":"Cora","model":"NBFNet","rank_in_archive_order":3,"of":13,"metrics":{"AP":"96.2%","AUC":"95.6%"},"uses_additional_data":false},{"leaderboard":"/sota/link-prediction-on-fb15k-237","task":"Link Prediction","dataset":"FB15k-237","model":"NBFNet","rank_in_archive_order":1,"of":75,"metrics":{"Hits@1":"0.321","Hits@10":"0.599","Hits@3":"0.454","MR":"114","MRR":"0.415"},"uses_additional_data":false},{"leaderboard":"/sota/link-prediction-on-pubmed","task":"Link Prediction","dataset":"Pubmed","model":"NBFNet","rank_in_archive_order":3,"of":13,"metrics":{"AP":"98.2%","AUC":"98.3%"},"uses_additional_data":false},{"leaderboard":"/sota/link-prediction-on-wn18rr","task":"Link Prediction","dataset":"WN18RR","model":"NBFNet","rank_in_archive_order":12,"of":75,"metrics":{"Hits@1":"0.497","Hits@10":"0.666","Hits@3":"0.573","MR":"636","MRR":"0.551"},"uses_additional_data":false},{"leaderboard":"/sota/link-prediction-on-yago3-10","task":"Link Prediction","dataset":"YAGO3-10","model":"NBFNet","rank_in_archive_order":8,"of":18,"metrics":{"Hits@1":"0.480","Hits@10":"0.708","Hits@3":"0.612","MRR":"0.563"},"uses_additional_data":false},{"leaderboard":"/sota/link-property-prediction-on-ogbl-biokg","task":"Link Property Prediction","dataset":"ogbl-biokg","model":"NBFNet","rank_in_archive_order":10,"of":16,"metrics":{"Ext. data":"No","Number of params":"734,209","Test MRR":"0.8317","Validation MRR":"0.8318"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2106.06935","atlas_url":"https://app.syntology.ai/?focus=2106.06935","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.06935"}},"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":"deterministic:regex_extraction","url":"https://github.com/DeepGraphLearning/NBFNet","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/fs302/EasyLink/blob/main/example/ogbl_ppa_ra.py","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/fs302/EasyLink","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":8,"ran_draft_wrong":2,"unverified":5},"by_repo_kind":{"official":{"samples":2,"ran":0,"repositories":1},"listed":{"samples":11,"ran":8,"repositories":1},"community":{"samples":2,"ran":2,"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":"2aad32b3b74abec9","entry":"drnl_node_labeling","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/common/seal_utils.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/common/seal_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":"2aad32b3b74abec9"}},{"code_sha256_prefix":"a27462150ae41053","entry":"evaluate_auc","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/common/eval_utils.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/common/eval_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":"a27462150ae41053"}},{"code_sha256_prefix":"e18c89b0a6b12062","entry":"evaluate_hits","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/common/eval_utils.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/common/eval_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":"e18c89b0a6b12062"}},{"code_sha256_prefix":"9df677a47f14ae09","entry":"extract_enclosing_subgraphs","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/common/seal_utils.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/common/seal_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":"9df677a47f14ae09"}},{"code_sha256_prefix":"fcaa1fff9342a53d","entry":"get_pos_neg_edges","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/common/seal_utils.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/common/seal_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":"fcaa1fff9342a53d"}},{"code_sha256_prefix":"9664f4b5c60ab1bf","entry":"index_to_mask","repo":"KiddoZhu/NBFNet-PyG","repo_kind":"community","path":"nbfnet/models.py","file_url":"https://github.com/KiddoZhu/NBFNet-PyG/blob/HEAD/nbfnet/models.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9664f4b5c60ab1bf"}},{"code_sha256_prefix":"00fab49fcf976780","entry":"load_basic_network","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/common/data_utils.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/common/data_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":"00fab49fcf976780"}},{"code_sha256_prefix":"4ddf5f547371a7f7","entry":"size_to_index","repo":"KiddoZhu/NBFNet-PyG","repo_kind":"community","path":"nbfnet/models.py","file_url":"https://github.com/KiddoZhu/NBFNet-PyG/blob/HEAD/nbfnet/models.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4ddf5f547371a7f7"}},{"code_sha256_prefix":"4ada13b9756aa281","entry":"sparse_to_tuple","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/common/data_utils.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/common/data_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":"4ada13b9756aa281"}},{"code_sha256_prefix":"f6e29676a8cc379b","entry":"train_test_split","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/common/data_utils.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/common/data_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":"f6e29676a8cc379b"}},{"code_sha256_prefix":"cb453fdedf2fff1d","entry":"adamic_adar","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/model/heuristic_similarity.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/model/heuristic_similarity.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":"cb453fdedf2fff1d"}},{"code_sha256_prefix":"5f30e06f74863f65","entry":"common_neighbors","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/model/heuristic_similarity.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/model/heuristic_similarity.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":"5f30e06f74863f65"}},{"code_sha256_prefix":"eab8b6a6ced6d93e","entry":"detect_variables","repo":"DeepGraphLearning/NBFNet","repo_kind":"official","path":"nbfnet/util.py","file_url":"https://github.com/DeepGraphLearning/NBFNet/blob/HEAD/nbfnet/util.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":"eab8b6a6ced6d93e"}},{"code_sha256_prefix":"70a68fd646c6e4a7","entry":"get_root_logger","repo":"DeepGraphLearning/NBFNet","repo_kind":"official","path":"nbfnet/util.py","file_url":"https://github.com/DeepGraphLearning/NBFNet/blob/HEAD/nbfnet/util.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":"70a68fd646c6e4a7"}},{"code_sha256_prefix":"213410a6123cfb65","entry":"resource_allocation","repo":"fs302/EasyLink","repo_kind":"listed","path":"easylink/model/heuristic_similarity.py","file_url":"https://github.com/fs302/EasyLink/blob/HEAD/easylink/model/heuristic_similarity.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":"213410a6123cfb65"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}