Back to paper library
Paper notesarXiv 2016ICLR 2017

GCN

Is One Parameter Enough?

Original paper

Semi-Supervised Classification with Graph Convolutional Networks

Paper authors

Thomas N. Kipf · Max Welling

Publication
ICLR 2017Conference
First submitted to arXiv
arXiv:1609.02907
Cite this paper · BibTeX

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

@misc{graphlearninggcn2016,
  title = {{Semi-Supervised Classification with Graph Convolutional Networks}},
  author = {Thomas N. Kipf and Max Welling},
  year = {2016},
  eprint = {1609.02907},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1609.02907}
}
On this page

You have 2,708 papers, each with bag-of-words features, linked by 5,429 citations. Only 140 have topic labels—20 for each of seven topics. The model must guess the rest.

This is semi-supervised node classification on Cora. Intuitively, papers that cite one another should concern the same topic; the question is how to put that intuition into a model.

Thomas Kipf and Max Welling at the University of Amsterdam give a very short answer. At each layer, every node takes a weighted average of its own and its neighbors' features using fixed proportions, then multiplies by a weight matrix. Stack two layers and stop. On Cora, this model reaches 81.5%, against the previous best of 75.7%.

It is called GCN, a name that later becomes almost synonymous with graph neural networks.

Defining the Problem

The Graph as a Regularizer

Before GCN, a common approach put the graph into the loss:

L=L0+λ Lreg,Lreg=∑i,jAij∥f(Xi)−f(Xj)∥2\mathcal{L}=\mathcal{L}_0+\lambda\,\mathcal{L}_{\text{reg}},\qquad \mathcal{L}_{\text{reg}}=\sum_{i,j}A_{ij}\left\|f(X_i)-f(X_j)\right\|^2

L0\mathcal{L}_0 is the supervised loss on labeled nodes, while Lreg\mathcal{L}_{\text{reg}} penalizes large differences in connected nodes' outputs. Label propagation and manifold regularization belong to this family.

The authors point out that these methods assume an edge signifies similarity. Many citations fit that assumption, but edges may carry other information, too. Hard-coding them as similarity restricts what the model can learn.

Another approach, graph embedding such as DeepWalk, first runs random walks to learn a vector for each node, then trains a classifier. These steps are optimized separately; a poorly tuned earlier step cannot be rescued by the final classifier.

The authors want a model f(X,A)f(X, A) that takes the graph directly. XX contains node features and AA is the adjacency matrix. Loss is computed only on labeled nodes; gradients flow through AA to unlabeled nodes, learning their representations together.

Solving the Problem

Simplifying from the Spectral Domain

The derivation starts with spectral graph convolution. The normalized Laplacian L=IN−D−1/2AD−1/2L=I_N-D^{-1/2}AD^{-1/2} decomposes into UΛU⊤U\Lambda U^\top, with each column of UU representing a graph “frequency.” Convolving a node signal xx transforms it to the spectral domain, multiplies by a filter, and transforms back:

gθ⋆x=UgθU⊤xg_\theta\star x=U g_\theta U^\top x

This is expensive. One multiplication by UU costs O(N2)O(N^2), and eigendecomposition alone is prohibitive on large graphs. ChebNet replaces the filter with a Chebyshev polynomial: an order-KK approximation avoids eigendecomposition and sees only neighbors within KK hops.

Kipf and Welling make three further cuts.

First, keep only first order, K=1K=1. A layer sees one hop; more layers extend its reach. The authors argue that social and citation networks have broad degree distributions, so more flexible filters are more prone to overfitting local structures.

Second, approximate the largest eigenvalue λmax⁡\lambda_{\max} as 2 and let the network parameters adapt to the scale difference. The filter becomes:

