Back to paper library
Paper notesarXiv 2018ICLR 2019

GIN

Summing Is What Counts

Original paper

How Powerful are Graph Neural Networks?

Paper authors

Keyulu Xu · Weihua Hu · Jure Leskovec · Stefanie Jegelka

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}
}
On this page

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 kk, each node vv aggregates its neighbors' representations and combines them with its own:

av(k)=AGGREGATE(k)({hu(k−1):u∈N(v)}),hv(k)=COMBINE(k)(hv(k−1),av(k))a_v^{(k)}=\mathrm{AGGREGATE}^{(k)}\left(\left\{h_u^{(k-1)}:u\in\mathcal N(v)\right\}\right),\qquad h_v^{(k)}=\mathrm{COMBINE}^{(k)}\left(h_v^{(k-1)},a_v^{(k)}\right)

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.

Figure 2 of the paper: the input multiset contains two red balls and four blue balls, followed by the information preserved by sum, mean and max. Sum keeps the full multiset, mean keeps red/blue proportions, and max keeps only the presence of red and blue.
Figure 2 from Xu et al., taken from PDF page 6. The original caption is omitted.
  • Sum captures the full multiset.
  • Mean captures element proportions. {a,b}\{a, b\} and {a,a,b,b}\{a, a, b, b\} 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:

Figure 3 of the paper: (a) v has two same-color neighbors and v' has three; neither mean nor max distinguishes them. (b) v has one green and one red neighbor, v' one green and two red; max fails. (c) v has one green and one red, v' two green and two red; both mean and max fail.
Figure 3 from Xu et al., taken from PDF page 6. The main caption is omitted.

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:

hv(k)=MLP(k)((1+ϵ(k))⋅hv(k−1)+∑u∈N(v)hu(k−1))h_v^{(k)}=\mathrm{MLP}^{(k)}\left(\left(1+\epsilon^{(k)}\right)\cdot h_v^{(k-1)}+\sum_{u\in\mathcal N(v)}h_u^{(k-1)}\right)

ϵ\epsilon may be learned or fixed. Multiplying self by 1+ϵ1+\epsilon keeps self distinct from neighbors. Corollary 6 proves this is injective over the pair (self, neighbor multiset) for many choices of ϵ\epsilon, including irrational values. The experimental version with ϵ=0\epsilon=0 is called GIN-0.

For graph classification, node representations are summed separately at each layer, then concatenated across all layers:

hG=CONCAT(READOUT({hv(k)∣v∈G}) | k=0,1,…,K)h_G=\mathrm{CONCAT}\left(\mathrm{READOUT}\left(\left\{h_v^{(k)}\mid v\in G\right\}\right)\ \middle|\ k=0,1,\dots,K\right)

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-ϵ\epsilon 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

DatasetIMDB-BIMDB-MRDT-BRDT-M5KCOLLAB
WL subtree73.850.981.052.578.9
GIN-075.152.392.457.580.2
Mean, MLP73.752.350.020.079.2
Mean, single-layer (GCN)74.051.950.020.079.0
Max, single-layer (GraphSAGE)72.350.9———
DatasetMUTAGPROTEINSPTCNCI1
WL subtree90.475.059.986.0
GIN-089.476.264.682.7
Mean, MLP83.575.566.680.9
Mean, single-layer (GCN)85.676.064.280.2
Max, single-layer (GraphSAGE)85.175.963.977.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-ϵ\epsilon 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.