Improving Graph Neural Networks on Multi-node Tasks with the Labeling Trick
Abstract
In this paper, we study using graph neural networks (GNNs) for multi-node representation learning, where a representation for a set of more than one node (such as a link) is to be learned. Existing GNNs are mainly designed to learn single-node representations. When used for multi-node representation learning, a common practice is to directly aggregate the single-node representations obtained by a GNN. In this paper, we show a fundamental limitation of such an approach, namely the inability to capture the dependence among multiple nodes in the node set. A straightforward solution is to distinguish target nodes from others. Formalizing this idea, we propose, which first labels nodes in the graph according to their relationships with the target node set before applying a GNN and then aggregates node representations obtained in the labeled graph for multi-node representations. Besides node sets in graphs, we also extend labeling tricks to posets, subsets and hypergraphs. Experiments verify that the labeling trick technique can boost GNNs on various tasks, including undirected link prediction, directed link prediction, hyperedge prediction, and subgraph prediction. Our work explains the superior performance of previous node-labeling-based methods and establishes a theoretical foundation for using GNNs for multi-node representation learning.
Benchmark Results
Tested on 4 datasets 1 baseline value reported too low
Tables show presented results in global context (best 3 papers + GCN + MLP).
OGB
| # | Model | Hits@50 ↑ | Paper |
|---|---|---|---|
| 1 | PROXI | 0.7650
±0.0027 | |
| 2 | OGB Leader | 0.7129
±0.0018 | |
| 3 | GIDN | 0.7096
±0.0055 | |
| 9 | GCN | 0.6621
±0.0033 | |
| 20 | SEAL | 0.6474
±0.0043 best reported | best at pub: Labeling Trick: A Theory of Using Graph Neural Networks for Multi-Node Representation Learning (NeurIPS 2020) best today: Node Identifiers: Compact, Discrete Representations for Efficient Graph Learning (ICLR 2024) |
| 40 | ZO-S | 0.5469
±0.0051 | This paper |
| 47 | ZO | 0.5329
±0.0023 | This paper |
| 72 | ZO-OS | 0.4917
±0.0329 | This paper |
| 93 | NO | 0.4475
±0.0107 | This paper |
| 94 | MLP | 0.4438
±0.0347 |
| # | Model | Hits@20 ↑ | Paper |
|---|---|---|---|
| 1 | ELGNN | 0.9777
±0.0037 | |
| 2 | GIDN | 0.9542 | |
| 3 | AGDN | 0.9538
±0.0094 | |
| 20 | SAGE | 0.6719
±0.0118 | |
| 43 | SEAL | 0.4974
±0.0239 best reported | best at pub: Labeling Trick: A Theory of Using Graph Neural Networks for Multi-Node Representation Learning (NeurIPS 2020) best today: Link Prediction with Untrained Message Passing Layers (2024) |
| 49 | ZO-OS | 0.4124
±0.0149 | This paper |
| 55 | NO | 0.3707
±0.0507 | This paper |
| 62 | ZO-S | 0.2927
±0.0053 | This paper |
| 68 | ZO | 0.2390
±0.0075 | This paper |
| # | Model | Hits@100 ↑ | Paper |
|---|---|---|---|
| 1 | OGB Leader | 0.6524
±0.0150 | |
| 2 | PRB | 0.6347
±0.0175 | |
| 3 | LPFormer | 0.6332
±0.0063 | |
| 14 | SAGE | 0.5013
±0.0055 | |
| 19 | SEAL | 0.4880
±0.0316 | This paper |
| 23 | MLP | 0.4600 | |
| 30 | ZO-OS | 0.4327
±0.0119 | This paper |
| 34 | ZO | 0.3775
±0.0342 | This paper |
| 36 | ZO-S | 0.3604
±0.0450 | This paper |
| 60 | NO | 0.1867
±0.0132 | This paper |
| # | Model | MRR ↑ | Paper |
|---|---|---|---|
| 1 | CFG | 0.8997
±0.0015 | |
| 2 | SIEG | 0.8987
±0.0018 | |
| 3 | LPFormer | 0.8981
±0.0013 | |
| 8 | SEAL | 0.8767
±0.0032 | This paper |
| 12 | GCN | 0.8705
±0.0004 | |
| 22 | NO | 0.8474
±0.0021 | This paper |
| 31 | ZO-OS | 0.8285
±0.0043 | This paper |
| 33 | ZO-S | 0.8245
±0.0062 | This paper |
| 45 | ZO | 0.7850
±0.0108 | This paper |
| 71 | MLP | 0.3917
±0.0044 |
