Back to paper library

Classic GNNs

Tune First, Compare Later

Original paper

Classic GNNs are Strong Baselines: Reassessing GNNs for Node Classification

Paper authors

Yuankai Luo · Lei Shi · Xiao-Ming Wu

First submitted to arXiv
arXiv:2406.08993
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@misc{graphlearningclassicgnns2024,
  title = {{Classic GNNs are Strong Baselines: Reassessing GNNs for Node Classification}},
  author = {Yuankai Luo and Lei Shi and Xiao-Ming Wu},
  year = {2024},
  eprint = {2406.08993},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.08993}
}
On this page

Graph Transformers first establish themselves on small molecular graphs, then move into node classification, especially graphs with millions of nodes. Papers introducing NodeFormer, SGFormer and Polynormer often leave GCN, GAT and GraphSAGE far behind.

Yuankai Luo and Lei Shi at Beihang University and Xiao-Ming Wu at Hong Kong Polytechnic University notice something: many new models still rely, explicitly or implicitly, on a GNN to learn local representations alongside global attention.

Has conventional message passing been underestimated for node classification?

Wu knows the question well. In 2018, he, Qimai Li and colleagues explained GCN as Laplacian smoothing and identified over-smoothing at depth.

Defining the Problem

Node classification uses a small set of known labels to predict other nodes' classes on a graph. Two types are distinguished:

  • Homophilic graphs: connected nodes mostly share a class, as with mutually citing papers.
  • Heterophilic graphs: connected nodes often have different classes.

GNNs are generally thought to assume homophily and thus struggle with heterophily, yet recent work finds standard GCN can do quite well there too.

Earlier reassessments, the authors argue, use too few and too narrow a range of datasets and incomplete tuning. This paper makes a sufficiently broad check of how far classic GNNs can go through hyperparameter tuning alone.

Solving the Problem

Three Classic Models

The subjects are three basic GNNs: GCN averages self and neighbors with weights determined by degrees; GraphSAGE weights self and the neighbor mean separately; GAT uses attention to determine each neighbor's share. The models themselves remain unchanged.

Four Hyperparameters

The settings are familiar from other neural networks:

  • Normalization: BatchNorm or LayerNorm before each layer's activation.
  • Dropout: after activation.
  • Residual connections: multiply the previous representation by WrW_r and add it directly to this layer:
hvl=Dropout(σ(Norm(hvl−1Wrl+∑u∈N(v)∪{v}1d^ud^vhul−1Wl)))h_v^{l}=\mathrm{Dropout}\Big(\sigma\Big(\mathrm{Norm}\Big(h_v^{l-1}W_r^l+\sum_{u\in\mathcal N(v)\cup\{v\}}\frac{1}{\sqrt{\hat d_u\hat d_v}}h_u^{l-1}W^l\Big)\Big)\Big)
  • Depth: try 1 through 10 layers.

Residual connections are especially useful on heterophilous graphs. Take an extreme example: six nodes in a ring, where neighbors always belong to different classes and each node's feature is the one-hot vector of its own class. After one GCN layer, each node's two neighbors of the other class outweigh it in the average, and all six nodes are misclassified; with a residual connection, each node keeps its own original information and all six are classified correctly. This is only a sketch; in practice WrW_r is learned.

Experimental Setup

There are 18 datasets:

  • 8 homophilic graphs: Cora, CiteSeer, PubMed, Computer, Photo, CS, Physics, WikiCS.
  • 6 heterophilic graphs: Squirrel, Chameleon, Amazon-Ratings, Roman-Empire, Minesweeper, Questions.
  • 4 large graphs: ogbn-proteins, ogbn-arxiv, ogbn-products and the pokec social network, ranging from 130,000 to 2.45 million nodes.

Comparisons include large-graph Transformers SGFormer, Polynormer, GOAT, NodeFormer and NAGphormer, plus GraphGPS and Exphormer. Heterophily-specialized GNNs such as H2GCN are added for heterophilic datasets.