gθ′⋆x≈θ0′x−θ1′D−12AD−12xg_{\theta'}\star x\approx\theta'_0x-\theta'_1D^{-\frac12}AD^{-\frac12}x

Third, tie the two parameters together, θ=θ0′=−θ1′\theta=\theta'_0=-\theta'_1:

gθ⋆x≈θ(IN+D−12AD−12)xg_\theta\star x\approx\theta\left(I_N+D^{-\frac12}AD^{-\frac12}\right)x

The matrix in parentheses has eigenvalues in [0,2][0,2]. With many layers, the largest value, 2, repeatedly amplifies its component, potentially causing numerical instability and exploding or vanishing gradients. The authors apply a renormalization trick: add self-loops, A~=A+IN\tilde A=A+I_N, and normalize using the new degrees D~ii=∑jA~ij\tilde D_{ii}=\sum_j\tilde A_{ij}:

IN+D−12AD−12  →  D~−12A~D~−12I_N+D^{-\frac12}AD^{-\frac12}\;\rightarrow\;\tilde D^{-\frac12}\tilde A\tilde D^{-\frac12}

The eigenvalues of Equation 7 lie between 0 and 2; those of A^\hat A lie between −1 and 1, and the self-loops shrink the negative end further. With a largest eigenvalue of 2, ten applications amplify the corresponding component more than a thousandfold; the eigenvalues of A^\hat A never exceed 1, so it can be stacked safely.

One GCN Layer

Generalize a single signal to CC-dimensional features per node, X∈RN×CX\in\mathbb{R}^{N\times C}, and apply FF filters:

Z=A^XΘ,A^=D~−12A~D~−12Z=\hat AX\Theta,\qquad \hat A=\tilde D^{-\frac12}\tilde A\tilde D^{-\frac12}

Θ∈RC×F\Theta\in\mathbb{R}^{C\times F} contains learnable weights. Add nonlinearities and stack layers to obtain Equation 2 of the paper:

H(l+1)=σ(A^H(l)W(l))H^{(l+1)}=\sigma\left(\hat AH^{(l)}W^{(l)}\right)

At the node level, A^ij=1/d~id~j\hat A_{ij}=1/\sqrt{\tilde d_i\tilde d_j}. The share node ii receives from neighbor jj depends only on their degrees, and all neighbors share the same WW. A^X\hat AX can be computed as a sparse–dense matrix product, costing O(∣E∣FC)O(|E|FC) per layer, linear in the edge count.

Two Layers Are Enough

For semi-supervised classification, the paper stacks just two layers:

Z=f(X,A)=softmax(A^ ReLU(A^XW(0))W(1))Z=f(X,A)=\mathrm{softmax}\left(\hat A\,\mathrm{ReLU}\left(\hat AXW^{(0)}\right)W^{(1)}\right)

A^\hat A is precomputed once. The loss is cross-entropy, computed only on labeled nodes.

Figure 1 of the paper: the left panel diagrams a multilayer GCN. The input has C channels, nodes X1 to X4 connect along graph edges, and hidden layers produce F feature maps; some nodes have labels Y. The right panel is a t-SNE of a two-layer GCN's hidden outputs on Cora, with colors representing topics that form separate clusters.
Figure 1 from Kipf and Welling, taken from PDF page 4. The original caption is omitted.

The left panel emphasizes that every layer shares the same graph; only features change. On the right, training with only 5% of Cora's labels already gives hidden outputs whose t-SNE separates the seven colors into clusters.

During training, only labeled nodes contribute to the loss, but A^\hat A ties them to their neighbors, so the representations of unlabeled nodes are updated too.

The paper uses full-batch gradient descent over the whole graph, keeping all of A^\hat A and XX in memory at every step. Dropout is the only source of stochasticity.

Discussion

Experimental Setup

The experiments follow Planetoid's setup. The citation networks Citeseer, Cora and Pubmed have 3,327, 2,708 and 19,717 nodes, respectively, with only 20 labels per class. The NELL knowledge graph has 65,755 nodes and only 1 label per class. A 500-node validation set is used only for hyperparameter tuning, and the test set has 1,000 nodes.

The model is a two-layer GCN with a 16-dimensional hidden layer, dropout 0.5, first-layer L2 regularization 5×10−45\times10^{-4}, and Adam with learning rate 0.01. Training runs for at most 200 epochs, stopping when validation loss fails to improve for 10 consecutive epochs. Hyperparameters are tuned only on Cora, then transferred unchanged to Citeseer and Pubmed.

Main Results

MethodCiteseerCoraPubmedNELL
ManiReg60.159.570.721.8
LP45.368.063.026.5
DeepWalk43.267.265.358.1
ICA69.175.173.923.1
Planetoid*64.775.777.261.9
GCN70.381.579.066.0
GCN (random splits)67.9 ± 0.580.1 ± 0.578.9 ± 0.758.4 ± 1.7

The values are classification accuracies (%); the GCN row averages 100 random initializations. On the same machine, GCN converges faster than Planetoid on Citeseer, Cora and NELL (7, 4 and 48 seconds versus 26, 13 and 185), while Pubmed takes 38 seconds versus 25.

The last row uses 10 random splits of the same size. Accuracy falls somewhat, most sharply on NELL, from 66.0% to 58.4%.

Which Propagation Rule Works Best?

The authors replace the two layers' propagation with the different versions in the derivation, keeping everything else fixed:

Propagation ruleCiteseerCoraPubmed
Chebyshev, K=3K=369.879.574.4
Chebyshev, K=2K=269.681.273.8
First order, two parameters (Eq. 6)68.380.077.5
First order, one parameter (Eq. 7)69.379.277.4
Renormalization (Eq. 8)70.381.579.0
First-order term only68.780.577.8
MLP (without the graph)46.555.171.4

Further simplification does not hurt the results. Renormalization uses the fewest parameters and operations and wins on all three datasets; higher-order Chebyshev filters fall to around 74% on Pubmed. The graph-free MLP reaches only 55.1% on Cora, making the graph structure's contribution clear.

What Happens with More Layers?

Appendix B varies the depth from 1 to 10 layers, uses all labels in 5-fold cross-validation, and compares models with and without residual connections:

Figure 5 of the paper: the three panels show Citeseer, Cora and Pubmed, with 1 to 10 layers on the horizontal axis and accuracy on the vertical axis. Training and test curves peak around 2 to 3 layers. Dashed curves without residuals fall sharply beyond 7 layers; solid curves with residuals remain roughly level.
Figure 5 from Kipf and Welling, taken from PDF page 14. The original caption is omitted.

All three datasets work best at 2 to 3 layers. Beyond 7 layers, even training accuracy drops without residuals; the authors say training becomes difficult. Residuals keep the curves roughly level but bring no further improvement.

The Connection to WL

Appendix A offers another interpretation of GCN. Weisfeiler–Lehman (WL) is a graph-isomorphism test that updates each node's color by hashing its own color and the multiset of neighboring colors. Replace the hash with a learnable neural layer and choose normalization didj\sqrt{d_id_j}, and this becomes GCN's propagation rule. The authors describe GCN as a differentiable, parameterized generalization of WL, adding their own qualifier, “loosely speaking.”

Following this analogy, they experiment with the 34 members of Zachary's karate club. With three GCN layers, entirely random untrained weights and identity-matrix node features, the two-dimensional output embeddings already resemble the community structure. The authors compare this with DeepWalk results that require training. Giving one label per community and training for 300 steps makes the four communities linearly separable.

A Review Four Days Later

Four days after the arXiv upload, Ferenc Huszár publishes a blog review titled “How powerful are Graph Convolutions?” He checks the model on an image grid with 8-neighbor connectivity and finds that every layer and channel uses the same fixed-shape 3×3 kernel, differing only by a scalar multiplier. He argues that such a model cannot learn edge detectors or Gabor filters; the simplifications greatly reduce its generality, while ChebNet's higher-order polynomials look more promising. inFERENCe, 2016-09-13

We checked the final A^\hat A: in the grid interior, the central pixel assigns 1/9 to each of the surrounding 9 positions, including itself. It is an averaging filter.

Kipf responds in a blog post at the end of the month. He agrees that degenerating to simple operations on regular grids is a shared drawback of models for arbitrary graphs; they should be evaluated beyond regular grids, with their tradeoffs acknowledged. Kipf, 2016-09-30

Both have a point. On images, GCN loses CNNs' ability to assign weights by position; on directionless citation graphs with widely varying degrees, the propagation comparison above shows that simplification works better.

The Paper's Own Limitations

  • Memory: full-batch training memory grows linearly with the data. With minibatches, a KK-layer model must load all neighbors within KK hops of each node.
  • Edge types: the model supports only undirected graphs and no edge features. NELL's directed, labeled edges must first be converted into a bipartite graph.
  • Self-loop weight: the model implicitly treats the node itself as equally important as its neighbors. The authors suggest A~=A+λIN\tilde A=A+\lambda I_N, making λ\lambda learnable.

Sampling methods such as GraphSAGE later address the first point. GraphSAGE also offers another approach to the third, weighting the node itself and its neighbors separately.

Conclusion

Starting from spectral graph convolution, GCN cuts down to first order and one parameter, then stabilizes the numbers with renormalization. The result is a propagation rule that fits on one line. Two layers substantially beat the methods of the day on three citation networks and train quickly.

The costs are equally clear. Neighbor weights depend only on degrees, leaving just an averaging kernel on an image grid; performance starts to deteriorate beyond two or three layers. Many later ideas in GraphSAGE, GAT and GIN start from these two points.

To try it yourself, PyTorch Geometric's GCNConv implements this propagation rule. Follow the paper with two layers, 16 hidden dimensions and dropout 0.5; the paper reports convergence on Cora in just 4 seconds.

Start with two layers. More is not always better.