{"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/revisiting-graph-neural-networks-for-link-1","title":"Labeling Trick: A Theory of Using Graph Neural Networks for Multi-Node Representation Learning","arxiv_id":"2010.16103","date":"2020-10-30","proceeding":"NeurIPS 2021 12","authors":["Muhan Zhang","Pan Li","Yinglong Xia","Kai Wang","Long Jin"],"abstract":"In this paper, we provide a theory of using graph neural networks (GNNs) for multi-node representation learning (where we are interested in learning a representation for a set of more than one node, such as link). We know that GNN is designed to learn single-node representations. When we want to learn a node set representation involving multiple nodes, a common practice in previous works is to directly aggregate the single-node representations obtained by a GNN into a joint node set representation. In this paper, we show a fundamental constraint of such an approach, namely the inability to capture the dependence between nodes in the node set, and argue that directly aggregating individual node representations does not lead to an effective joint representation for multiple nodes. Then, we notice that a few previous successful works for multi-node representation learning, including SEAL, Distance Encoding, and ID-GNN, all used node labeling. These methods first label nodes in the graph according to their relationships with the target node set before applying a GNN. Then, the node representations obtained in the labeled graph are aggregated into a node set representation. By investigating their inner mechanisms, we unify these node labeling techniques into a single and most general form -- labeling trick. We prove that with labeling trick a sufficiently expressive GNN learns the most expressive node set representations, thus in principle solves any joint learning tasks over node sets. Experiments on one important two-node representation learning task, link prediction, verified our theory. Our work explains the superior performance of previous node-labeling-based methods, and establishes a theoretical foundation of using GNNs for multi-node representation learning.","url_abs":"https://arxiv.org/abs/2010.16103v5","url_pdf":"https://arxiv.org/pdf/2010.16103v5.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":"revisiting-graph-neural-networks-for-link-1","repo_url":"https://github.com/facebookresearch/SEAL_OGB","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"revisiting-graph-neural-networks-for-link-1","repo_url":"https://github.com/dmlc/dgl/tree/master/examples/pytorch/seal","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"classification","task_name":"General Classification"},{"task_slug":"graph-classification","task_name":"Graph Classification"},{"task_slug":"link-prediction","task_name":"Link Prediction"},{"task_slug":"link-property-prediction","task_name":"Link Property Prediction"},{"task_slug":"node-classification","task_name":"Node Classification"},{"task_slug":"representation-learning","task_name":"Representation Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/link-property-prediction-on-ogbl-citation2","task":"Link Property Prediction","dataset":"ogbl-citation2","model":"SEAL","rank_in_archive_order":11,"of":23,"metrics":{"Ext. data":"No","Number of params":"260802","Test MRR":"0.8767 ± 0.0032","Validation MRR":"0.8757 ± 0.0031"},"uses_additional_data":false},{"leaderboard":"/sota/link-property-prediction-on-ogbl-collab","task":"Link Property Prediction","dataset":"ogbl-collab","model":"SEAL-nofeat (val as input)","rank_in_archive_order":15,"of":34,"metrics":{"Ext. data":"No","Number of params":"501570","Test Hits@50":"0.6474 ± 0.0043","Validation Hits@50":"0.6495 ± 0.0043"},"uses_additional_data":false},{"leaderboard":"/sota/link-property-prediction-on-ogbl-collab","task":"Link Property Prediction","dataset":"ogbl-collab","model":"SEAL-nofeat","rank_in_archive_order":18,"of":34,"metrics":{"Ext. data":"No","Number of params":"501570","Test Hits@50":"0.5471 ± 0.0049","Validation Hits@50":"0.6495 ± 0.0043"},"uses_additional_data":false},{"leaderboard":"/sota/link-property-prediction-on-ogbl-ddi","task":"Link Property Prediction","dataset":"ogbl-ddi","model":"SEAL","rank_in_archive_order":26,"of":31,"metrics":{"Ext. data":"No","Number of params":"531138","Test Hits@20":"0.3056 ± 0.0386","Validation Hits@20":"0.2849 ± 0.0269"},"uses_additional_data":false},{"leaderboard":"/sota/link-property-prediction-on-ogbl-ppa","task":"Link Property Prediction","dataset":"ogbl-ppa","model":"SEAL","rank_in_archive_order":15,"of":26,"metrics":{"Ext. data":"No","Number of params":"709122","Test Hits@100":"0.4880 ± 0.0316","Validation Hits@100":"0.5125 ± 0.0252"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2010.16103","atlas_url":"https://app.syntology.ai/?focus=2010.16103","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2010.16103"}},"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/facebookresearch/SEAL_OGB","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dmlc/dgl/tree/master/examples/pytorch/seal","reach":null}],"summary":{"ran_draft_wrong":2,"unverified":5},"by_repo_kind":{"official":{"samples":5,"ran":2,"repositories":1},"listed":{"samples":2,"ran":0,"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":1,"samples":[{"code_sha256_prefix":"c14b46da419ba958","entry":"k_hop_subgraph","repo":"facebookresearch/SEAL_OGB","repo_kind":"official","path":"utils.py","file_url":"https://github.com/facebookresearch/SEAL_OGB/blob/HEAD/utils.py","link_basis":"plan_row","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":"c14b46da419ba958"}},{"code_sha256_prefix":"fe208db98a8e47fb","entry":"neighbors","repo":"facebookresearch/SEAL_OGB","repo_kind":"official","path":"utils.py","file_url":"https://github.com/facebookresearch/SEAL_OGB/blob/HEAD/utils.py","link_basis":"plan_row","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":"fe208db98a8e47fb"}},{"code_sha256_prefix":"e053d92230933aac","entry":"check_pytorch","repo":"dmlc/dgl","repo_kind":"listed","path":"python/dgl/label_informativeness.py","file_url":"https://github.com/dmlc/dgl/blob/HEAD/python/dgl/label_informativeness.py","link_basis":"first_harvest_node","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":"e053d92230933aac"}},{"code_sha256_prefix":"7850cdbb204f1583","entry":"drnl_node_labeling","repo":"facebookresearch/SEAL_OGB","repo_kind":"official","path":"utils.py","file_url":"https://github.com/facebookresearch/SEAL_OGB/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"7850cdbb204f1583"}},{"code_sha256_prefix":"b47785e45de29a98","entry":"edge_label_informativeness","repo":"dmlc/dgl","repo_kind":"listed","path":"python/dgl/label_informativeness.py","file_url":"https://github.com/dmlc/dgl/blob/HEAD/python/dgl/label_informativeness.py","link_basis":"first_harvest_node","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":"b47785e45de29a98"}},{"code_sha256_prefix":"ab8f4436bf3f8fc9","entry":"evaluate_hits","repo":"facebookresearch/seal_ogb","repo_kind":"official","path":"seal_link_pred.py","file_url":"https://github.com/facebookresearch/seal_ogb/blob/HEAD/seal_link_pred.py","link_basis":"first_harvest_node","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":"ab8f4436bf3f8fc9"}},{"code_sha256_prefix":"c0086a518214536a","entry":"evaluate_mrr","repo":"facebookresearch/seal_ogb","repo_kind":"official","path":"seal_link_pred.py","file_url":"https://github.com/facebookresearch/seal_ogb/blob/HEAD/seal_link_pred.py","link_basis":"first_harvest_node","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":"c0086a518214536a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}