TL;DR
A knowledge base stores facts as triples, such as (Mikhail Baryshnikov, educated at, Vaganova Academy), and even the largest ones are incomplete. Schlichtkrull and colleagues introduce the relational graph convolutional network (R-GCN), a graph encoder that keeps a separate transformation for each relation type, and they apply it to two tasks: predicting missing facts and predicting missing entity labels. Their key result is that an R-GCN encoder paired with the DistMult scoring function beats DistMult alone on the standard link prediction benchmarks, especially on the harder FB15k-237 dataset.
Builds on: Graph Convolutional Network, DistMult · Leads to: Knowledge Graph, Link Prediction
Why it mattered
Knowledge graphs power question answering and search, and their gaps matter for every system that reads from them. Before this paper, the usual way to fill those gaps was a factorisation model that scored each candidate fact on its own, using only learned vectors for the two entities and the relation. The paper showed that letting each entity's vector be shaped by its neighbourhood, with the neighbourhood kept separate by relation type, gives a stronger encoder for the same scoring function.
The paper claims to be the first to carry the graph convolution idea over to multi-relational data. The same encoder-decoder pattern, a graph network that produces node vectors and a simple scorer on top, became a common template for link prediction on graphs with many edge types. Its two regularisation schemes, basis decomposition and block decomposition, answer a practical problem that appears whenever a graph has many relation types: the parameter count grows with the number of relations, and rare relations overfit.
The problem
A knowledge base has entities, relations and triples. Each triple has a subject, a relation and an object. Two tasks matter in practice. In link prediction the question is whether a missing triple belongs to the graph, and the system ranks candidate triples by how likely they are. In entity classification the question is what type or category an entity has, such as whether a company is a company or a person is a person.
Both tasks depend on the neighbourhood. Knowing that a person was educated at a particular academy makes it likely that the person is a person and lived in the same country as the academy. A model that scores each fact in isolation throws this information away. A graph convolutional network can use it, but the standard version treats all edges the same, while a knowledge base has hundreds of relation types with different directions and meanings. The paper's question is how to keep the neighbourhood information and still handle that many relation types.
How it works
The model has two parts: an encoder that turns each entity into a vector by looking at its neighbours, and a decoder that scores candidate triples from those vectors. The diagram shows the pipeline for link prediction.
flowchart LR G[Incomplete knowledge graph] --> E[R-GCN encoder: one layer per hop, one matrix per relation] E --> V[Entity vectors] V --> D[DistMult decoder scores each candidate triple] D --> L[Loss: real triples up, corrupted triples down]
Here is a toy instance with three entities, invented for illustration, from start to finish. The graph has one fact in it, that Baryshnikov was educated at the Vaganova Academy, and the question is whether the same relation also holds for Russia.
- Input. The graph has entities B (Baryshnikov), V (Vaganova Academy) and R (Russia), and the relation educated at. The fact (B, educated at, V) is in the graph. The fact (B, educated at, R) is a candidate that the model must score. Check: the two candidates share the subject and the relation, so only the object differs.
- Encoder. One R-GCN layer updates each entity by summing messages from its neighbours. Each message is transformed by a matrix chosen for its relation and direction, and the sums are normalised. Because B has an educated at edge to V, V's vector flows into B's update through the educated at matrix. R has no such edge, so it receives nothing from V. Check: the neighbourhood of each entity changes its vector, but only through the relation-specific matrices.
- Entity vectors. Suppose the encoder ends with these two-number vectors: B is (1, 0), V is (1, 1), and R is (0, 1). These are toy values, chosen so the arithmetic is easy. Check: each entity now has one vector that the decoder can use.
- Decoder. DistMult scores a triple as the sum over the vector positions of the subject entry, times the relation weight, times the object entry. Take the relation weights for educated at to be (1, 2). The score for (B, educated at, V) is . The score for (B, educated at, R) is . Check: the true-looking candidate scores higher than the false-looking one.
- Loss. The paper trains with negative sampling. Each real triple is paired with corrupted copies in which the subject or object is replaced at random, and a logistic loss pushes real triples up and corrupted ones down. Check: after training, the scores of real triples are high relative to corrupted ones, which is what the ranking needs.
The main point of step 2 is that the encoder adds the neighbourhood to each entity's vector, and the decoder then needs only one simple score. The paper's experiments test whether that addition helps on real benchmarks.
The math
The paper's notation uses a directed, labelled multigraph , where is the set of entities, the set of labelled edges and the set of relation types. The set includes each relation in both directions, so an edge from j to i of relation r also appears as an inverse relation.
Step 2 in symbols: the R-GCN update
The layer update for entity at layer is
Here is the vector for entity at layer , is the set of neighbours of under relation , is a normalisation constant (the paper gives as one choice), is a matrix for relation , is a self-connection matrix, and is an activation such as ReLU. In the toy example, for educated at is the matrix that transforms V's vector before it is added into B's.
Step 2 in symbols: keeping the parameter count small
With one matrix per relation, the layer has matrices, which becomes too many when there are hundreds of relations and rare ones have little data. The paper gives two fixes.
The basis decomposition writes each relation matrix as a weighted sum of shared matrices:
Only the coefficients depend on the relation, so rare relations share their matrices with common ones.
The block decomposition makes each relation matrix block-diagonal, with small blocks on the diagonal, which the paper reads as a sparsity constraint.
Step 3 in symbols: the vectors and the classification loss
For entity classification, the last layer's output goes through a softmax, and the loss is the cross-entropy over the labelled entities:
Here is the set of labelled entities, is the number of classes, is 1 when entity has class and 0 otherwise, and is the network's predicted probability for that class.
Step 4 in symbols: the DistMult score and the loss
DistMult gives each relation a diagonal matrix , and scores a triple by
where and are the encoder's vectors for the subject and the object. The toy example uses the same formula with written as a list of two weights.
Training uses negative sampling. For each real triple, corrupted triples are made by replacing the subject or the object, and the loss is the logistic cross-entropy on all of them:
Here is the logistic sigmoid, for real triples and for corrupted ones, and is the full set of real and corrupted triples.
Step 5 in symbols: the size saving
Take one layer with dimensions, relations and bases, and ignore the self-connection. Full relation matrices need numbers. The basis version needs numbers. That is about 36 times fewer.
Results
The paper reports entity classification on four knowledge-base datasets, with accuracy averaged over 10 runs. The R-GCN is best on two of the four: AIFB at 95.83 percent against 88.88 for RDF2Vec, and AM at 89.29 against 88.33. On MUTAG and BGS it is behind: 73.23 against 80.88 for Weisfeiler-Lehman kernels on MUTAG, and 83.10 against 87.24 for RDF2Vec on BGS. The authors suspect the fixed normalisation constant is partly to blame, since it can be particularly problematic for nodes of high degree.
For link prediction the paper uses mean reciprocal rank (MRR) and Hits at n. The filtered setting removes other true triples from the ranking. On FB15k, the filtered numbers are:
| Model | MRR (filtered) | Hits at 10 |
|---|---|---|
| DistMult | 0.634 | 0.814 |
| R-GCN | 0.651 | 0.825 |
| R-GCN+ (ensemble with DistMult) | 0.696 | 0.842 |
On WN18, the simple LinkFeat baseline reaches 0.938 filtered MRR, the same score HolE reports, and above R-GCN. The authors explain this by inverse relation pairs in the benchmark, which let a memorising baseline do well.
On FB15k-237, where the inverse pairs were removed, the gap is clearer. Filtered MRR is 0.248 for R-GCN and 0.191 for DistMult, and filtered Hits at 10 is 0.414 against 0.376.
Limits. The entity classification results are on small benchmark splits. The R-GCN in those experiments uses a fixed normalisation and no attention, which the authors name as the likely cause of the weak results on hub-heavy datasets. The link prediction gains are measured against the DistMult baseline, and the strongest results depend on an ensemble. The featureless setting uses one-hot inputs, so the paper does not show how the model performs when entities carry text or other features.
Reading guide
The paper has seven numbered sections, plus a supplement on the classification details. Each one needs these lessons.
- Section 1, Introduction. Needs Knowledge Graph, the idea of a triple, and Link Prediction and entity classification as tasks.
- Section 2, Neural relational modeling. The core of the paper. Needs Graph Convolutional Network and Message Passing Neural Network for the update rule, One-Hot Encoding for the featureless inputs and Sparse Matrix for the efficient implementation. The regularisation in Section 2.2 uses Node Embedding ideas and the parameter counting from the step above.
- Section 3, Entity classification. Needs Softmax and Cross-Entropy Loss, and Semi-Supervised Learning since only some entities are labelled.
- Section 4, Link prediction. Needs DistMult, Negative Sampling and Sigmoid Function, which is the logistic function in the loss.
- Section 5, Empirical evaluation. The results tables. Needs Adam Optimizer for the training setup and Gradient Descent for the general idea.- Section 6, Related work. Background on factorisation models and graph neural networks. Needs Graph Neural Network and Rectified Linear Unit (ReLU) for the activation.
- Section 7, Conclusions. The authors' summary and the directions they leave open, such as attention and entity features.
Check yourself
QuestionIn the toy example, the score for (B, educated at, V) is 1 and for (B, educated at, R) it is 0. Why is the second score zero?Show answer
QuestionA model has 16-dimensional relation matrices, 100 relation types and two bases. How many numbers does the basis decomposition save, compared with full matrices, in one layer?Show answer
QuestionWhy does the basis decomposition help with rare relations?Show answer
QuestionOn WN18, LinkFeat beats the learned models. What does the paper say explains this, and what does it imply for the benchmark?Show answer
Sources
- Schlichtkrull et al., "Modeling Relational Data with Graph Convolutional Networks" (2017): https://arxiv.org/abs/1703.06103
- Kipf and Welling, "Semi-Supervised Classification with Graph Convolutional Networks" (2016): https://arxiv.org/abs/1609.02907
- "Knowledge graph", Wikipedia: https://en.wikipedia.org/wiki/Knowledge_graph