The search follows Polynormer: learning rate {0.001, 0.005, 0.01}, hidden dimension {64, 256, 512}, optional normalization (BN or LN) and residuals, dropout {0.2, 0.3, 0.5, 0.7}, depth 1 to 10, and at most 2,500 epochs. The authors retrain the Graph Transformers under the same search ranges and training environment. Each result averages 5 initializations.

Discussion

Tuned classic GNNs rank first on 17 of 18 datasets. Consider the three groups separately.

Homophilic Graphs

Tuning raises GCN from 81.60% to 85.10% on Cora and 89.65% to 93.99% on Computer. GAT gains 4.16 percentage points on WikiCS to reach 81.07%, jumping from seventh to first ahead of Polynormer. Tuned GCN wins Cora, CiteSeer, PubMed and Physics.

Heterophilic Graphs

Gains are larger here. GCN rises by 6.34 and 4.98 percentage points on Squirrel and Chameleon, winning both, and also wins Minesweeper and Questions. Specialized H2GCN and GloGNN fall behind.

Roman-Empire is most dramatic: GCN rises from 73.69% to 91.27%, a 17.58-point gain. It is also the sole exception among 18 datasets, with Polynormer still best at 92.66%.

Large Graphs

Modelogbn-proteins (ROC-AUC)ogbn-arxivogbn-productspokec
GraphGPS77.1571.23Out of memoryOut of memory
Exphormer77.6272.32Out of memoryOut of memory
SGFormer79.9272.7681.5482.44
Polynormer79.5373.4083.8286.06
GCN (tuned)77.2973.5382.3386.33
GraphSAGE (tuned)82.2173.0083.8985.97
GAT (tuned)85.0173.3080.9986.19

All Graph Transformers in the table are retrained under the same conditions. GraphGPS and Exphormer run out of memory on 2.45-million-node ogbn-products and 1.63-million-node pokec. Classic GNNs win all four large graphs. GCN on pokec exceeds its original reported result by 10.88 percentage points; GAT on ogbn-proteins gains 12.99 points.

The authors interpret this as evidence that message passing remains very effective at learning large-graph node representations. Existing Graph Transformers have yet to truly solve GNNs' old problems of over-smoothing and long-range dependency.

Which Hyperparameter Matters Most?

Removing the four settings one at a time gives four observations:

  1. Normalization matters on large graphs, less on small ones. Without it on ogbn-proteins, GraphSAGE and GAT lose 4.79 and 4.69 percentage points. The authors suggest that varied feature distributions on large graphs make stable normalization useful.
  2. Dropout almost always helps. Removing it costs GraphSAGE 2.70 points on PubMed and 6.57 on Roman-Empire.
  3. Residuals matter most under heterophily. On Roman-Empire, removing them drops GCN by 16.43 points, from 91.27% to 74.84%. Almost the entire improvement comes from residuals.
  4. Heterophilic graphs usually need deeper networks.
Figure 1 of the paper: six curves plot depth from 2 to 10 layers. The upper row is GCN, the lower GraphSAGE. Columns show homophilic graphs (Computer, Photo, CS), heterophilic graphs (Roman-Empire, Minesweeper, Questions) and the large ogbn-arxiv graph. Homophilic accuracy levels near 6 layers or falls with depth; heterophilic curves mostly rise; ogbn-arxiv peaks at 4 to 5 then falls.
Figure 1 from Luo et al., taken from PDF page 9. The original caption is omitted.

The top row is GCN, the bottom GraphSAGE. Middle-column heterophilic curves generally rise with depth; most homophilic curves on the left peak before 6 layers. The authors suggest more complex heterophilic structure requires depth to capture node relationships, while residual connections make those deep networks trainable.

Conclusion

This paper proposes no new model. It simply tunes three of the oldest GNNs properly, winning 17 of 18 datasets while some Graph Transformers cannot even run on the largest two graphs.

The following year, the same authors bring this approach to graph-level tasks, add six common techniques to GCN, GIN and GatedGCN, and compare again with Graph Transformers.

When a new Graph Transformer trounces GCN on node classification, check the appendix first: did GCN get residuals and normalization, and how many layers were tried? Then decide how much confidence to place in the table.