R IEMANNIAN T RANS E:
M ULTI - RELATIONAL
G RAPH
E MBEDDING
IN
N ONE UCLIDEAN S PACE
Anonymous authors
Paper under double-blind review
A BSTRACT
Multi-relational graph embedding which aims at achieving effective representations with reduced low-dimensional parameters, has been widely used in knowledge base completion. Although knowledge base data usually contains tree-like or cyclic structure, none of existing approaches can embed these data into a compatible space that in line with the structure.
To overcome this problem, a novel framework, called Riemannian TransE, is proposed in this paper to embed the entities in a Riemannian manifold. Riemannian TransE models each relation as a move to a point and deﬁnes speciﬁc novel distance dissimilarity for each relation, so that all the relations are naturally embedded in correspondence to the structure of data.
Experiments on several knowledge base completion tasks have shown that, based on an appropriate choice of manifold, Riemannian TransE achieves good performance even with a signiﬁcantly reduced parameters.
I NTRODUCTION 1. B ACKGROUND
Multi-relational graphs, such as social networks and knowledge bases, have a variety of applications, and embedding methods for these graphs are particularly important for these applications.
For instance, multi-relational graph embedding has been applied to social network analysis (KrohnGrimberghe et al., 2012) and knowledge base completion (Bordes et al., 2013).
A multi-relational graph consists of entities V , a set R of relation types, and a collection of real data triples, where each triple ( h, r, t ) ∈ V × R × V represents some relation r ∈ R between a head entity h ∈ V and a tail entity t ∈ V .
Embedding a multi-relational graph refers to a map from the entity and the relation set to some space.
Mathematical operations in this space enable many tasks, including clustering of entities and completion, prediction, or denoising of triples.
Indeed, completion tasks for knowledge bases attract considerable attention, because knowledge bases are known to be far from complete, as discussed in (West et al., 2014)
(Krompaß et al., 2015).
Multi-relational graph embedding can help its completion and improve the performance of applications that use the graph.
This is the reason why much work focuses on multi-relational graph embedding.
Figure 1 shows an example of a multi-relational graph and a completion task.
In multi-relational graph embedding, reducing the number of parameters is an important problem in the era of big data.
Many parameters are needed with tensor-factorization-based methods, such as Bayesian clustered tensor factorization (BCTF)
(Sutskever et al., 2009), RESCAL (Nickel et al., 2011), and a neural tensor network (NTN) (Socher et al., 2013), where each relation has a dense matrix or tensors ( O (cid:0) D 2 (cid:1) or more parameters, where D is dimensionality of the space).
Thus,
TransE (Bordes et al., 2013) was proposed to reduce the number of parameters, to overcome this problem.
In TransE, each entity is mapped to a point in Euclidean space and each relation is no more than a vector addition ( O ( D ) parameters), rather than a matrix operation.
The successors to TransE, TransH (Wang et al., 2014) and TransD (Ji et al., 2016), also use only a small number of parameters.
Some methods succeeded in reducing parameters using diagonal matrices instead of dense matrices: e.g. DISTMULT (Yang et al., 2015), ComplEx (Trouillon et al., 2016), HolE (through the Fourier transform)
(Nickel et al., 2016), and ANALOGY (Liu et al., 2017).
In these methods, all relations share one space for embedding, but each relation uses its own dissimilarity criterion.
The success of these methods implies that one common space underlies whole data, and each relation can be regarded as a dissimilarity criterion in the space.
Whereas these methods use distances or inner products in Euclidean space as dissimilarity criteria, recent work has shown that using non-Euclidean space can further reduce the number of parameters.
One typical example of this is Poincar´e Embedding (Nickel & Kiela, 2017) for hierarchical data, where a hyperbolic space is used as a space for embedding.
Here, the tree structure of hierarchical data has good compatibility with the exponential growth of hyperbolic space.
Recall the circumference with radius R is given by 2 π sinh R ( ≈ 2 π exp R ) in a hyperbolic plane.
As a result, Poincar´e embedding achieved good graph completion accuracy, even in low dimensionality such as 5 or 10.
On the other hand, spheres (circumference: 2 π sin R ) are compatible with cyclic structures.
Since
Poincar´e embedding, several methods have been proposed for single-relational graph embedding in non-Euclidean space (e.g. (Ganea et al., 2018b), (Nickel & Kiela, 2018)) and shown good results.
The success of these methods suggests that the appropriate choice of a manifold (i.e., space) can retain low dimensionality, although these methods are limited to single-relational graph embedding.
According to the success of the TransE and its derivation and Poincar´e embedding, it is reasonable in multi-relational graph embedding to assume the existence of a single structure compatible with a non-Euclidean manifold.
For example, we can consider a single tree-like structure, which contains multiple hierarchical structures, where root selection gives multiple hierarchical structures from a single tree, which is compatible with hyperbolic spaces (See Figure 2).
Therefore, embedding in a single shared non-Euclidean manifold with multiple dissimilarity criteria used in TransE is promising.
Taking Poincar ´
e embedding’s success with low dimensionality into consideration, this method should work well (e.g., in graph completion tasks) with small number of parameters.
This is the main idea of this paper.
There are ﬁve entities and two kinds of relation (hypernym and synonym).
Graph completion refers to answering questions such as “is mammal a hypernym of cannis?”
1. C ONTRIBUTIONS
We propose a novel method, called Riemannian TransE , for multi-relation graph embedding using a non-Euclidean manifold.
In Riemannian TransE, the relations share one non-Euclidean space and the entities are mapped to the space, whereas each relation has its own dissimilarity criterion based on the distance in the space.
Speciﬁcally, the dissimilarity criteria in Riemannian TransE are similar to those in TransE (Bordes et al., 2013)
based on vector addition, which is known to be effective.
Unfortunately, we cannot straightforwardly use TransE’s dissimilarity criteria.
This is due to non-existence of a parallel vector ﬁeld (See Figure 4), which is implicitly but essentially used in “vector addition.”
However, the parallel condition is not essential in TransE’s idea.
For example, hierarchical bottom to top relations should be regarded as attraction to the top in the hierarchy, which is not parallel but has an attractive point.
Moreover, parallel vector ﬁelds can be regarded as a vector ﬁeld attracted to a point at inﬁnity.
Therefore, we replace parallel vector ﬁelds in TransE by vector ﬁelds with an attractive point that are well-deﬁned in Riemannian manifolds, and as a result, we obtain Riemannian TransE. Advantages of non-Euclidean spaces enable our Riemannian
TransE to achieve good performance (e.g. in graph completion) with low-dimensional parameters.
Riemannian TransE further exploits the advantages of TransE: that is, the method needs only O ( D ) parameters for each relation.
Numerical experiments on graph completion tasks show that with an appropriate choice of manifold, our method can improve the embedding with few parameters.
R ELATED W ORK 2. M ULTI - RELATIONAL G RAPH E MBEDDING
Let V and R denote the entities and relations in a multi-relational graph, and let T ⊂ V × R × V denote the triples in the graph.
Multi-relational graph embedding refers to a pair of maps from V and R into M e and M r , respectively.
Particularly, learning multi-relational graph embedding refers to obtaining an appropriate pair of maps v (cid:55)→ p v ( v ∈ V , p v ∈ M e ) and r (cid:55)→ w r ( r ∈ R , w r ∈ M r ) from the triples T .
In this paper, we call p v the planet of entity v , w r the launcher of relation r , and
M e and M r the planet manifold and launcher manifold , respectively.
The quality of embedding is measured through a score function f : ( M e × M e ) × M r → R , which is designed by each method.
Embedding is learned such that the value score function f ( p h , p t ; w r ) will be low when p h , p t ; w r ∈ T and high when p h , p t ; w r / ∈ T .
For speciﬁc loss functions designed from the score function, see Subsection 2.3.
We interpret the score function of multi-relational graph embedding as dissimilarity in a manifold, which we call a satellite manifold M s .
We rewrite the score function f in multi-relational graph embedding using two maps H , T : M e × M r → M s and the dissimilarity measure function D : M s × M s → R as follows:
f ( p h , p t ; w r ) :
= D (cid:0) s H h ; r , s T t ; r (cid:1) , where s H h ; r = H ( p h ; w r ) , s T t ; r = T ( p t ; w r ) .
We call H and T the head and tail launch map , respectively, and call s H v ; r and s T v ; r the head and tail satellite of entity v (or of planet p v ) with respect to relation r .
The idea of this formulation is embedding in one shared space with multiple dissimilarity criteria.
Speciﬁcally, each entity has only one planet and their satellite pairs give multiple dissimilarity criteria, each of which corresponds to a relation.
In other words, all of the relations shares one space and the planets in it, and the differences among the relations are reduced to the difference of their launcher maps and the satellites given by them.
We regard the planets as the embeddings of the entities, whereas dissimilarity between entities with respect to a relation is evaluated through their satellites which correspond to the relation.
A simple example of this is TransE (Bordes et al., 2013), where all of the planets, satellites, and launchers share the same Euclidean space, i.e. M e = M s = M r
=
R D , the launch maps are given by vector addition as H ( p ; w ) = p + w and T ( p ; w )
= p , and the distance in a norm space— i.e. the norm of the difference—is used as a dissimilarity criterion i.e. D (cid:0) s H , s T (cid:1) =
(cid:13)(cid:13)
s T − s H (cid:13)(cid:13) (the L1 or L2 norm is often used in practice).
See Figure 5 (left).
As Nguyen (2017) suggested, one can associate the idea of representing relations as vector additions with the fact that we can ﬁnd a relation through a substraction operator in Word2Vec Mikolov et al.
That is, we can ﬁnd relations such as p France − p
Paris ≈ p Italy − p Rome in Word2Vec.
As explained above, TransE is based on the distance between satellites, and each satellite is given by simple vector addition.
Regardless of this simplicity, the performance of TransE has been exempliﬁed in review papers (Nickel et al., 2016)
(Nguyen, 2017).
Indeed, the addition operation in a linear space is essential in the launcher map, and hence TransE can easily be extended to a Lie group, which is a manifold equipped with an addition operator, as suggested in Ebisu & Ichise (2017).
Some methods, such as TransH (Wang et al., 2014), TransR (Lin et al., 2015), and TransD (Ji et al., 2016), also use a norm in linear space as a dissimilarity measure, integrating a linear map into a latent space.
Another simple example is RESCAL (Nickel et al., 2011), which uses the negative inner product as a dissimilarity measure.
In RESCAL, the launcher of relation r is a matrix W ∈ M r = R D × D , the launch maps are given by a linear map, i.e. H ( p ; ( W , w ))
=
W p and T ( p ; ( W , w ))
= p , and the dissimilarity measure is the negative inner product D (cid:0) s H , s T (cid:1) =
− (cid:0) s H (cid:1) (cid:62) s T .
Other methods are also based on the (negative) inner product dissimilarity: e.g., DISTMULT (Yang et al., 2015),
ComplEx (Trouillon et al., 2016), HolE (through the Fourier transform) (Nickel et al., 2016), and
ANALOGY (Liu et al., 2017).
Table 1 shows score functions of these methods.
Whereas some methods are based on a neural network (e.g., the neural tensor network (Socher et al., 2013) and ConvE (Dettmers et al., 2017)), their score function consists of linear operations and element-wise nonlinear functions.
2. G RAPH E MBEDDING IN N ON -E UCLIDEAN S PACE
Graph embedding using non-Euclidean space has attracted considerable attention, recently.
Speciﬁcally, embedding methods using hyperbolic space have achieved outstanding results (Nickel & Kiela,
[Table]
2017) (Ganea et al., 2018b) (Nickel & Kiela, 2018).
With these methods, each node in the graph is mapped to a point in hyperbolic space and the dissimilarity is measured by a distance function in the space.
Although these methods exploit the advantages of non-Euclidean space, speciﬁcally those of a negative curvature space, they focus on single- rather than multi-relational graph embedding.
By contrast, TransE has been extended to an embedding method in a Lie group—that is, a manifold with the structure of a group (Ebisu & Ichise, 2017).
As such, the regularization problem in TransE is avoided by using torus, which can be regarded as a Lie group.
Although this extension to TransE deals with multi-relational embedding, it cannot be applied to all manifolds.
This is because not all manifolds have the structure of a Lie group.
Indeed, we cannot regard a hyperbolic space (if D (cid:54) = 1 ) or a sphere (if D (cid:54) = 1 , 3 ) as a Lie group.
2. L OSS F UNCTION
We can simply design a loss function on the basis of the negative log likelihood of a Bernoulli model as follows:
[Equation]
where T c := ( V × R × V ) \T and σ : R → [0 , 1] is a sigmoid function.
However, this loss function needs evaluation of the score function for all negative triplets ( V × R × V ) \ T .
To avoid this, most methods (e
[Equation]
g., TransE) use the following margin-based loss function:
[Equation]
where Q is the set of the triples with its corrupted head and tail.
That is,
[Equation]
where δ ∈ R ≥ 0 is the margin hyperparameter, and [ · ] + denotes the negative value clipping—i.e. for all x ∈ R , [ x ] + := max( x, 0) .
We use this loss function throughout this paper.
R IEMANNIAN T RANS E
In this section, we formulate Riemannian TransE exploiting the advantages of TransE in nonEuclidean manifolds.
Firstly, we give a brief introduction of Riemannian geometry.
Secondly, we explain the difﬁculty in application of TransE in non-Euclidean manifolds.
Lastly, we formulate
Riemannian TransE.
3. R IEMANNIAN M ANIFOLDS AND O PERATIONS
Let ( M , g ) be a Riemannian manifold with metric g .
We denote the tangent and cotangent space of M on p by T p M and T ∗ p M , respectively, and we denote the collection of all smooth vector ﬁelds on M by X ( M ) .
Let ∇ : X ( M )
× X
( M ) (cid:51) ( X, Y )
(cid:55)→ ∇ X Y ∈ X ( M ) denote the Levi–
Civita connection, the unique metric-preserving torsion-free afﬁne connection.
A smooth curve γ : ( − (cid:15), (cid:15) ) → M is a geodesic when ∇ ˙ γ ˙ γ = 0 on curve γ , where ˙ γ is the differential of curve γ .
Geodesics are generalizations of straight lines, in the sense that they are constant speed curves that are locally distance-minimizing.
We deﬁne the exponential map Exp p , which moves point p ∈ M towards a vector by the magnitude of the vector.
In this sense, the exponential map is regarded as an extension of vector addition in a Riemannian manifold.
Figure 3 shows an intuitive example of an exponential map on a sphere.
Let γ v ( v ∈ T p M ) denote the geodesic that satisﬁes ˙ γ v (0) = v .
The exponential map Exp p : T p M → M is given by Exp p ( v ) :
= γ v (1) .
We deﬁne the logarithmic map Log p : M → T p M as the inverse of the exponential map.
Note that the exponential map is not always bijective, and we have to limit the domain of the exponential and logarithmic map appropriately, while some manifolds, such as Euclidean and hyperbolic space, do not suffer from this problem.
3. D IFFICULTIES IN R IEMANNIAN M ANIFOLDS
In TransE, a single vector w r determines the head and tail launch maps H , T as a transform: R D → R D .
In fact, these launch maps are given by vector addition.
Note that this constitution of the launcher maps implicitly but essentially uses the fact that a vector is identiﬁed with a parallel vector ﬁeld in Euclidean space.
Speciﬁcally, a vector w determines a parallel vector ﬁeld, denoted by W r here, which gives a tangent vector [ W r ] p ∈ T p R D on every point p ∈ R D , and each tangent vector determines the exponential map Exp p ([ W r ] p ) at p , which is used as a launch map in TransE.
However, because there is no parallel vector ﬁeld in non-zero curvature spaces, we cannot apply
TransE straightforwardly in non-zero curvature spaces.
Thus, extention of TransE in non-Euclidean space non-trivial.
This is the difﬁculty in Riemannian Manifolds.
3. F ORMULATION OF R IEMANNIAN T RANS E
As we have explained in Introduction, our idea is replacing parallel vector ﬁelds in TransE by vector ﬁelds attracted to a point.
Speciﬁcally, we obtain the Riemannian TransE as an extension of TransE, replacing the launchers w r ∈ R D in TransE by pairs w r
=
( (cid:96) r , p r ) ∈ R
× M of a scalar value and point, indicating the length and destination of the satellites’ move, respectively.
We call p r the attraction point of relation r .
In other words, we replace parallel vector ﬁeld W r = w r in TransE by (cid:96) r Log q ( p ) (cid:107) Log q ( p ) (cid:107) q .
Note that, we use a ﬁxed manifold M e
= M for entity embedding and use direct product manifold M r = R × M for relation embedding.
However, the extension still has arbitrariness.
For instance, we could launch the tail satellite instead of the head satellite in TransE; in other words, the following launching map also gives us a score function equivalent to that of the original TransE: H ( p ; w ) = p and T ( p ; w ) =
p − w (Figurecenter).
On the other hand, the score function depends on whether we move the head or tail satellites
,” the entities in a lower hierarchy, toward their parent.
Hence, we move the head satellites when (cid:96) r > 0 and ﬁx the tail satellites, and vice versa when (cid:96) r < 0 ; speciﬁcally, we move the head satellites by length λ
=
[ (cid:96) r ] + and move the tail satellites by length λ =
[ − (cid:96) r ] + .
Thus, bottom-to-top relation cases correspond to (cid:96) r >
(Figure 6, left), and top-to-bottom relation cases correspond to (cid:96) r < 0 (Figure 6, right).
Another problem pertains to launching the satellites near the attraction point.
If λ > ∆ ( p r , p v ) , the naive rule causes overrun.
In this case, we simply clip the move and set the satellite in the place of p r .
We turn now to the score function of Riemannian TransE.
The score function f : ( M × M ) ×
( R , M ) → R in Riemannian TransE is given as follows:
f ( p h , p t
[Equation]
( (cid:96) r , p r )) :
= ∆ (cid:0) s H h ; r , s T t ; r (cid:1) , where
[Equation]
where transform m λ,p : M → M denotes a move, deﬁned as follows:
[Equation]
Here, note that m (cid:96),p ( q ) is on the geodesic that passes through p and q .
Figure 5 (right) shows the
Riemannian TransE model.
If M = R D and the attraction points are at inﬁnity, the score function is equivalent to that of TransE (without the sphere constraint).
Although the exponential map and logarithmic map in closed form are required to implement Riemannian TransE, we can obtain them when the manifold M is a sphere S D (positive curvature), Euclidean space R D (zero curvature), and hyperbolic space H D (negative curvature), or a direct product of them.
These are practically sufﬁcient.
Also note that the computation costs of these maps are O ( D ) , which is small enough.
3. O PTIMIZATION
In typical cases, the number of entities is very large.
Therefore, stochastic gradient methods are effective for optimization.
Although we can directly apply stochastic gradient methods of Euclidean space or the natural gradient method (Amari, 1998), Riemannian gradient methods (e.g. (Zhang &
Sra, 2016)
(Zhang et al., 2016)) work better for non-Euclidean embedding (Enokida et al., 2018).
In this paper, we use stocastic Riemannian sub gradient methods Zhang & Sra (2016) with norm clipping (See Appendix).
Note that in spheres or hyperbolic spaces, the computation costs of the gradient is O ( D ) , which is as small as TransE.
[Table]
69.74 PSpherical TransE 80.
74.83 Euclidean TransE 72.
77.52 TransE 60.
74.92 TransE (unconstraint) 67.
75.59 TorusE 62.
58.14 TransH 77.
80.32 TransR 52.
52.38 TransD 53.
56.02 RESCAL 60.
63.20 DistMult 61.
54.76 ComplEx 62.
64.49 HolE 53.
[Table]
E XPERIMENTS
Evaluation Tasks We evaluated the performance of our method for a triple classiﬁcation task (Socher et al., 2013) on real knowledge base datasets.
The triple classiﬁcation task involved predict-
ing whether a triple in the test data is correct.
We label a triple positive when f ( p h , p t ; ( (cid:96) r , p r )) > θ r , and vice versa.
Here, θ r ∈ R ≥ 0 denotes the threshold for each relation r , which is determined by the accuracy of the validation set.
We evaluated the accuracy of classiﬁcation with the FB13 and
WN11 datasets (Socher et al., 2013).
Although we do not report the results of link prediction tasks (Bordes et al., 2013) here because there are many evaluation criteria for the task, which makes it difﬁcult to interpret the results, we report the results in Appendix.
Manifolds in Riemannian TransE
To evaluate the dependency of performance for Riemannian
TransE, we compared Riemannian TransE using the following ﬁve kinds of manifolds: Euclidean space R D (Euclidean TransE), hyperbolic space H D (Hyperbolic TransE), a sphere S D (Spherical
TransE), the direct product H 4 × H 4 × · · · × H 4 of hyperbolic space (PHyperbolic TransE), and the direct product S 4 × S 4 × · · · × S 4 of a sphere (PSpherical TransE).
Baselines and Implementation We compared our method with the following baselines: RESCAL (Nickel et al., 2011), TransE (Bordes et al., 2013), TransH (Wang et al., 2014),
TransR (Lin et al., 2015), TransD (Ji et al., 2016), TorusE Ebisu & Ichise (2017), RESCAL (Nickel et al., 2011),
DISTMULT (Yang et al., 2015), HolE (Nickel et al., 2016), ComplEx (Trouillon et al., 2016) and
Analogy (Liu et al., 2017).
We used implementations of these methods on the basis of OpenKE http://openke.thunlp.org/static/index.html , and we used the evaluation scripts there.
Note that we compensated for some missing constraints (for example, in TransR and TransD) and regularizers (for example, in DISTMULT and Analogy) in OpenKE.
We also found that omitting the constraint of the entity planets onto the sphere in TransE gave much better results in our setting, so we also provide these unconstrained results (UnconstraintTransE).
We determined the hyperparameters by following each paper.
For details, see the Appendix.
Results Table 2 shows the results for the triple classiﬁcation task in each dimensionality.
In WN11, the sphere-based Riemannian TransEs achieved good accuracy.
The accuracy did not degrade dramatically even with low dimensionality.
On the other hand, in FB13, the hyperbolic-space-based
Riemannian TransEs was more accurate than other methods.
Moreover for each dimensionality, these results with the proposed Riemannian TransE were at least comparable to those of the baselines.
The accuracy of Euclidean-space-based methods (e.g. the original TransE, and Euclidean
TransE) are between that of the sphere-based Riemannian TransEs and that of the hyperbolic-spacebased Riemannian TransEs in most cases.
Note that these results are compatible with the curvature of each space (i.e. Sphere: positive, Euclidean space: 0, a hyperbolic space: negative).
Note that
Euclidean methods are sometimes better than non-Euclidean methods.
In Appendix, we also report the triple classiﬁcation task results in FB15k, where Euclidean TransE as well as baseline methods outperformed Riemannian TransE did not always outperform the baseline methods.
In summary, positive curvature spaces were good in WN11 and negative curvature spaces were good in FB13, and zero curvature spaces were good in FB15k.
These results show that Riemannian TransE can attain good accuracy with small dimensionality provided that an appropriate manifold is selected.
What determines the appropriate manifold?
Spheres are compatible with cyclic structure and hyperbolic spaces are compatible with tree-like structure.
One possible explanation is that WN has cyclic structure and FB13 has tree-like structure and the structure of FB15k is between them.
However, further discussion remains future work.
C ONCLUSION AND F UTURE W ORK
We proposed Riemannian TransE, a novel framework for multi-relational graph embedding, by extending TransE to a Riemannian TransE. Numerical experiments showed that Riemannian TransE outperforms baseline methods in low dimensionality, although its performance depends signiﬁcantly on the choice of manifold.
Hence, future research shall clarify which manifolds work well with particular kinds of data, and develop a methodology for choosing the appropriate manifold.
This is important work not only for graph completion tasks but also for furthering our understanding of the global characteristics of a graph.
In other words, observing which manifold is effective can help us to understand the global “behavior” of a graph.
Other important work involves using “subspaces” in non-Euclidean space.
Although the notion of a subspace in a non-Euclidean manifold is nontrivial, it may be that our method offers advantages over TransH and TransD, which exploit linear subspaces.
A O PTIMIZATION
In this paper, we use the following simple (projected) stochastic (Riemannian) (sub-) gradient methods Zhang & Sra (2016)
[Equation]
(7) where θ ( τ ) ∈
M |V| × ( R × M ) |R| denotes the parameter in the τ -th step, η ∈ R ≥ 0 is the learning rate, and
˜ ∇ ( τ ) ∈ T θ ( τ ) (cid:16) M |V| × ( R × M ) |R| (cid:17) is a stochastic gradient that satisﬁes
E (cid:104)
˜ ∇ ( τ ) (cid:105) =
grad L
[Equation]
θ ( τ ) (cid:1) =
[Equation]
(cid:0) d L (cid:0) θ ( τ ) (cid:1)(cid:1) .
Recall that (cid:93) denotes index raising.
Speciﬁcally, we use the following stochastic loss function based on the mini-batch method:
[Equation] [Equation]
where the stochastic quintet set Q (cid:48) ( τ ) ⊂
Q is a set of uniform-distributed random variables on Q .
∆ (cid:0) s H r ( p h ) , s T r ( p t ) (cid:1) .
We obtain a stochastic gradient as follows:
[Equation]
9) where θ is a local coordinate representation of θ .
We obtain ˜ ∇ (cid:91) ( τ ) easily using an automatic differentiation framework.
Algorithm 1 shows the learning algorithm for Riemannian TransE.
In the experiments, we applied norm clipping such that the norm of a stochastic gradient is smaller than 1.
Algorithm 1 Learning Riemannian TransE
for τ = 1 , 2 ,... do Sample Q (cid:48)
( τ ) from uniform distribution on Q .
[Equation]
θ
[Equation]
end for return θ ( τ )
B P ARALLEL V ECTOR F IELDS AND P ARALLEL T RANSFORM IN R IEMANNIAN M ANIFOLDS
We give additional explanations of the reason why we cannot deﬁne a parallel vector ﬁeld on a non-Euclidean manifold.
Speciﬁcally we describe the relationship between parallel vector ﬁelds and parallel transform.
We can deﬁne a parallel transform along a geodesic.
This parallel transform maps a tangent vector in a tangent space to one in another.
At one glance, it seems that we can deﬁne a parallel vector ﬁeld using the parallel transform.
However, a parallel transform is not determined only by the origin and destination but depends on the path i.e. the geodesic.
Figure 7 shows an example on a sphere, where two ways to map a vector from a tangent space to another are shown and these two give different maps.
As this ﬁgure shows we cannot obtain a well-deﬁned vector on more than two points.
C E XAMPLES OF R IEMANNIAN M ANIFOLDS
We introduces some Riemannian manifolds useful in applications, and the formula of the exponential map and logarithmic map in these manifolds.
The closed form of exponential map and logarithmic map enables implementation of Riemannian TransE in these manifolds.
In the following, we omit symbols ∂∂x and d x of the basis in a tangent and cotangent space, respectively, for notation simplicity.
Moreover, we give the composition of the exponential map and index raising and that of the index lowering and logarithmic map instead of the exponential map and logarithmic map themselves.
This is because we use a cotangent vector rather than a tangent vector in a practical implementation and map from/to cotangent space is more useful (Recall that ∂ ∂ θ (cid:62)
˜ L is not the coordinate of a tangent but the coordinate of a cotangent vector).
C. E UCLIDEAN S PACE
In a D -dimensional Euclidean Space, the exponential map (with the index raising)
Exp p ◦ (cid:93) :
T ∗ p R D
→ R D is given by
[Equation]
Apparently, the logarithmic map (with the index lowering) (cid:91) ◦ Log p : R D
→ T ∗ p R D is given by
[Equation]
C.
[Equation]
A D -dimensional (unit) sphere is given by point set S D :
= (cid:8)
p ∈ R
( D +1) (cid:12)(cid:12) p (cid:62) p = 1 (cid:9) , and the cotangent space T ∗ p S D on p ∈ S D is identiﬁed with (cid:8)
δ ∈ R
( D +1) (cid:12)(cid:12) p (cid:62) δ = 0 (cid:9) .
The distance ∆ ( p , q ) between two points p ∈ S D and q ∈ S D is given as follows:
[Equation]
[Equation]
where arccos : [ − 1 , 1] → [0 , π ] denote arc-cosine function.
The exponential map (with the index raising)
Exp p ◦ (cid:93) : T ∗ p S D → S D is given by
[Equation]
13) where sinc denotes the cardinal sine function deﬁned as follows:
[Equation]
The logarithmic map (with the index lowering) (cid:91) ◦ Log p : S D
→ T ∗ p S D is given by
[Equation]
Note that in optimization, we need the projection of the differential ˜ δ =
∂∂ θ L ( θ ) | θ = p of the loss function L to cotangent vector δ given by:
[Equation]
C. H YPERBOLIC S PACE
In this subsection, we introduces models of a hyperbolic space, which are mathematically equivalent to each other, but have practically different aspects.
There are many models of a hyperbolic space.
We introduce two of them: the hyperboloid model and Poincar´e disk model.
C.3. H YPERBOLOID M ODEL
Some formulae here are also given and used in Nickel & Kiela (2018).
Let G M denote diagonal matrix
G M
[Equation]
=
[Equation]
Let (cid:104)· , ·(cid:105) M : R
( D +1)
× R ( D +1)
→ R denote the Minkowski inner product deﬁned by (cid:104) p
[Equation]
D
[Equation]
d
[Equation]
p
[Equation]
q d , for p =   p
[Equation]
p D  
[Equation]
q =   qq
[Equation]
q D   .
In the hyperboloid model, a (canonical) hyperbolic space is given by point set H D := (cid:8) p ∈ R D +1 (cid:12)(cid:12) (cid:104) p , p (cid:105) M = − 1 , p 0 > 0 (cid:9) .
The tangent space T p H D on p ∈
H D is identiﬁed with (cid:8) δ ∈ R D +1 (cid:12)(cid:12) (cid:104) p , δ (cid:105) = 0 (cid:9) , and the metric g p : T p H D
×
T p H D
→ R in the tangent space is given by g p ( u , v ) =
(cid:104) u , v (cid:105) M .
Hence, the cotangent space T ∗ p H D on p ∈
H D is identiﬁed with (cid:8) δ ∈ R D +1 (cid:12)(cid:12) p (cid:62) δ = 0 (cid:9) , and the metric g ∗ p : T ∗ p H D
× T ∗ p H D
→ R in the cotangent space is given by g ∗ p ( γ , δ )
= (cid:104) γ , δ (cid:105) M .
Note that δ ∈ T ∗ p H D is identiﬁed with δ (cid:93)
=
G − 1M δ ∈ T p H D .
The distance ∆ ( p , q ) between two points
p ∈
H D and q ∈ H D is given as follows:
[Equation]
where, arcosh : [1 , ∞ ) → [0 , ∞ ) denotes the area hyperbolic cosine function, i.e. the inverse fucntion of the hyperbolic cosine function.
The exponential map (with the index raising)
Exp p ◦ (cid:93) :
T ∗ p H D
→ H D is given by
[Equation]
where sinhc denotes the hyperbolic sine cardinal function deﬁned as follows:
[Equation]
The logarithmic map (with the index lowering) (cid:91) ◦ Log p : H D
→ T ∗ p H D is given by
[Equation]
Note that in optimization, we need the projection of the differential ˜ δ =
∂∂ θ L ( θ ) | θ = p of the loss function L to cotangent vector δ given by:
[Equation]
In the Poincar´e disk model, the D -dimensional hyperbolic space is given by the unit open hyper-ball D D :=
(cid:8) p ∈ R D (cid:12)(cid:12) p (cid:62) p < 1 (cid:9) .
The Poincar´e disk model and the hyperboloid model are derived from each other by the following map:
[Equation]
(24) where µ p := 1 − p (cid:62) p.
The metric is given by g p ( u , v ) = (cid:16)
[Equation]
u
[Equation]
v .
The distance ∆ ( p , q ) between two points
p ∈
H D and q ∈ H D is given as follows:
[Equation] [Equation]
where
[Equation] [Equation]
The exponential map (with index raising)
[Equation]
T ∗ p D D → D D is given by
[Equation]
where
[Equation]
The logarithmic map (with index lowering) (cid:91) ◦ Log p : D D
→ T ∗ p D D is given by
[Equation]
These formulae can be obtained by the coordinate transformation and can be interpreted as a modiﬁcation of existing formulae such as ones in Ganea et al.
(2018a).
In addition, these formulae are useful in an automatic differentiation system, because sech √ x , tanhc √ x , and arcosh(1+ x ) √ x , and their derivatives do not diverge when x → 0 .
D D ETAILS OF E XPERIMENTS D. E VALUATION T ASKS
We evaluated the performance of our method in the link prediction Bordes et al.
and task and the triple classiﬁcation task Socher et al.
on real knowledge base data sets.
D.1. L INK P REDICTION T ASK
In the link prediction task, we predict the head or the tail entity given the relation type and the other entity.
We evaluate the ranking of each correct test triple ( h, r, t ) in the corrupted triples.
We corrupt each triple as follows.
In our setting, either its head or tail is replaced by one of the possible head or entity, respectively.
In addition, we applied “ﬁltered” setting proposed by Bordes et al.
(2013), where the correct triples, that is, the triples T in the original multi-relational graph are excluded.
Thus, the corrupted triples are given by (cid:8) ( h (cid:48) , r, t ) (cid:12)(cid:12) h (cid:48)
∈
V h
∧ ( h (cid:48) , r, t ) / ∈ T (cid:9) (head corruption) or { ( h, r, t (cid:48) )
| t (cid:
) ∈ V t ∧ ( h, r, t (cid:48) ) / ∈ T } (tail corruption).
where V h r and V t r denote the possible heads and tails in relation r , given as follows:
[Equation]
As evaluation metrics, we use the following:
Mean
rank (MR) the mean rank of the correct test triples.
The value of this metric is always equal to or greater than 1, and the lower, the better.
Hits @ n (@ n ) the propotion of correct triples ranked in the top n predictions ( n = 1 , 3 , 10 ).
The value ranges from 0 to
and the higher, the better
Mean
reciprocal rank
(MRR
the
mean
of the reciprocal rank of the correct test triples.
The value ranges from 0 to 1, and the higher, the better
D.1. T RIPLE C LASSIFICATION T ASK
In triple classiﬁcation tasks, we predict whether a triple in the test data is correct or not.
The classiﬁcation is simply based on the score function i.e. we label a triple positive when f ( p h , p t ; ( (cid:96) r , p r )) > θ r , and the other way around.
Here, θ r ∈ R ≥ 0 denotes the threshold for each relation r , which is determined by the accuracy in the validation set.
D. D ATASETS
In link prediction tasks, we used WN18 and FB15k Bordes et al.
(2013) datasets, and WN11 and
FB13 datasets Socher et al.
In triple classiﬁcation tasks, we used WN11 and FB13 datasets, as well as FB15k.
Note that WN18 and FB15k are originally used for link prediction tasks, whereas
WN11 and FB13 are originally used for triple classiﬁcation tasks.
Also note that WN18 cannot be used for the triple classiﬁcation task because WN18 does not have test negative data.
Table 3 shows the number of the entities, relations, and triples in each dataset.
[Table]
Manifolds in Riemannian TransE
To evaluate the dependency of performance of Riemannian
TransE, we compared Riemannian TransE using the following ﬁve kinds of manifolds: Euclidean space R D (Euclidean TransE), hyperbolic spaces H D (HyperbolicTransE), spheres S D (SphericalTransE), the direct product H
× H 4 × · · · × H 4 of hyperbolic spaces (PHyperbolicTransE), and the direct product S 4 × S 4 × · · · × S 4 of spheres (PSphericalTransE).
D.
B
ASELINES AND I MPLEMENTATION
We compared our method with baselines.
As baselines, we used RESCAL Nickel et al.
TransE Bordes et al.
, TransH Wang et al.
(2014), TransR Lin et al.
TransD Ji et al.
DISTMULT Yang et al.
HolE Nickel et al.
(2016) and ComplEx Trouillon et al.
We used implementations of the baselines in OpenKE http://openke.thunlp.
org/static/index.html , a Python library of knowledge base embedding based on Tensorﬂow Abadi et al.
(2015), and moreover, we implemented some lacked constraints (for example, in
TransR, TransD) and regularizers (for example, in DistMult, Analogy) in OpenKE.
We also found that omitting the constraint of the entity planets onto sphere in TransE gives much better results in our setting, and this is why we also show the result without the constraint (UnconstraintTransE).
We also implemented Riemannian TransEs as derivations of the base class of OpenKE.
We set the dimensionality of the entity manifold as D = 8 , 16 , 32 , 64 , 128 .
Although we also have to determine the dimensionality of the projected space in TransR and TransD, we let them be equal to
D .
Due to limitation of the computational costs, we ﬁxed the batch size in baselines and Riemannian
TransEs such that that the training data are split to 100 batches.
We also ﬁxed the number of epochs to 1000.
Note that in the ﬁrst 100 epochs in Riemannian TransEs, we ﬁxed the launchers.
Also note that we applied norm clipping such that the norm of a stochastic gradient in the tangent space is smaller than 1.
We did not use “bern” setting introduced in Wang et al.
(2014), where the ratio between head and tail corruption is not ﬁxed to one to one; in other words, we replaced head and tail with equal probability.
Other than the dimensionality and batch sizes, we used hyperparameters such as learning rate η and margin paremeter δ of baselines used in each paper.
Note that some methods only reports link prediction tasks, and reports hyperparameters for WN18 and FB15k and do not reports ones for
WN11 and FB13.
Some methods do not mention settings of hyperparameters, and in these cases, we used the default parameters in OpenKE.
In these cases, we used hyperparameters of WN18 and
FB15k also for WN11 and FB13, respectively.
Note that the parameters of TorusE is supposed to be used with very high dimensionality, and the hyperparameters are designed for high dimensionality settings.
In Riemannian TransEs, we simply followed the hyperparameters in TransE.
We used the Xavier initializer Glorot & Bengio (2010) as an initializer.
When we have to use the points on a sphere (in the original TransE and Spherical TransEs), we projected the points generated by the initialization onto the sphere.
We found that choice of an initializer has signiﬁcant effect on embedding performance, and the Xavier initializer achieves very good performance.
We selected optimizers in baselines following each paper.
Note that while using ADADELTA (Zeiler, 2012) is also proposed in TransD, we used SGD in TransD. In Riemannian TransEs, we used we simply followed the hyperparameters in TransE. Table 4 shows the hyperparameters and optimization method for each method.
[Table]
D. R ESULTS
Table 5 shows the results of triple classiﬁcation tasks in FB15k.
In FB15k, the baselines such as
TransH, ComplEx and Analogy attained good accuracies and the Riemannian TransEs did not out- perform the baselines.
Table 6, Table 7, and Table 8 shows hit@10, mean rank, and mean reciprocal rank score of link prediction tasks, respectively.
As in triple classiﬁcation tasks, the sphere-based
Riemannian TransEs achieved good accuracy in WN11, whereas the hyperbolic-space-based Riemannian TransEs was more accurate than other methods in FB13.
The Riemannian TransEs did not outperform the baselines in WN18 and FB15k.
This tendency is apparent in MR score.
The distance-based methods such as TransE, TransH and Riemannian TransEs tend to attain good scores in MR and the inner-product-based methods such as DistMult, ComplEx and Analogy tend to attain good scores in MRR and hit@10.
D. A DDITIONAL D ISCUSSION
Why do these baselines attain good results in WN18 and FB15k but bad results in WN11 and FB13?
One reason may simply be that WN18 and FB15k datasets have good compatibility with zero curvature spaces i.e. Euclidean space.
This is supported by the results of Euclidean TransE. A possible second reason is the redundancy of FB15k.
Whereas some “easy” relations are excluded from FB15k
Bordes et al.
(2013), it still contain many reversible triples, as noted by Toutanova & Chen (2015).
By contrast, these are removed in WN11 and FB13.
Recall that projection-based methods such as
TransH, TransR and TransD, and inner-product-based methods such as ComplEx and DISTMULT can exploit a linear subspace.
When a dataset has apparent clusters inside which one relation is easily recovered from the others, we can allocate each cluster to a subspace and separate subspaces from one another.
This separation is easily realized by setting some elements in the launchers to zero in these methods.
Indeed, the TransE without the sphere constraint attains good accuracies in
WN11 and FB13.
Differences between criteria are also interesting phenomena.
Note that MRR and hit@10 is generous for heavy mistakes.
It is possible that inner-product-based methods earn good scores in trivial relations, but further intensive investigation is needed
[Table] [Table]
[Table]
39.98 PSpherical TransE 40.
77.88 Euclidean TransE 45.
81.11 TransE 39.
51.86 TransE (unconstraint) 44.
69.80 TorusE 18.
19.51 TransH 42.
75.29 TransR 31.
49.34 TransD 20.
44.01 RESCAL 44.
53.92 DistMult 38.
83.37 ComplEx 39.
81.59 HolE 35.
63.45 Analogy 38.
WN11 (hit@10) / dim
Hyperbolic TransE 08.
15.69 PHyperbolic TransE 08.
20.62 Spherical TransE 11.
13.41 PSpherical TransE 11.
07.98 Euclidean TransE 10.
TransE 03.
TransE (unconstraint) 10.
08.38 TorusE 07.
10.05 TransH 16.
07.38 TransR 00.
02.07 TransD 00.
04.81 RESCAL 03.
03.21 DistMult 02.
02.46 ComplEx 02.
01.61 HolE 04.
01.30 Analogy 03.
FB13 (hit@10) / dim
Hyperbolic TransE 31.
39.33 PHyperbolic TransE 34.
40.79 Spherical TransE 25.
45.47 PSpherical TransE 32.
33.55 Euclidean TransE 31.
39.49 TransE 21.
31.40 TransE (unconstraint) 32.
32.04 TorusE 16.
17.63 TransH 18.
29.84 TransR 14.
13.78 TransD 15.
18.23 RESCAL 33.
23.48 DistMult 23.
[Table]
HolE
[Table] [Table]
FB15K (
[Table] [Table]
Hyperbolic TransE
[Table]
PHyperbolic TransE
[Table]
TransE
[Table]
TransE
[Table]
TransE
[Table] [Table]
RESCAL
[Table]
ComplEx
[Table]
HolE
[Table]
WN11 (MR) / dim
Hyperbolic TransE 5248.
4824.7 PHyperbolic TransE 4420.
2638.3 Spherical TransE 1856.
1614.0 PSpherical TransE 2059.
5067.7 Euclidean TransE 3466.
2606.1 TransE 7615.
7872.7 TransE (unconstraint) 3538.
5145.5 TorusE 5389.
5335.9 TransH 2669.
5380.7 TransR 7291.
5330.1 TransD 6883.
5321.8 RESCAL 5395.
6003.5 DistMult 5320.
6312.5 ComplEx 5036.
6576.1 HolE 6681.
6462.2 Analogy 4802.
FB13 (MR) / dim
Hyperbolic TransE 3970.
3215.6 PHyperbolic TransE 2889.
1588.8 Spherical TransE 4563.
1813.7 PSpherical TransE 2304.
2636.6 Euclidean TransE 2072.
1607.5 TransE 5993.
5462.7 TransE (unconstraint) 5143.
7639.0 TorusE 5972.
5468.1 TransH 4460.
4633.8 TransR 4474.
2063.4 TransD 5844.
5893.2 RESCAL 2356.
3236.0 DistMult 2202.
2777.8 ComplEx 2131.
2923.1 HolE 4695.
3647.3 Analogy 2313.
[Table]
24.83 PSpherical TransE 23.
54.63 Euclidean TransE 26.
57.24 TransE 22.
30.79 TransE (unconstraint) 26.
45.18 TorusE 10.
11.43 TransH 24.
50.79 TransR 18.
28.73 TransD 12.
27.36 RESCAL 27.
33.14 DistMult 23.
60.70 ComplEx 22.
60.47 HolE 26.
46.73 Analogy 23.
WN11 (MRR) / dim
Hyperbolic TransE 04.
07.87 PHyperbolic TransE 04.
09.65 Spherical TransE 05.
07.02 PSpherical TransE 06.
04.37 Euclidean TransE 05.
09.50 TransE 01.
02.31 TransE (unconstraint) 05.
04.42 TorusE 03.
05.62 TransH 10.
03.82 TransR 00.
01.05 TransD 00.
02.52 RESCAL 01.
01.91 DistMult 01.
01.36 ComplEx 01.
00.84 HolE 03.
00.71 Analogy 01.
FB13 (MRR) / dim
Hyperbolic TransE 20.
28.61 PHyperbolic TransE 20.
25.29 Spherical TransE 14.
33.05 PSpherical TransE 18.
21.81 Euclidean TransE 22.
24.05 TransE 13.
23.07 TransE (unconstraint) 22.
22.90 TorusE 11.
09.58 TransH 12.
21.05 TransR 12.
09.42 TransD 12.
11.36 RESCAL 23.
13.86 DistMult 13.
11.56 ComplEx 14.
14.09 HolE 23.
12.46 Analogy 14.