How Powerful are Graph Neural Networks?
- Publication
- ICLR 2019Conference
- First submitted to arXiv
- arXiv:1810.00826
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{graphlearninggin2018,
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.00826}
}
By 2018, graph-neural-network variants are too numerous to count. GCN, GraphSAGE and GAT each aggregate differently. New papers mostly establish superiority through experiments; few explain why, or which graph structures they cannot distinguish.
Keyulu Xu and Stefanie Jegelka at MIT, together with Weihua Hu and Jure Leskovec at Stanford, change the question. Before asking about accuracy, ask whether a GNN can map two different graphs to different representations.
The title asks how powerful graph neural networks are. The answer has a ceiling, set by an algorithm from 1968.
Defining the Problem
A Common Form for Neighbor Aggregation
The authors first write existing GNNs in a common form. At layer , each node aggregates its neighbors' representations and combines them with its own:
For graph classification, a final READOUT combines all node representations into one graph representation. GraphSAGE aggregates with max pooling and concatenation; GCN averages self and neighbors, then applies weights and ReLU.
Neighbors Form a Multiset
The key observation is that neighboring features form a multiset, where a value may appear multiple times. Two blue neighbors and three blue neighbors are different multisets.
If an aggregator maps two different multisets to the same result, the GNN cannot distinguish those neighborhoods. So the question of GNN power reduces to whether its aggregation function is injective over multisets.
The WL Test
Graph isomorphism offers the most direct measure: isomorphic graphs should share a representation, and non-isomorphic graphs should differ. No polynomial-time algorithm is known for this problem, so the authors use a weaker but practical standard: the Weisfeiler–Lehman (WL) test.
WL repeatedly recolors nodes. Initially all nodes have one color; each round maps a node's current color together with the multiset of neighboring colors to a new color. If two graphs have different color counts in any round, they are non-isomorphic.
Take a four-node path and a four-node star. The two graphs must be colored together so their color numbers can be compared. They already differ after the first round: the path has two ends and two middle nodes, the star three leaves and one center. WL judges them non-isomorphic.
Solving the Problem
The Ceiling for GNNs
Lemma 2 states that whenever a neighbor-aggregation GNN maps two graphs to different representations, WL can also distinguish them. Such GNNs are at most as discriminative as WL.
Conversely, Theorem 3 states that if aggregation, combination and READOUT are all injective, a sufficiently deep GNN can match WL.
The reasoning is intuitive. Each WL round is an injective hash over multisets; an injective GNN aggregator can imitate it round by round. It can also map similar substructures to nearby vectors, something discrete colors cannot do.
Sum, Mean and Max
Which aggregators are injective? The authors prove that sum can represent injective multiset functions, whereas common mean and max aggregators cannot.

- Sum captures the full multiset.
- Mean captures element proportions. and have the same mean.
- Max captures only which elements appear, regardless of repetition.
Figure 3 of the paper draws three graph structures where the mean and the max fail:

