TL;DR
A graph convolutional network, or GCN, is a neural network for data that lives on a graph: people in a social network, papers in a citation network, atoms in a molecule. Each layer replaces every node's feature vector with a weighted average of its own features and its neighbours' features, multiplies by a learned weight matrix, and applies a nonlinearity. Stacking layers lets information travel one edge further per layer.
Where you'll see it: semi-supervised node classification on citation networks, molecular property prediction, recommendation over user-item graphs, and as a building block in many graph neural network architectures.
Intuition
Averaging over neighbours
Suppose each node in a citation network has a bag-of-words vector describing its paper. A paper's topic is hard to guess from its own words alone, but its citations say a lot. Papers that cite each other often share a topic. So a sensible first step is to replace each paper's vector with the average of its own vector and the vectors of the papers it cites or is cited by. Then let a neural network learn what to do with the averaged vector.
That is the whole idea. A GCN layer does one round of neighbourhood averaging, then one ordinary neural-network layer. Two layers mean each node sees its neighbours' neighbours. Three layers reach three hops out.
Why a plain network does not work here
An image convolution works because every pixel has the same grid of neighbours in the same positions, so one small filter can be slid across the whole image. A graph has no such grid. One node may have two neighbours and another two hundred, and there is no fixed left or right or up. A convolutional network cannot be applied directly.
A feedforward network fails differently. If you feed in each node's features alone, it ignores the edges entirely. If you feed in the whole adjacency matrix as input, the number of inputs grows with the square of the number of nodes and the model cannot be reused on a different graph.
A GCN takes the middle path. It uses one weight matrix shared by all nodes, and it mixes in neighbours through a fixed, graph-dependent averaging matrix. The same weights work on any graph, and the cost of a layer grows with the number of edges rather than the square of the number of nodes.
flowchart LR A[Node features X] --> B[Average over neighbours and self] G[Graph structure A] --> B B --> C[Linear map W] C --> D[ReLU] D --> E[Hidden features] E --> F[Repeat for more hops] F --> H[Output: class per node]
The math
Setup
Start with an undirected graph on nodes. Its adjacency matrix is an matrix with when nodes and share an edge and otherwise. Each node has a feature vector, and we stack them as the rows of a matrix , where is the number of input features.
Two modifications to come first. The first adds self-loops, so each node also counts itself:
where is the identity matrix. The second is the degree matrix of , a diagonal matrix whose entries are row sums:
The degree of a node is how many neighbours it has, counting itself. Without normalisation, a node with many neighbours would get a large sum and a node with few would get a small one. Dividing by degrees fixes that scale problem.
From spectral filters to a layer
The original motivation comes from signal processing on graphs. Let be the degree matrix of itself (no self-loops). Define the normalised graph Laplacian (see graph Laplacian). Its eigenvectors play the role that sines and cosines play for ordinary signals, and filtering a signal means reweighting its components by a function of the eigenvalues. Computing those eigenvectors is expensive on large graphs, so Hammond et al. approximated the filter by a truncated Chebyshev polynomial in of order . That makes the filter -localised: it only touches nodes at most edges away.
Kipf and Welling set and simplify further. They approximate the largest eigenvalue of by , which leaves a filter of the form . They then tie the two parameters to a single parameter , giving
The operator in brackets has eigenvalues in . Applied many times, that range makes activations and gradients explode or vanish. The fix is the renormalisation trick: replace by the single matrix
Its eigenvalues lie in , which keeps repeated application stable. Each entry is
so a neighbour's contribution is scaled down when either node has many neighbours.
The layer rule
A GCN layer maps the features at layer to layer :
Here , is a learned weight matrix, and is an activation such as . Read it from right to left: multiply by weights to change the features, multiply by to mix each node with its neighbours, apply the activation. Some presentations swap the order of the two multiplications. The result is the same up to the placement of the weights.
A two-layer node classifier
For semi-supervised classification the paper uses two layers and a softmax output:
Row of is a probability distribution over classes for node . Only some nodes have labels. The loss is the cross-entropy summed over labelled nodes only:
where is the set of labelled node indices and is 1 when node has class . Unlabelled nodes still influence training, because their features pass through into the hidden layer that labelled nodes use. That is how the model learns from the structure of the whole graph with few labels.
The cost of one propagation step is proportional to the number of edges, since is sparse and the product with a dense feature matrix touches only the nonzero entries. The paper reports a complexity of for the full two-layer model, with hidden units and output classes.
Worked examples
Take a path of three nodes, . Its adjacency matrix and self-loop version are
- Row sums of give the degrees: .
- Each entry of is . The diagonal gives , , and .
- The off-diagonal entries are , and because nodes 1 and 3 are not adjacent.
- Give each node one scalar feature: . Use one weight, , and skip the activation to isolate the averaging.
- Node 1: .
- Node 2: .
- Node 3: .
Interpretation: node 1 started at 1 and has moved toward its only neighbour, node 2, which had value 2. Node 2 sits in the middle and its value is pulled toward both ends. Node 3 is pulled toward node 2 but keeps most of its own value, because its degree is small. The rule does exactly what a smoothing filter should: it mixes values along edges, and it does so with weights that depend on degree.
Cora is a citation network with papers, 1,433 word features per paper and 7 topics. A two-layer GCN with hidden units has these weight matrices:
- is , which is weights.
- is , which is weights.
- The total is weights, independent of .
The same weights apply to any graph with 1,433 input features. The graph enters only through , which is computed once in preprocessing. A model with separate weights per node would grow with , and nothing in it would tie one node's computation to its neighbours.
The paper's reported accuracy on Cora, using 140 labelled papers (20 per class) and 1,000 test papers, is 81.5 percent. Its results table lists 75.1 percent for the ICA baseline and 75.7 percent for Planetoid. These are the authors' numbers, under their split and hyperparameters.
Tradeoffs and failure modes
| Situation | What goes wrong | Better choice |
|---|---|---|
| Graph is dense, or very large with high-degree hubs | Averaging washes out node identity; a hub's neighbourhood dominates | Sampling-based methods such as GraphSAGE, which sample a fixed number of neighbours |
| Deep stacks (more than 3 or 4 layers) | Node features converge to the same vector (oversmoothing) and accuracy falls | Keep the model shallow, add residual connections, or use jumping-knowledge style skip connections |
| Edges carry direction, type or weight | The symmetric normalisation ignores direction and relation type | Directed or relational GCNs, or attention-based models |
| The graph is noisy or edges are wrong | Errors propagate to every neighbour | Learn edge weights, or prune edges before training |
| The task depends on distant nodes | Each layer reaches only one more hop | Global pooling or transformer-style attention over all nodes |
| Graphs with no shared node set (inductive setting, new nodes at test time) | Transductive GCN assumes the whole graph is known in advance | Inductive variants such as GraphSAGE |
The key tradeoff is simplicity against expressiveness. The layer is a single matrix product and a nonlinearity, which makes it fast and easy to train, but it can only do smoothing with learned weights. Models that need sharper, edge-specific behaviour give up some of that speed.
History
Bruna and colleagues proposed spectral graph convolutions in 2013, using the eigenvectors of the graph Laplacian as a Fourier basis. The method was general but needed a full eigendecomposition, which does not scale. Defferrard, Bresson and Vandergheynst (2016) replaced it with Chebyshev polynomial filters that are localised and cheap, which is the approximation the GCN paper starts from.
Thomas Kipf and Max Welling simplified this to the single-layer rule above and showed it works well for semi-supervised node classification. Their paper, posted to arXiv in 2016 and published at ICLR in 2017, made GCNs the default baseline for graph learning. Their experiments on the Cora, Citeseer and Pubmed citation networks and on the NELL knowledge graph helped make the citation networks standard benchmarks for later work. The paper is in the graph as the GCN paper.
Since then the same message-passing pattern has been generalised into a large family of graph neural networks, which is why the GCN is often taught as the simplest member of that family.
Check yourself
QuestionRecall: what does the self-loop term I_N in the tilde-A = A + I_N definition add to each node's update?Show answer
Each node includes its own features in the average, not only its neighbours'. Without it, a node's new value would depend only on its neighbours, and an isolated node would have a zero row in A, so it would lose its own features entirely.
QuestionComputation: a node has degree 3 in the self-loop graph and a neighbour has degree 8. Their edge is present (A-tilde entry 1). What is the weight of that neighbour in A-hat?Show answer
The weight is 1 divided by the square root of 3 times 8, which is 1 over the square root of 24. That is about 0.204. The neighbour contributes less than it would if both degrees were equal, because a high-degree neighbour spreads its influence over many nodes.
QuestionWhy: why does the GCN use one shared weight matrix per layer instead of a separate weight matrix for each node?Show answer
A separate matrix per node would have parameters tied to specific nodes, so the model could not be applied to a new graph and would need more data than a sparsely labelled graph provides. A shared matrix keeps the parameter count fixed as the graph grows, and the graph structure enters through A-hat, so the same weights adapt to any neighbourhood.
QuestionApplied: you train a GCN with four layers on a social network and every node ends up with almost the same predicted class. What is the likely cause and one fix?Show answer
The likely cause is oversmoothing: four rounds of neighbourhood averaging make node features converge, so they stop carrying node-specific information. A fix is to reduce the depth to two or three layers, or to add residual or skip connections that let each node keep its own earlier features.
Sources
- Kipf, T. N. and Welling, M. (2016). Semi-Supervised Classification with Graph Convolutional Networks. arXiv:1609.02907
- Bruna, J. et al. (2013). Spectral Networks and Locally Connected Networks on Graphs. arXiv:1312.6203
- Graph neural network (Wikipedia)