# How Powerful are Graph Neural Networks?

Graph Isomorphism Networks match the Weisfeiler-Lehman test in discriminative power

Keyulu Xu, Weihua Hu, Jure Leskovec, Stefanie Jegelka · arXiv · 2018-10-1

- **Problem** GNN designs are chosen by trial and error, and little theory says what they can tell apart. Common variants using mean or max aggregation fail to separate some simple graph structures.
- **Method** GIN sums neighbor features, scales the node's own vector by 1 plus epsilon, and passes the result through an MLP. Unlike mean or max, the sum keeps different neighborhoods apart.
- **Results** GIN matches or beats other GNN variants on nine graph classification benchmarks. GIN-0 scored 92.4 on REDDIT-BINARY, compared to 50.0 for mean-MLP.

## Where GNN design gets stuck

Graph neural networks learn vectors for nodes and whole graphs, which is useful for molecules, social networks and biological data. Most of them run neighborhood aggregation: each node repeatedly mixes its own vector with the vectors of its neighbors. After k rounds, a node's vector reflects the structure within k hops, and a pooling step turns node vectors into a graph vector.

The trouble is that new GNN designs usually come from intuition and trial and error. Few results say what these models can and can't tell apart, so a choice of aggregator is hard to justify in advance. Many variants differ only in how they aggregate and pool, which makes their comparison hard without a shared yardstick.

The authors take a yardstick from graph theory, the Weisfeiler-Lehman (WL) test of graph isomorphism. The WL test distinguishes a broad class of graphs, and it also updates each node by aggregating its neighbors. The authors use it as a ceiling for what a GNN can separate.

## The WL test as a ceiling

The key insight is that a GNN is as discriminative as the WL test when its aggregation can represent injective functions. Injective here means that different inputs always map to different outputs. Because a node's neighbors can share identical features, the neighborhood is treated as a multiset, a set that allows repeats.

Mapping two neighborhoods to the same vector loses information, so a maximally powerful GNN needs an injective aggregator. The authors bound the ceiling first: if a GNN separates two non-isomorphic graphs, the WL test also decides they are not isomorphic. So no aggregation-based GNN can separate graphs that the WL test can't.

Theorem 3 gives the matching direction under two conditions: the neighbor aggregation and the update are injective, and so is the graph-level readout. With enough layers, such a GNN maps any two graphs that WL separates to different embeddings. The results assume that input node features come from a countable set, and the authors leave uncountable features for future work.

## Building GIN from sum aggregation

GIN uses a sum over neighbor features, because a sum can represent injective multiset functions where a mean can't. Lemma 5 says that for each bounded multiset X, the sum \\( h(X)=\\sum\_{x\\in X} f(x) \\) is unique. Any multiset function can then be written as a function φ applied to that sum.

The authors make this concrete with a node c and its neighbor multiset X. Corollary 6 uses \\( (1+\\epsilon)\\cdot f(c)+\\sum\_{x\\in X} f(x) \\), which keeps the node's own term apart from its neighbors. For infinitely many choices of ε, including all irrational numbers, this value is unique for each pair. MLPs can then learn f and φ, because the universal approximation theorem covers them.

The resulting GIN update is \\\[ h\_v^{(k)}=\\mathrm{MLP}^{(k)}\\big((1+\\epsilon^{(k)})\\cdot h\_v^{(k-1)}+\\sum\_{u\\in N(v)} h\_u^{(k-1)}\\big) \\\] The node's previous vector is scaled by 1 + ε, the neighbor vectors are summed, and an MLP produces the new vector. ε can be learned or kept as a fixed scalar, and the experiments test both settings. In the first iteration no MLP is needed before summing when inputs are one-hot, because the sum is already injective.

For graph outputs, GIN doesn't rely on the last layer alone. It applies a sum readout to every iteration and concatenates the results, so early and late structure both reach the graph vector. By Theorem 3 and Corollary 6, this readout generalizes the WL test and the WL subtree kernel.

## Why one-layer perceptrons fall short

Many GNNs use a one-layer perceptron, a linear map followed by a ReLU, instead of an MLP. Lemma 7 gives finite multisets X1 and X2 that differ yet produce the same sum of ReLU(Wx) for every linear map W. The authors trace this to the missing bias term, which lets the layer act much like a linear map followed by a plain sum.

A bias term and a large enough output dimension can help, so the failure isn't absolute. Still, a one-layer perceptron isn't a universal approximator of multiset functions, unlike an MLP. So its embeddings may not reflect structural similarity well, and simple linear classifiers may struggle to fit them.

## Where mean and max pooling collapse structures

Mean and max are permutation invariant, so they are valid multiset functions, but neither is injective. Take a graph where every node has the same feature a: mean and max return f(a) at every step, so the structure stays invisible. A sum gives 2·f(a) and 3·f(a) for the two structures, and those values differ.

The same problem appears when repeated features occur in other graphs. The authors show that the max over the neighbors of one node can give the same vector for two different neighborhoods, because repeated copies of a feature count once. Mean fails on another pair of structures where the two averages coincide, while the sum keeps them apart.

If node degrees are used as input features, mean can recover sum in principle, but max-pooling can't.

## What mean and max pooling still capture

Mean depends only on the distribution of elements, meaning their proportions, not on exact multiplicities. Corollary 8 says that the mean of f over a multiset gives the same value for two multisets exactly when they have the same distribution. Formally, \\( h(X)=\\frac{1}{\|X\|}\\sum\_{x\\in X} f(x) \\).

This can be enough when the distribution of neighbor features carries the signal. The authors suggest this may explain why mean aggregators work for node classification on rich features, such as article subjects and community detection.

Max-pooling keeps only the underlying set of a multiset, so repeated elements count once. The authors say it may suit tasks that need representative elements, and they point to prior work where max-pooling finds the skeleton of a 3D point cloud.

## Training fit as a check on representational power

The authors test representational power through training accuracy, reasoning that a more powerful model should fit training graphs better. To keep hyper-parameters fixed, they used 5 GNN layers including the input layer, 64 hidden units, minibatch size 128 and dropout 0.5. The WL subtree kernel was run with 4 iterations as the reference.

Both GIN-ϵ and GIN-0 almost perfectly fit the training sets. Learning ε gave no gain over fixing it to 0, so GIN-0 fits about as well as GIN-ϵ. By contrast, mean or max pooling and 1-layer perceptron variants severely underfit on many datasets.

The ranking by fit follows the theory: MLPs beat 1-layer perceptrons, and sum beats mean and max. No GNN exceeded the WL subtree kernel's training accuracy on these datasets, which fits the ceiling from theory. On IMDB-BINARY, none of the models fit the training set perfectly.

## Test accuracy and the Reddit result

Test accuracy comes from 10-fold cross-validation with LIBSVM across 9 benchmarks. The training epoch was picked by the best cross-validation accuracy averaged over the folds, so selection and reporting share those folds. On the social datasets the node features were one-hot encodings of degree, and on REDDIT all nodes shared the same feature.

Mean-aggregation models don't capture the structure of these unlabeled graphs, so they perform no better than random guessing. Even when node degrees are given as input features, the mean-MLP reached 71.2±4.6% on REDDIT-BINARY.

Across the nine benchmarks, the authors report that GINs match or beat the other GNN variants. GIN-0 slightly but consistently outperforms GIN-ϵ, and since both fit the training data equally well, the authors attribute this to GIN-0's simplicity.

## Limits of the evidence

Max-pooling wasn't run on REDDIT-BINARY, REDDIT-MULTI5K or COLLAB because of GPU memory constraints. The experiments cover only the nine graph classification benchmarks, with no node classification or link prediction runs.

The authors state that their theory doesn't directly address generalization, so the test results are an empirical check rather than a proof. The MUTAG validation set has only 18 points, which the authors say makes validation-based selection unstable, so they used cross-validation. Uncountable node feature spaces, and how close learned features lie in the image of a function, are left for future work.

The authors also leave going beyond neighborhood aggregation to future work.

## Paper info