Start with case (a). When every node has identical features, mean and max always return that value, regardless of neighbor count. The graph structure becomes entirely invisible.
GIN
Using sum, the authors combine aggregation and combination into one step, with a multilayer perceptron (MLP) learning the injective function:
may be learned or fixed. Multiplying self by keeps self distinct from neighbors. Corollary 6 proves this is injective over the pair (self, neighbor multiset) for many choices of , including irrational values. The experimental version with is called GIN-0.
For graph classification, node representations are summed separately at each layer, then concatenated across all layers:
Deeper layers represent larger subtree structures; shallow features sometimes generalize better, so all are retained.
GIN separates the path from the star, but it cannot separate a hexagon from two triangles, whatever the weights. Every node in both graphs has exactly two neighbors, so WL sees the same thing in every round, and GIN can only produce the same representation. One graph has two triangles and the other has none, yet an aggregation-based GNN cannot see the difference.
Weaker Can Still Be Useful
The authors also place GCN and GraphSAGE in this framework. With single-layer perceptrons, mean or max, they are weaker than WL but still useful. Mean learns distributions; when a task cares about statistical proportions of neighboring features rather than exact structure, it suffices. With diverse, rarely repeated features, mean is as powerful as sum. The authors suggest this explains why mean-based models such as GCN work well on feature-rich tasks like paper-topic classification and community detection.
Max learns the underlying set, suiting tasks that need representative elements.
Discussion
Experimental Setup
There are 9 graph-classification datasets: 4 from bioinformatics (MUTAG, PTC, NCI1, PROTEINS) and 5 social-network datasets (COLLAB, IMDB-BINARY, IMDB-MULTI, REDDIT-BINARY, REDDIT-MULTI5K). Bioinformatics nodes have categorical features. Social-network nodes lack features: REDDIT uses the same number for every node, while the others use one-hot degrees. Evaluation uses 10-fold cross-validation.
Comparisons include graph kernels, existing GNNs and GIN variants replacing sum with mean or max, or MLP with a single-layer perceptron. GCN corresponds to mean/single-layer, GraphSAGE to max/single-layer.
Can It Fit the Training Set?
The theory concerns expressiveness, so training accuracy is the most direct test. Training curves show MLP versions fitting better than single-layer perceptrons, and sum better than mean or max. GIN-0 and GIN- fit almost every training set to nearly 100%.
No GNN exceeds the WL subtree kernel's training accuracy, consistent with the WL ceiling.
Test Accuracy
| Dataset | IMDB-B | IMDB-M | RDT-B | RDT-M5K | COLLAB |
|---|---|---|---|---|---|
| WL subtree | 73.8 | 50.9 | 81.0 | 52.5 | 78.9 |
| GIN-0 | 75.1 | 52.3 | 92.4 | 57.5 | 80.2 |
| Mean, MLP | 73.7 | 52.3 | 50.0 | 20.0 | 79.2 |
| Mean, single-layer (GCN) | 74.0 | 51.9 | 50.0 | 20.0 | 79.0 |
| Max, single-layer (GraphSAGE) | 72.3 | 50.9 | — | — | — |
| Dataset | MUTAG | PROTEINS | PTC | NCI1 |
|---|---|---|---|---|
| WL subtree | 90.4 | 75.0 | 59.9 | 86.0 |
| GIN-0 | 89.4 | 76.2 | 64.6 | 82.7 |
| Mean, MLP | 83.5 | 75.5 | 66.6 | 80.9 |
| Mean, single-layer (GCN) | 85.6 | 76.0 | 64.2 | 80.2 |
| Max, single-layer (GraphSAGE) | 85.1 | 75.9 | 63.9 | 77.7 |
This table shows selected methods, with mean 10-fold accuracy (%). The two REDDIT datasets stand out. All nodes have identical features, leaving mean-based models blind to structure. RDT-B binary accuracy is 50.0 ± 0.0%, and RDT-M5K five-class accuracy is 20.0 ± 0.0%—chance level. GIN-0 reaches 92.4% and 57.5%. Even giving degrees as features, the authors add, brings mean-based models only to 71.2% and 41.3%.
GIN is best or tied best on all five social-network datasets. Bioinformatics results are less one-sided. On NCI1, the WL subtree kernel clearly wins (86.0% versus 82.7%); on MUTAG, GIN trails WL and PATCHY-SAN's 92.6%; on PTC, mean/MLP wins. These datasets are small and standard deviations large: GIN-0 on PTC scores 64.6 ± 7.0%.
GIN-0 and GIN- fit training data similarly, but GIN-0 consistently does slightly better on tests, perhaps because it is simpler.
Conclusion
GIN turns GNN power into a provable question. Neighbor-aggregation GNNs can distinguish graphs at most as well as WL. Reaching that ceiling requires multiset-injective aggregation: sum can do this, mean and max cannot. Designed accordingly, GIN uses sum and an MLP to substantially outperform mean-based models on social-network graph classification.
The ceiling remains. GIN can never distinguish a hexagon from two triangles; later work adds substructure counts, positional encodings or higher-order WL to get past this wall.
For graph classification with few node features, aggregate by sum, and remember the MLP biases.