Papers › Labeling Trick: A Theory of Using Graph Neural Networks for Multi-Node Representation Learning

Labeling Trick: A Theory of Using Graph Neural Networks for Multi-Node Representation Learning

30 Oct 2020NeurIPS 2021 12arXiv:2010.16103archive 2025-07-28

Muhan Zhang, Pan Li, Yinglong Xia, Kai Wang, Long Jin

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.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2010.16103")

Code

Syntology Ran 2 of 7 code samples harvested from 2 repositories linked to this paper; 5 have no recorded run. Of those that ran: 2 ran · our draft was wrong.

By repository: official repository: 5 samples from 1 repository, 2 ran; community (archive-listed): 2 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

facebookresearch/SEAL_OGB officialmentioned in papermentioned on GitHubpytorchMIT report
dmlc/dgl pytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

7 samples harvested; 2 ran; 0 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
5unverified

Licence: 1 of the 7 samples is pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

k_hop_subgraph facebookresearch/SEAL_OGB/utils.py official repository ran · our draft was wrong MIT (permissive) · c14b46da419ba958 · report
neighbors facebookresearch/SEAL_OGB/utils.py official repository ran · our draft was wrong MIT (permissive) · fe208db98a8e47fb · report
drnl_node_labeling facebookresearch/SEAL_OGB/utils.py official repository unverified MIT recorded; this copy not marked cleared · pointer only · 7850cdbb204f1583 · report
evaluate_hits facebookresearch/seal_ogb/seal_link_pred.py official repository unverified MIT (permissive) · ab8f4436bf3f8fc9 · report
evaluate_mrr facebookresearch/seal_ogb/seal_link_pred.py official repository unverified MIT (permissive) · c0086a518214536a · report
check_pytorch dmlc/dgl/python/dgl/label_informativeness.py community (archive-listed) unverified Apache-2.0 (permissive) · e053d92230933aac · report
edge_label_informativeness dmlc/dgl/python/dgl/label_informativeness.py community (archive-listed) unverified Apache-2.0 (permissive) · b47785e45de29a98 · report

Tasks

General ClassificationGraph ClassificationLink PredictionLink Property PredictionNode ClassificationRepresentation Learning

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Link Property Prediction ogbl-citation2 SEAL Ext. data No #11 of 23 Archive leaderboard report
Link Property Prediction ogbl-citation2 SEAL Number of params 260802 #11 of 23 Archive leaderboard report
Link Property Prediction ogbl-citation2 SEAL Test MRR 0.8767 ± 0.0032 #11 of 23 Archive leaderboard report
Link Property Prediction ogbl-citation2 SEAL Validation MRR 0.8757 ± 0.0031 #11 of 23 Archive leaderboard report
Link Property Prediction ogbl-collab SEAL-nofeat (val as input) Ext. data No #15 of 34 Archive leaderboard report
Link Property Prediction ogbl-collab SEAL-nofeat (val as input) Number of params 501570 #15 of 34 Archive leaderboard report
Link Property Prediction ogbl-collab SEAL-nofeat (val as input) Test Hits@50 0.6474 ± 0.0043 #15 of 34 Archive leaderboard report
Link Property Prediction ogbl-collab SEAL-nofeat (val as input) Validation Hits@50 0.6495 ± 0.0043 #15 of 34 Archive leaderboard report
Link Property Prediction ogbl-collab SEAL-nofeat Ext. data No #18 of 34 Archive leaderboard report
Link Property Prediction ogbl-collab SEAL-nofeat Number of params 501570 #18 of 34 Archive leaderboard report
Link Property Prediction ogbl-collab SEAL-nofeat Test Hits@50 0.5471 ± 0.0049 #18 of 34 Archive leaderboard report
Link Property Prediction ogbl-collab SEAL-nofeat Validation Hits@50 0.6495 ± 0.0043 #18 of 34 Archive leaderboard report
Link Property Prediction ogbl-ddi SEAL Ext. data No #26 of 31 Archive leaderboard report
Link Property Prediction ogbl-ddi SEAL Number of params 531138 #26 of 31 Archive leaderboard report
Link Property Prediction ogbl-ddi SEAL Test Hits@20 0.3056 ± 0.0386 #26 of 31 Archive leaderboard report
Link Property Prediction ogbl-ddi SEAL Validation Hits@20 0.2849 ± 0.0269 #26 of 31 Archive leaderboard report
Link Property Prediction ogbl-ppa SEAL Ext. data No #15 of 26 Archive leaderboard report
Link Property Prediction ogbl-ppa SEAL Number of params 709122 #15 of 26 Archive leaderboard report
Link Property Prediction ogbl-ppa SEAL Test Hits@100 0.4880 ± 0.0316 #15 of 26 Archive leaderboard report
Link Property Prediction ogbl-ppa SEAL Validation Hits@100 0.5125 ± 0.0252 #15 of 26 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections