Venue: ACL 2020

# A Re-evaluation of Knowledge Graph Completion Methods

Zhiqing Sun\({}^{1*}\) Shikhar Vashishth\({}^{1,2*}\) Soumya Sanyal\({}^{2*}\)

**Partha Talukdar\({}^{2}\) Yiming Yang\({}^{1}\) \({}^{1}\)** Carnegie Mellon University,  \({}^{2}\) Indian Institute of Science

{zhigings,svashish,yiming}@cs.cmu.edu

{soumysanyal,ppt}@iisc.ac.in

Equal contribution.

###### Abstract

Knowledge Graph Completion (KGC) aims at automatically predicting missing links for large-scale knowledge graphs. A vast number of state-of-the-art KGC techniques have got published at top conferences in several research fields, including data mining, machine learning, and natural language processing. However, we notice that several recent papers report very high performance, which largely outperforms previous state-of-the-art methods. In this paper, we find that this can be attributed to the inappropriate evaluation protocol used by them and propose a simple evaluation protocol to address this problem. The proposed protocol is robust to handle bias in the model, which can substantially affect the final results. We conduct extensive experiments and report performance of several existing methods using our protocol. The reproducible code has been made publicly available.

## 1 Introduction

Real-world knowledge bases are usually expressed as multi-relational graphs, which are collections of factual triplets, where each triplet \((h,r,t)\) represents a relation \(r\) between a head entity \(h\) and a tail entity \(t\). However, real-word knowledge bases are usually incomplete Dong et al. (2014), which motivates the research of automatically predicting missing links. A popular approach for Knowledge Graph Completion (KGC) is to embed entities and relations into continuous vector or matrix space, and use a well-designed score function \(f(h,r,t)\) to measure the plausibility of the triplet \((h,r,t)\). Most of the previous methods use _translation distance_ based Bordes et al. (2013); Wang et al. (2014); Xiao et al. (2016); Sun et al. (2019) and _semantic matching_ based Nickel and Tresp (2013); Yang et al. (2014); Nickel et al. (2016); Trouillon et al. (2016); Liu et al. (2017) scoring functions which are easy to analyze.

However, recently, a vast number of neural network-based methods have been proposed. They have complex score functions which utilize black-box neural networks including Convolutional Neural Networks (CNNs) Dettmers et al. (2018); Nguyen et al. (2018), Recurrent Neural Networks (RNNs) Lin et al. (2015); Wang et al. (2018), Graph Neural Networks (GNNs) Schlichtrull et al. (2017); Shang et al. (2019), and Capsule Networks Nguyen et al. (2019). While some of them report state-of-the-art performance on several benchmark datasets that are competitive to previous embedding-based approaches, a considerable portion of recent neural network-based papers report very high performance gains which are not consistent across different datasets. Moreover, most of these unusual behaviors are not at all analyzed. Such a pattern has become prominent and is misleading the whole community.

