STransE: a novel embedding model of entities and relationships in knowledge bases
Dat Quoc Nguyen, Kairit Sirts, Lizhen Qu, Mark Johnson
Introduction
While integrating a wide variety of information sources can produce excellent results [Das et al. (2017], there are several reasons for studying simpler models that directly optimize a score function for the triples in a knowledge base, such as the one presented here. First, additional information sources might not be available, e.g., for knowledge bases for specialized domains. Second, models that don’t exploit external resources are simpler and thus typically much faster to train than the more complex models using additional information. Third, the more complex models that exploit external information are typically extensions of these simpler models, and are often initialized with parameters estimated by such simpler models, so improvements to the simpler models should yield corresponding improvements to the more complex models as well.
Embedding models for KB completion associate entities and/or relations with dense feature vectors or matrices. Such models obtain state-of-the-art performance [Nickel et al. (2011, Bordes et al. (2011, Bordes et al. (2012, Bordes et al. (2013, Socher et al. (2013, Wang et al. (2014b, Guu et al. (2015] and generalize to large KBs [Krompaß et al. (2015]. Table 1 summarizes a number of prominent embedding models for KB completion.
The primary contribution of this paper is that two very simple relation-prediction models, SE and TransE, can be combined into a single model, which we call STransE.Source code: https://github.com/datquocnguyen/STransE Specifically, we use relation-specific matrices and as in the SE model to identify the relation-dependent aspects of both and , and use a vector r as in the TransE model to describe the relationship between and in this subspace. Specifically, our new KB completion model STransE chooses , and r so that . That is, a TransE-style relationship holds in some relation-dependent subspace, and crucially, this subspace may involve very different projections of the head and tail . So and can highlight, suppress, or even change the sign of, relation-specific attributes of and . For example, for the “purchases” relationship, certain attributes of individuals (e.g., age, gender, marital status) are presumably strongly correlated with very different attributes of objects (e.g., sports car, washing machine and the like).
As we show below, STransE performs better than the SE and TransE models and other state-of-the-art link prediction models on two standard link prediction datasets WN18 and FB15k, so it can serve as a new baseline for KB completion. We expect that the STransE will also be able to serve as the basis for extended models that exploit a wider variety of information sources, just as TransE does.
Our approach
Let denote the set of entities and the set of relation types. For each triple , where and , the STransE model defines a score function of its implausibility. Our goal is to choose such that the score of a plausible triple is smaller than the score of an implausible triple . We define the STransE score function as follows:
where , is the margin hyper-parameter, is the training set consisting of correct triples, and is the set of incorrect triples generated by corrupting a correct triple .
We use Stochastic Gradient Descent (SGD) to minimize , and impose the following constraints during training: , , , and .
Related work
Table 1 summarizes related embedding models for link prediction and KB completion. The models differ in the score functions and the algorithms used to optimize the margin-based objective function, e.g., SGD, AdaGrad [Duchi et al. (2011], AdaDelta [Zeiler (2012] and L-BFGS [Liu and Nocedal (1989].
DISTMULT [Yang et al. (2015] is based on a Bilinear model [Nickel et al. (2011, Bordes et al. (2012, Jenatton et al. (2012] where each relation is represented by a diagonal rather than a full matrix. The neural tensor network (NTN) model [Socher et al. (2013] uses a bilinear tensor operator to represent each relation while ProjE [Shi and Weninger (2017] could be viewed as a simplified version of NTN with diagonal matrices. Similar quadratic forms are used to model entities and relations in KG2E [He et al. (2015], ComplEx [Trouillon et al. (2016], TATEC [García-Durán et al. (2016] and RSTE [Tay et al. (2017]. In addition, HolE [Nickel et al. (2016b] uses circular correlation—a compositional operator—which could be interpreted as a compression of the tensor product.
The TransH model [Wang et al. (2014b] associates each relation with a relation-specific hyperplane and uses a projection vector to project entity vectors onto that hyperplane. TransD [Ji et al. (2015] and TransR/CTransR [Lin et al. (2015b] extend the TransH model using two projection vectors and a matrix to project entity vectors into a relation-specific space, respectively. TransD learns a relation-role specific mapping just as STransE, but represents this mapping by projection vectors rather than full matrices, as in STransE. The lppTransD model [Yoon et al. (2016] extends TransD to additionally use two projection vectors for representing each relation. In fact, our STransE model and TranSparse [Ji et al. (2016] can be viewed as direct extensions of the TransR model, where head and tail entities are associated with their own projection matrices, rather than using the same matrix for both, as in TransR and CTransR.
Recently, several authors have shown that relation paths between entities in KBs provide richer information and improve the relationship prediction [Lin et al. (2015a, García-Durán et al. (2015, Guu et al. (2015, Wang et al. (2016, Feng et al. (2016, Liu et al. (2016, Niepert (2016, Wei et al. (2016, Toutanova et al. (2016, Nguyen et al. (2016]. In addition, ?) reviews other approaches for learning from KBs and multi-relational data.
Experiments
For link prediction evaluation, we conduct experiments and compare the performance of our STransE model with published results on the benchmark WN18 and FB15k datasets [Bordes et al. (2013]. Information about these datasets is given in Table 2.
The link prediction task [Bordes et al. (2011, Bordes et al. (2012, Bordes et al. (2013] predicts the head or tail entity given the relation type and the other entity, i.e. predicting given or predicting given where denotes the missing element. The results are evaluated using the ranking induced by the score function on test triples.
For each test triple , we corrupted it by replacing either or by each of the possible entities in turn, and then rank these candidates in ascending order of their implausibility value computed by the score function. This is called as the “Raw” setting protocol. For the “Filtered” setting protocol described in ?), we removed any corrupted triples that appear in the knowledge base, to avoid cases where a correct corrupted triple might be ranked higher than the test triple. The “Filtered” setting thus provides a clearer view on the ranking performance. Following ?), we report the mean rank and the Hits@10 (i.e., the proportion of test triples in which the target entity was ranked in the top 10 predictions) for each model. In addition, we report the mean reciprocal rank, which is commonly used in information retrieval. In both “Raw” and “Filtered” settings, lower mean rank, higher mean reciprocal rank or higher Hits@10 indicates better link prediction performance.
Following TransR [Lin et al. (2015b], TransD [Ji et al. (2015], rTransE [García-Durán et al. (2015], PTransE [Lin et al. (2015a], TATEC [García-Durán et al. (2016] and TranSparse [Ji et al. (2016], we used the entity and relation vectors produced by TransE [Bordes et al. (2013] to initialize the entity and relation vectors in STransE, and we initialized the relation matrices with identity matrices. We applied the “Bernoulli” trick used also in previous work for generating head or tail entities when sampling incorrect triples [Wang et al. (2014b, Lin et al. (2015b, He et al. (2015, Ji et al. (2015, Lin et al. (2015a, Yoon et al. (2016, Ji et al. (2016]. We ran SGD for 2,000 epochs to estimate the model parameters. Following ?) we used a grid search on validation set to choose either the or norm in the score function , as well as to set the SGD learning rate , the margin hyper-parameter and the vector size . The lowest filtered mean rank on the validation set was obtained when using the norm in on both WN18 and FB15k, and when for WN18, and for FB15k.
2 Main results
Table 3 compares the link prediction results of our STransE model with results reported in prior work, using the same experimental setup. The first 15 rows report the performance of the models that do not exploit information about alternative paths between head and tail entities. The next 5 rows report results of the models that exploit information about relation paths. The last 3 rows present results for the models which make use of textual mentions derived from a large external corpus.
It is clear that the models with the additional external corpus information obtained best results. In future work we plan to extend the STransE model to incorporate such additional information. Table 3 also shows that the models employing path information generally achieve better results than models that do not use such information. In terms of models not exploiting path information or external information, the STransE model produces the highest filtered mean rank on WN18 and the highest filtered Hits@10 and mean reciprocal rank on FB15k. Compared to the closely related models SE, TransE, TransR, CTransR, TransD and TranSparse, our STransE model does better than these models on both WN18 and FB15k.
Following ?), Table 4 analyzes Hits@10 results on FB15k with respect to the relation categories defined as follows: for each relation type , we computed the averaged number of heads for a pair and the averaged number of tails for a pair . If and , then is labeled 1-1. If and , then is labeled M-1. If and , then is labeled as 1-M. If and , then is labeled as M-M. 1.4%, 8.9%, 14.6% and 75.1% of the test triples belong to a relation type classified as 1-1, 1-M, M-1 and M-M, respectively.
Table 4 shows that in comparison to prior models not using path information, STransE obtains the second highest Hits@10 result for M-M relation category at which is 0.5% smaller than the Hits@10 result of TranSparse for M-M. However, STransE obtains 2.5% higher Hits@10 result than TranSparse for M-1. In addition, STransE also performs better than TransD for 1-M and M-1 relation categories. We believe the improved performance of the STransE model is due to its use of full matrices, rather than just projection vectors as in TransD. This permits STransE to model diverse and complex relation categories (such as 1-M, M-1 and especially M-M) better than TransD and other similiar models. However, STransE is not as good as TransD for the 1-1 relations. Perhaps the extra parameters in STransE hurt performance in this case (note that 1-1 relations are relatively rare, so STransE does better overall).
Conclusion and future work
This paper presented a new embedding model for link prediction and KB completion. Our STransE combines insights from several simpler embedding models, specifically the Structured Embedding model [Bordes et al. (2011] and the TransE model [Bordes et al. (2013], by using a low-dimensional vector and two projection matrices to represent each relation. STransE, while being conceptually simple, produces highly competitive results on standard link prediction evaluations, and scores better than the embedding-based models it builds on. Thus it is a suitable candidate for serving as future baseline for more complex models in the link prediction task.
In future work we plan to extend STransE to exploit relation path information in knowledge bases, in a manner similar to ?), ?) or ?).
Acknowledgments
This research was supported by a Google award through the Natural Language Understanding Focused Program, and under the Australian Research Council’s Discovery Projects funding scheme (project number DP160102156).
NICTA is funded by the Australian Government through the Department of Communications and the Australian Research Council through the ICT Centre of Excellence Program. The first author is supported by an International Postgraduate Research Scholarship and a NICTA NRPA Top-Up Scholarship.