- **Authors**: Keyulu Xu, Weihua Hu, Jure Leskovec, Stefanie Jegelka
- **Venue**: arXiv · Preprint
- **First published**: 2018-10-1
- **Added**: 2026-11-11
- **Updated**: 2019-2-22
- **Version**: v3
- **arXiv**: 1810.00826
- **Category**: cs.LG · cs.CV · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1810.00826v3) · [PDF ↗](https://arxiv.org/pdf/1810.00826v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Keyulu Xu, Weihua Hu, Jure Leskovec, Stefanie Jegelka (2018). How Powerful are Graph Neural Networks?. arXiv:1810.00826v3. https://arxiv.org/abs/1810.00826v3

**BibTeX**

```
@misc{xu2018powerful,
  title = {{How Powerful are Graph Neural Networks?}},
  author = {Keyulu Xu and Weihua Hu and Jure Leskovec and Stefanie Jegelka},
  year = {2018},
  eprint = {1810.00826},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1810.00826v3}
}
```

## Other paper commentary

- [Modeling Relational Data with Graph Convolutional Networks](https://refivu.com/en/papers/0f5e1839-5aad-4ffe-b183-7d735f8896a8-modeling-relational-data-with-graph-convolutional-networks.md)
- [Graph Neural Networks: A Review of Methods and Applications](https://refivu.com/en/papers/a985ee6a-3fda-41af-b6ea-0451377e5861-graph-neural-networks-a-review-of-methods-and.md)
- [Federated Social Recommendation with Graph Neural Network](https://refivu.com/en/papers/ce54fcd7-f119-4f48-9809-3fe4f5cc05cd-federated-social-recommendation-with-graph-neural-network.md)
- [MixHop: Higher-Order Graph Convolutional Architectures via Sparsified Neighborhood Mixing](https://refivu.com/en/papers/1250a8b5-0d20-48a6-bf8a-8ec6a0c220d1-mixhop-higher-order-graph-convolutional-architectures-via.md)
- [Exact Combinatorial Optimization with Graph Convolutional Neural Networks](https://refivu.com/en/papers/8df34e94-f13d-47fe-92a7-0d3d6b6d4386-exact-combinatorial-optimization-with-graph-convolutional.md)
- [Graph Attention Networks](https://refivu.com/en/papers/9453459f-8cee-4a2b-bdcf-07c59d5154f7-graph-attention-networks.md)
- [Qwen Technical Report](https://refivu.com/en/papers/f986d6de-9674-460e-b929-a3f8c297b3e5-qwen-technical-report.md)
- [A Survey Of Methods For Explaining Black Box Models](https://refivu.com/en/papers/e8fafeb3-dfaa-4e9a-b461-dc36765f1ed6-a-survey-of-methods-for-explaining-black-box.md)
- [Image Super-Resolution Using Very Deep Residual Channel Attention Networks](https://refivu.com/en/papers/4d16f8f5-55cc-4ee1-82f5-57e540466eec-image-super-resolution-using-very-deep-residual-channel.md)
- [OpenAI Gym](https://refivu.com/en/papers/0be35f1c-219a-4606-a9f9-894f5c111448-openai-gym.md)
- [OpenPose: Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields](https://refivu.com/en/papers/5a0057d5-5ad8-405d-b3a0-1ddc3220df6c-openpose-realtime-multi-person-2d-pose-estimation-using.md)
- [DETRs Beat YOLOs on Real-time Object Detection](https://refivu.com/en/papers/2872fb04-6c8b-4f48-a976-80e6dd5be309-detrs-beat-yolos-on-real-time-object-detection.md)

## Terms in this paper

- [GraphSAGE](https://refivu.com/en/terms/c4baff75600a-graphsage)
- [Graph Convolutional Networks](https://refivu.com/en/terms/44efaa9b9eb8-graph-convolutional-networks)
- [graph neural network](https://refivu.com/en/terms/06cd100552dd-graph-neural-network)
- [Node classification](https://refivu.com/en/terms/d5c2990db2b3-node-classification)
- [Multi-Layer Perceptrons](https://refivu.com/en/terms/0d50d7a305f0-multi-layer-perceptrons)
- [Mean aggregator](https://refivu.com/en/terms/a2158cd74a8a-mean-aggregator)
- [MUTAG](https://refivu.com/en/terms/895e05471118-mutag)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/290a3c63-2393-4f40-9947-61fb2d0b7f7a-how-powerful-are-graph-neural-networks)