In this paper, we investigate this problem and find that this is attributed to the inappropriate evaluation protocol used by these approaches. We demonstrate that their evaluation protocol gives a perfect score to a model that always outputs a constant irrespective of the input. This has lead to artificial inflation of performance of several models. For this, we find a simple evaluation protocol that creates a fair comparison environment for all types of score functions. We conduct extensive experiments to re-examine some recent methods and fairly compare them with existing approaches. The source code of the paper has been publicly available at [http://github.com/svjan5/kg-reveal](http://github.com/svjan5/kg-reveal).

## 2 Background

Knowledge Graph CompletionGiven a Knowledge Graph \(\mathcal{G}=(\mathcal{E},\mathcal{R},\mathcal{T})\), where \(\mathcal{E}\) and \(\mathcal{R}\) de

note the set of entities and relations and \({\cal T}=\{(h,r,t)\mid h,t\in{\cal E},r\in{\cal R}\}\) is the set of triplets (facts), the task of Knowledge Graph Completion (KGC) involves inferring missing facts based on the known facts. Most the existing methods define an embedding for each entity and relation in \({\cal G}\), i.e., \(\mathbf{e}_{h},\mathbf{e}_{r}~{}\forall h\in{\cal E},r\in{\cal R}\) and a score function \(f(h,r,t):{\cal E}\times{\cal R}\times{\cal E}\rightarrow\mathbb{R}\) which assigns a high score for valid triplets than the invalid ones.

Kgc EvaluationDuring KGC evaluation, for predicting \(t\) in a given triplet \((h,r,t)\), a KGC model scores all the triplets in the set \({\cal T^{\prime}}=\{(h,r,t^{\prime})\mid t^{\prime}\in{\cal E}\}\). Based on the score, the model first sorts all the triplets and subsequently finds the rank of the valid triplet \((h,r,t)\) in the list. In a more relaxed setting called _filtered setting_, all the known correct triplets (from train, valid, and test triplets) are removed from \({\cal T^{\prime}}\) except the one being evaluated Bordes et al. (2013). The triplets in \({\cal T^{\prime}}-\{t\}\) are called negative samples.

Related WorkPrior to our work, Kadlec et al. (2017) cast doubt on the claim that performance improvement of several models is due to architectural changes as opposed to hyperparameter tuning or different training objective. In our work, we raise similar concerns but through a different angle by highlighting issues with the evaluation procedure used by several recent methods. Chandrahas et al. (2018) analyze the geometry of KG embeddings and its correlation with task performance while Nayyeri et al. (2019) examine the effect of different loss functions on performance. However, their analysis is restricted to non-neural approaches.

## 3 Observations

In this section, we first describe our observations and concerns and then investigate the reason behind.

### Inconsistent Improvements over Benchmark Datasets

Several recently proposed methods report high performance gains on a particular dataset. However, their performance on another dataset is not consistently improved. In Table 1, we report change in MRR score on FB15k-237 Toutanova and Chen (2015) and WN18RR Dettmers et al. (2018) datasets with respect to ConvE Dettmers et al. (2018) for different methods including RotatE Sun et al. (2019), TuckER Balazevic et al. (2019), ConvKB Nguyen et al. (2018), CapsE Nguyen et al. (2019), KBAT Nathani et al. (2019), and TransGate Yuan et al. (2019). Overall, we find that for a few recent NN based methods, there are inconsistent gains on these two datasets. For instance, in ConvKB, there is a 21.8% improvement over ConvE on FB15k-237, but a degradation of 42.3% on WN18RR, which is surprising given the method is claimed to be better than ConvE. On the other hand, methods like RotatE and TuckER give consistent improvement across both benchmark datasets.

### Observations on Score Functions

Score distributionWhen evaluating KGC methods, for a given triplet \((h,r,t)\), the ranking of \(t\) given \(h\) and \(r\) is computed by scoring all the triplets of form \(\{(h,r,t^{\prime})\mid t^{\prime}\in{\cal E}\}\), where \({\cal E}\) is the set of

Figure 1: Sorted score distribution of ConvKB for an example valid triplet and its negative samples. The score is normalized into \([0,1]\) (lower the better). Dotted line indicate the score for the valid triplet. We find that in this example, around 58.5% negative sampled triplets obtain the exact same score as the valid triplet.

 

all entities. On investing a few recent NN based approaches, we find that they have unusual score distribution, where some negatively sampled triplets have the same score as the valid triplet. An instance of FB15k-237 dataset is presented in Figure 1. Here, out of 14,541 negatively sampled triplets, 8,520 have the exact same score as the valid triplet.

Statistics on the whole datasetIn Figure 2, we report the total number of triplets with the exact same score over the entire dataset for ConvKB Nguyen et al. (2018) and CapsE Nguyen et al. (2019) and compare them with ConvE Dettmers et al. (2018) which does not suffer from this issue. We find that both ConvKB and CapsE have multiple occurrences of such unusual score distribution. On average, ConvKB and CapsE have 125 and 197 entities with exactly same score as the valid triplet over the entire evaluation dataset of FB15k-237, whereas ConvE has around 0.002, which is almost negligible. In Section 4, we demonstrate how this leads to massive performance gain for methods like ConvKB and CapsE.

Root of the problemFurther, we investigate the cause behind such unusual score distribution. In Figure 3, we plot the ratio of neurons becoming zero after ReLU activation for the valid triplets vs. their normalized frequency on FB15k-237 dataset. The results show that in ConvKB and CapsE, a large fraction (87.3% and 92.2% respectively) of the neurons become zeros after applying ReLU activation. However, with ConvE, this count is substantially less (around 41.1%). Because of the zeroing of nearly all neurons (at least 14.2% for ConvKB and 22.0% for CapsE), the representation of several triplets become very similar during forward pass and thus leading to obtaining the exact same score.

## 4 Evaluation Protocols for KGC

In this section, we present different evaluation protocols that can be adopted in knowledge graph completion. We further show that inappropriate evaluation protocol is the key reason behind the unusual behavior of some recent NN-based methods.

How to deal with the same scores?An essential aspect of the evaluation method is to decide how to break ties for triplets with the same score. More concretely, while scoring the candidate set \({\cal T}^{\prime}\), if there are multiple triplets with the same score from the model, one should decide which triplet to pick. Assuming that the triplets are sorted in a stable manner, we design a general evaluation scheme for KGC, which consists of the following three different protocols:

* **Top**: In this setting, the correct triplet is inserted in the beginning of \({\cal T}^{\prime}\).
* **Bottom**: Here, the correct triplet is inserted at the end of \({\cal T}^{\prime}\).
* **Random**: In this, the correct triplet is placed randomly in \({\cal T}^{\prime}\).

Figure 3: Distribution of ratio of neurons becoming zero after ReLU activation in different methods for the valid triplets in FB15k-237 dataset. We find that for ConvKB and CapsE an unusually large fraction of neurons become zero after ReLU activation whereas the does not hold with ConvE.

Figure 2: Plot shows the frequency of the number of negative triplets with the same assigned score as the valid triplet during evaluation on FB15k-237 dataset. The results show that for methods like ConvKB and CapsE, a large number of negative triplets get the same score as the valid triplets whereas for methods like ConvE such occurrences are rare.

 

DiscussionBased on the definition of the three evaluation protocols, it is clear that Top evaluation protocol does not evaluate the model rigorously. It gives the models that have a bias to provide the same score for different triplets, an inappropriate advantage. On the other hand, Bottom evaluation protocol can be unfair to the model during inference time because it penalizes the model for giving the same score to multiple triplets, i.e., if many triplets have the same score as the correct triple, the correct triplet gets the least rank possible.

As a result, Random is the best evaluation technique which is both rigorous and fair to the model. It is in line with the situation we meet in the real world: given several same scored candidates, the only option is to select one of them randomly. Hence, we propose to use Random evaluation scheme for all model performance comparisons.

## 5 Experiments

In this section, we conduct extensive experiments using our proposed evaluation protocols and make a fair comparison for several existing methods.

### Datasets

We evaluate the proposed protocols on FB15k-237 (Toutanova and Chen, 2015) dataset1, which is a subset of FB15k (Bordes et al., 2013) with inverse relations deleted to prevent direct inference of test triples from training.

Footnote 1: We also report our results on WN18RR (Dettmers et al., 2018) dataset in the appendix.

### Methods Analyzed

In our experiments, we categorize existing KGC methods into the following two categories:

* ConvE, RotatE, and TuckER.
* **Affected:** This category consists of recently proposed neural-network based methods whose performance is affected by different evaluation protocols. ConvKB, CapsE, TransGate2, and KBAT are methods in this category. Footnote 2: Since we cannot find any open-source implementation of TransGate, we leave the re-evaluation of TransGate as our future work.

### Evaluation Metrics

For all the methods, we use the code and the hyper-parameters provided by the authors in their respective papers. Model performance is evaluated by Mean Reciprocal Rank (MRR), Mean Rank (MR) and Hits@10 (H@10) on the filtered setting (Bordes et al., 2013).

### Evaluation Results

To analyze the effect of different evaluation protocols described in Section 4, we study the performance variation of the models listed in Section 5.2. We study the effect of using Top and Bottom protocols and compare them to Random protocol. In their original paper, ConvE, RotatE, and TuckER use a strategy similar to the proposed Random protocol, while ConvKB, CapsE, and KBAT use Top protocol. We also study the random error in Random protocol with multiple runs, where we report the average and standard deviation on 5 runs with different random seeds. The results are presented in Tables 2.

\begin{table}
\begin{tabular}{l c c c|c c c|c c c|c c c} \hline \hline  & \multicolumn{3}{c|}{**Reported**} & \multicolumn{3}{c|}{**Random**} & \multicolumn{3}{c|}{**Top**} & \multicolumn{3}{c}{**Bottom**} \\ \cline{2-16}  & MRR \(\uparrow\) & MRL \(\downarrow\) & Hö@10 \(\uparrow\) & MRR \(\uparrow\) & MRR \(\downarrow\) & Hö@10 \(\uparrow\) & MRR \(\downarrow\) & Hö@10 \(\uparrow\) & MRR \(\downarrow\) & Hö@10 \(\uparrow\) \\ \hline ConvE & .325 & 244 & .501 & .324 \(\pm\) 0. & 285 \(\pm\) 0 & .501 \(\pm\) 0 & .324 & 285 & .501 & .324 & 285 & .501 \\ RotatE & .338 & 177 & .533 & .336 \(\pm\) 0. & 178 \(\pm\) 0 & .530 \(\pm\) 0 & .336 & 178 & .530 & .336 & 178 & .530 \\ TuckER & .358 & - & .544 & .353 \(\pm\) 0. & 162 \(\pm\) 0 & .536 \(\pm\) 0 & .353 & 162 & .536 & .353 & 162 & .536 \\ \hline \hline ConvKB & .396 & 257 & .517 & .243 \(\pm\) 0. & 309 \(\pm\) 2 & .421 \(\pm\) 0 & \begin{tabular}{c} 407 \\ (+164) \\ \end{tabular} & \begin{tabular}{c} 246 \\ (-63) \\ \end{tabular} & \begin{tabular}{c} 246 \\ (+106) \\ \end{tabular} & \begin{tabular}{c} .527 \\ (-113) \\ \end{tabular} & \begin{tabular}{c} .130 \\ (+64) \\ \end{tabular} & \begin{tabular}{c} 373 \\ (-038) \\ \end{tabular} \\ \hline CapsE & .523 & 303 & .593 & .150 \(\pm\) 0. & 403 \(\pm\) 2 & .356 \(\pm\) 0 & \begin{tabular}{c} 511 \\ (+361) \\ \end{tabular} & \begin{tabular}{c} 305 \\ (-99) \\ \end{tabular} & \begin{tabular}{c} .586 \\ (+229) \\ \end{tabular} & \begin{tabular}{c} .134 \\ (-016) \\ \end{tabular} & \begin{tabular}{c} 502 \\ (+99) \\ \end{tabular} & 
\begin{tabular}{c} .297 \\ (-0.059) \\ \end{tabular} \\ \hline KBAT & .518\(\dagger\) & 210\(\dagger\) & .626\(\dagger\) & .157 \(\pm\) 0. & 270 \(\pm\) 0 & .331 \(\pm\) 0 & .157 & 270 & .331 & .157 & 270 & .331 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Effect of different evaluation protocols on recent KG embedding methods on FB15k-237 dataset. For Top and Bottom, we report changes in performance with respect to Random protocol. Please refer to Section 5.4 for details. \(\dagger\): KBAT has test data leakage in their original implementation, which is fixed in our experiments.

 

We observe that for Non-Affected methods like ConvE, RotatE, and TuckER, the performance remains consistent across different evaluation protocols. However, with Affected methods, there is a considerable variation in performance. Specifically, we can observe that these models perform best when evaluated using Top and worst when evaluated using Bottom3. Finally, we find that the proposed Random protocol is very robust to different random seeds. Although the theoretic upper and lower bounds of a Random score are Top and Bottom scores respectively, when we evaluate knowledge graph completion for real-world large-scale knowledge graphs, the randomness doesn't affect the evaluation results much.

Footnote 3: KBAT incorporates ConvKB in the last layer of its model architecture, which should be affected by different evaluation protocols. But we find another bug on the leakage of test triples during negative sampling in the reported model, which results in more significant performance degradation.

## 6 Conclusion

In this paper, we performed an extensive re-examination study of recent neural network based KGC techniques. We find that many such models have issues with their score functions. Combined with inappropriate evaluation protocol, such methods reported inflated performance. Based on our observations, we propose Random evaluation protocol that can clearly distinguish between these affected methods from others. We also strongly encourage the research community to follow the Random evaluation protocol for all KGC evaluation purposes.

## Acknowledgements

We thank the reviewers for their helpful comments. This work is supported in part by the National Science Foundation (NSF) under grant IIS-1546329 and Google PhD Fellowship.

## References

* J. Balazevic et al. (2019)Tucker: tensor factorization for knowledge graph completion. In Empirical Methods in Natural Language Processing, Cited by: SS2.
* A. Bordes et al. (2013)Translating embeddings for modeling multi-relational data. In Advances in Neural Information Processing Systems 26, pp. 2787-2795. External Links: Link, Document Cited by: SS2.
* C. Dasgupta et al. (2018)A novel embedding model for knowledge base completion based 

on convolutional neural network. In _Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers)_, pages 327-333. Association for Computational Linguistics.
* Nguyen et al. (2019) Dai Quoc Nguyen, Thanh Vu, Tu Dinh Nguyen, Dat Quoc Nguyen, and Dinh Phung. 2019. A Capsule Network-based Embedding Model for Knowledge Graph Completion and Search Personalization. In _Proceedings of the 2019 Annual Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT)_, pages 2180-2189.
* Nickel et al. (2016) Maximilian Nickel, Lorenzo Rosasco, and Tomaso Poggio. 2016. Holographic embeddings of knowledge graphs. In _Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence_, AAAI'16, pages 1955-1961. AAAI Press.
* Nickel and Tresp (2013) Maximilian Nickel and Volker Tresp. 2013. Tensor factorization for multi-relational learning. In _Machine Learning and Knowledge Discovery in Databases_, pages 617-621, Berlin, Heidelberg. Springer Berlin Heidelberg.
* Pennington et al. (2014) Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In _Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP)_, pages 1532-1543.
* Schlichtkrull et al. (2017) Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. 2017. Modeling relational data with graph convolutional networks. _arXiv preprint arXiv:1703.06103_.
* Shang et al. (2019) Chao Shang, Yun Tang, Jing Huang, Jinbo Bi, Xiaodong He, and Bowen Zhou. 2019. End-to-end structure-aware convolutional networks for knowledge base completion.
* Sun et al. (2019) Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, and Jian Tang. 2019. Rotate: Knowledge graph embedding by relational rotation in complex space. In _International Conference on Learning Representations_.
* Toutanova and Chen (2015) Kristina Toutanova and Danqi Chen. 2015. Observed versus latent features for knowledge base and text inference. In _Proceedings of the 3rd Workshop on Continuous Vector Space Models and their Compositionality_, pages 57-66.
* Volume 48_, ICML'16, pages 2071-2080. JMLR.org.
* Wang et al. (2018) Haoyu Wang, Vivek Kulkarni, and William Yang Wang. 2018. DOLORES: deep contextualized knowledge graph embeddings. _CoRR_, abs/1811.00147.
* Wang et al. (2014) Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. 2014. Knowledge graph embedding by translating on hyperplanes. In _Proceedings of the Twenty-Eighth AAAI Conference on Artificial Intelligence_, AAAI'14, pages 1112-1119. AAAI Press.
* Xiao et al. (2016) Han Xiao, Minlie Huang, and Xiaoyan Zhu. 2016. Transg : A generative model for knowledge graph embedding. In _Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_, pages 2316-2325. Association for Computational Linguistics.
* Yang et al. (2014) Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. 2014. Embedding entities and relations for learning and inference in knowledge bases. _CoRR_, abs/1412.6575.
* Yuan et al. (2019) Jun Wen Yuan, Neng Gao, and Ji Xiang. 2019. Transgenic: Knowledge graph embedding with shared gate structure. In _AAAI_.

## Appendix A Results on WN18RR dataset

Besides FB15k-237, we also evaluate the proposed protocols on WN18RR Dettmers et al. (2018) dataset, which is a subset of WN18 Bordes et al. (2013) containing lexical relations between words. Similar to FB15k-237, inverse relations are removed in WN18RR. The results on WN18RR are shown in Table 3. From these results, we can draw similar conclusions as in Section 5. We also show the total number of triplets with the exact same score over the entire WN18RR dataset for ConvKB, CapsE and ConvE in Figure 4.

 



\begin{table}
\begin{tabular}{l c c|c c c|c c c|c c c} \hline \hline  & \multicolumn{3}{c}{**Reported**} & \multicolumn{3}{c}{**Random**} & \multicolumn{3}{c}{**Top**} & \multicolumn{3}{c}{**Bottom**} \\ \cline{2-15}  & MRR \(\uparrow\) & MR \(\downarrow\) & H@10 \(\uparrow\) & MRR \(\uparrow\) & MRR \(\downarrow\) & HRR \(\uparrow\) & MRR \(\downarrow\) & H@10 \(\uparrow\) & MRR \(\downarrow\) & MRR \(\downarrow\) & MRR \(\downarrow\) & H@10 \(\uparrow\) \\ \hline ConvE & .43 & 4187 & .52 & .444 \(\pm\) 0 & 4950 \(\pm\) 0 & .503 \(\pm\) 0 & .444 & 4950 & .503 & .444 & 4950 & .503 \\ RotatE & .476 & 3340 & .571 & .473 \(\pm\) 0 & .3343 \(\pm\) 0 & .571 \(\pm\) 0 & .473 & 3343 & .571 & .473 & 3343 & .571 \\ TuckER & .470 & - & .526 & .461 \(\pm\) 0 & .6324 \(\pm\) 0 & .516 \(\pm\) 0 & .461 & 6324 & .516 & .461 & 6324 & .516 \\ \hline \hline ConvKB & .248 & 2554 & .525 & .249 \(\pm\) 0 & .3433 \(\pm\) 42 & .524 \(\pm\) 0 & .251 & 1696 & .529 & .164 & 5168 & .516 \\  & & & & (+002) & (-1737) & (+005) & (-0.085) & (+1735) & (-008) \\ \hline CapsE\(\ddagger\) & .415 & 719 & .560 & .415 \(\pm\) 0 & .718 \(\pm\) 0 & .559 \(\pm\) 0 & .415 & 718 & .559 & .323 & 719 & .555 \\  & & & & & & & & (-092) & (+1) & (-004) \\ \hline KBAT & .440\(\dagger\) & 1940\(\dagger\) & .581\(\dagger\) & .412 \(\pm\) 0 & 1921 \(\pm\) 0 & .554 \(\pm\) 0 & .412 & 1921 & .554 & .412 & 1921 & .554 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Performance comparison under different evaluation protocols on WN18RR dataset. For Top and Bottom, we report changes in performance with respect to Random protocol. \(\ddagger\): Caps uses the pre-trained 100-dimensional Glove [4] word embeddings for initialization on WN18RR dataset, which makes the comparison on WN18RR still unfair. \(\dagger\): KBAT has test data leakage in their original implementation, which is fixed in our experiments.

Figure 4: Plot shows the frequency of the number of negative triplets with the same assigned score as the valid triplet during evaluation on WN18RR dataset. The results show that Unlike FB15k-237, in this dataset, only ConvKB has a large number of negative triplets get the same score as the valid triplets.