An Interpretable Knowledge Transfer Model for Knowledge Base Completion
Knowledge bases are important resources for a variety of natural language processing tasks but suffer from incompleteness. We propose a novel embedding model, ITransF, to perform knowledge base completion. Equipped with a sparse attention mechanism, ITransF discovers hidden concepts of relations and transfer statistical strength through the sharing of concepts. Moreover, the learned associations between relations and concepts, which are represented by sparse attention vectors, can be interpreted easily. We evaluate ITransF on two benchmark datasets— WN18 and FB15k for knowledge base completion and obtains improvements on both the mean rank and Hits@10 metrics, over all baselines that do not use additional information.
1 Introduction
Knowledge bases (KB), such as WordNet (Fellbaum, 1998), Freebase (Bollacker et al., 2008), YAGO (Suchanek et al., 2007) and DBpedia (Lehmann et al., 2015), are useful resources for many applications such as question answering (Berant et al., 2013; Yih et al., 2015; Dai et al., 2016) and information extraction (Mintz et al., 2009). However, knowledge bases suffer from incompleteness despite their formidable sizes (Socher et al., 2013; West et al., 2014), leading to a number of studies on automatic knowledge base completion (KBC) (Nickel et al., 2015) or link prediction.
The fundamental motivation behind these studies is that there exist some statistical regularities under the intertwined facts stored in the multirelational knowledge base. By discovering gener-
alizable regularities in known facts, missing ones may be recovered in a faithful way. Due to its excellent generalization capability, distributed representations, a.k.a. embeddings, have been popularized to address the KBC task (Nickel et al., 2011; Bordes et al., 2011, 2014, 2013; Socher et al., 2013; Wang et al., 2014; Guu et al., 2015; Nguyen et al., 2016b).
As a seminal work, Bordes et al. (2013) proposes the TransE, which models the statistical regularities with linear translations between entity embeddings operated by a relation embedding. Implicitly, TransE assumes both entity embeddings and relation embeddings dwell in the same vector space, posing an unnecessarily strong prior. To relax this requirement, a variety of models first project the entity embeddings to a relationdependent space (Bordes et al., 2014; Ji et al., 2015; Lin et al., 2015b; Nguyen et al., 2016b), and then model the translation property in the projected space. Typically, these relation-dependent spaces are characterized by the projection matrices unique to each relation. As a benefit, different aspects of the same entity can be temporarily emphasized or depressed as an effect of the projection. For instance, STransE (Nguyen et al., 2016b) utilizes two projection matrices per relation, one for the head entity and the other for the tail entity.
Despite the superior performance of STransE compared to TransE, it is more prone to the data sparsity problem. Concretely, since the projection spaces are unique to each relation, projection matrices associated with rare relations can only be exposed to very few facts during training, resulting in poor generalization. For common relations, a similar issue exists. Without any restrictions on the number of projection matrices, logically related or conceptually similar relations may have distinct projection spaces, hindering the discovery, sharing, and generalization of statistical regularities.
2
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
Previously, a line of research makes use of external information such as textual relations from web-scale corpus or node features (Toutanova et al., 2015; Toutanova and Chen, 2015; Nguyen et al., 2016a), alleviating the sparsity problem. In parallel, recent work has proposed to model regularities beyond local facts by considering multirelation paths (Garcı́a-Durán et al., 2015; Lin et al., 2015a; Shen et al., 2016). Since the number of paths grows exponentially with its length, as a side effect, path-based models enjoy much more training cases, suffering less from the problem.
In this paper, we propose an interpretable knowledge transfer model (ITransF), which encourages the sharing of statistic regularities between the projection matrices of relations and alleviates the data sparsity problem. At the core of ITransF is a sparse attention mechanism, which learns to compose shared concept matrices into relation-specific projection matrices, leading to a better generalization property. Without any external resources, ITransF improves mean rank and Hits@10 on two benchmark datasets, over all previous approaches of the same kind. In addition, the parameter sharing is clearly indicated by the learned sparse attention vectors, enabling us to interpret how knowledge transfer is carried out. To induce the desired sparsity during optimization, we further introduce a block iterative optimization algorithm.
In summary, the contributions of this work are: (i) proposing a novel knowledge embedding model which enables knowledge transfer by learning to discover shared regularities; (ii) introducing a learning algorithm to directly optimize a sparse representation from which the knowledge transferring procedure is interpretable; (iii) showing the effectiveness of our model by outperforming baselines on two benchmark datasets for knowledge base completion task.
2 Notation and Previous Models
Let E denote the set of entities and R denote the set of relations. In knowledge base completion, given a training set P of triples (h, r, t) where h, t 2 E are the head and tail entities having a relation r 2 R, e.g., (Steve Jobs, FounderOf, Apple), we want to predict missing facts such as (Steve Jobs, Profession, Businessperson).
Most of the embedding models for knowledge base completion define an energy function fr(h, t)
according to the fact’s plausibility (Bordes et al., 2011, 2014, 2013; Socher et al., 2013; Wang et al., 2014; Yang et al., 2015; Guu et al., 2015; Nguyen et al., 2016b). The models are learned to minimize energy fr(h, t) of a plausible triple (h, r, t) and to maximize energy fr(h0, t0) of an implausible triple (h0, r, t0).
Motivated by the linear translation phenomenon observed in well trained word embeddings (Mikolov et al., 2013), TransE (Bordes et al., 2013) represents the head entity h, the relation r and the tail entity t with vectors h, r and t 2 Rn respectively, which were trained so that h+r ⇡ t. They define the energy function as
fr(h, t) = kh+ r tk`
where ` = 1 or 2, which means either the `1 or the `2 norm of the vector h + r t will be used depending on the performance on the validation set.
To better model relation-specific aspects of the same entity, TransR (Lin et al., 2015b) uses projection matrices and projects the head entity and the tail entity to a relation-dependent space. STransE (Nguyen et al., 2016b) extends TransR by employing different matrices for mapping the head and the tail entity. The energy function is
fr(h, t) = kWr,1h+ r Wr,2tk`
However, not all relations have abundant data to estimate the relation specific matrices as most of the training samples are associated with only a few relations, leading to the data sparsity problem for rare relations.
3 Interpretable Knowledge Transfer
3.1 Model
As discussed above, a fundamental weakness in TransR and STransE is that they equip each relation with a set of unique projection matrices, which not only introduces more parameters but also hinders knowledge sharing. Intuitively, many relations share some concepts with each other, although they are stored as independent symbols in KB. For example, the relation “(somebody) won award for (some work)” and “(somebody) was nominated for (some work)” both describe a person’s high-quality work which wins an award or a nomination respectively. This phenomenon suggests that one relation actually represents a collection of real-world concepts, and one concept
3
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
can be shared by several relations. Inspired by the existence of such lower-level concepts, instead of defining a unique set of projection matrices for every relation, we can alternatively define a small set of concept projection matrices and then compose them into customized projection matrices. Effectively, the relation-dependent translation space is then reduced to the smaller concept spaces.
However, in general, we do not have prior knowledge about what concepts exist out there and how they are composed to form relations. Therefore, in ITransF, we propose to learn this information simultaneously from data, together with all knowledge embeddings. Following this idea, we first present the model details, then discuss the optimization techniques for training.
Energy function Specifically, we stack all the concept projection matrices to a 3-dimensional tensor D 2 Rm⇥n⇥n, where m is the pre-specified number of concept projection matrices and n is the dimensionality of entity embeddings and relation embeddings. We let each relation select the most useful projection matrices from the tensor, where the selection is represented by an attention vector. The energy function of ITransF is defined as:
fr(h, t) = k↵Hr ·D · h+ r ↵Tr ·D · tk` (1)
where ↵Hr ,↵Tr 2 [0, 1]m, satisfying P
i↵ H r,i =P
i↵ T r,i = 1, are normalized attention vectors used to compose all concept projection matrices in D by a convex combination. It is obvious that STransE can be expressed as a special case of our model when we use m = 2|R| concept matrices and set attention vectors to disjoint one-hot vectors. Hence our model space is a generalization of STransE. Note that we can safely use fewer concept matrices in ITransF and obtain better performance (see section 4.3), though STransE always requires 2|R| projection matrices.
We follow previous work to minimize the following hinge loss function:
L = X
(h,r,t)⇠P, (h0,r,t0)⇠N
⇥ + fr(h, t) fr(h0, t0) ⇤ + (2)
where P is the training set consisting of correct triples, N is the distribution of corrupted triples defined in section 3.3, and [·]+ = max(·, 0). Note that we have omitted the dependence of N on (h, r, t) to avoid clutter. We normalize the entity vectors h, t, and the projected entity vectors
↵Hr ·D · h and ↵Tr ·D · t to have unit length after each update, which is an effective regularization method that benefits all models.
Sparse attention vectors In Eq. (1), we have defined ↵Hr ,↵Tr to be some normalized vectors used for composition. With a dense attention vector, it is computationally expensive to perform the convex combination of m matrices in each iteration. Moreover, a relation usually does not consist of all existing concepts in practice. Furthermore, when the attention vectors are sparse, it is often easier to interpret their behaviors and understand how concepts are shared by different relations.
Motivated by these potential benefits, we further hope to learn sparse attention vectors in ITransF. However, directly posing `1 regularization (Tibshirani, 1996) on the attention vectors fails to produce sparse representations in our preliminary experiment, which motivates us to enforce `0 constraints on ↵Tr ,↵Hr .
In order to satisfy both the normalization condition and the `0 constraints, we reparameterize the attention vectors in the following way:
↵Hr = SparseSoftmax(v H r , I H r ) ↵Tr = SparseSoftmax(v T r , I T r )
where vHr ,vTr 2 Rm are the pre-softmax scores, IHr , I T r 2 {0, 1}m are the sparse assignment vectors, indicating the non-zero entries of attention vectors, and the SparseSoftmax is defined as
SparseSoftmax(v, I)i = exp(vi/⌧)IiP j exp(vj/⌧)Ij
with ⌧ being the temperature of Softmax. With this reparameterization, vHr ,vTr and IHr , I T r replace ↵Tr ,↵Hr to become the real parameters of the model. Also, note that it is equivalent to pose the `0 constraints on IHr , ITr instead of ↵Tr ,↵ H r . Putting these modifications together, we can rewrite the optimization problem as
minimize L subject to kIHr k0  k, kITr k0  k
(3)
where L is the loss function defined in Eq. (2).
3.2 Block Iterative Optimization
Though sparseness is favorable in practice, it is generally NP-hard to find the optimal solution under `0 constraints. Thus, we resort to an approximated algorithm in this work.
4
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
For convenience, we refer to the parameters with and without the sparse constraints as the sparse partition and the dense partition, respectively. Based on this notion, the high-level idea of the approximated algorithm is to iteratively optimize one of the two partitions while holding the other one fixed. Since all parameters in the dense partition, including the embeddings, the projection matrices, and the pre-softmax scores, are fully differentiable with the sparse partition fixed, we can simply utilize SGD to optimize the dense partition. Then, the core difficulty lies in the step of optimizing the sparse partition (i.e. the sparse assignment vectors), during which we want the following two properties to hold
1. the sparsity required by the `0 constaint is maintained, and
2. the cost define by Eq. (2) is decreased.
Satisfying the two criterion seems to highly resemble the original problem defined in Eq. (3). However, the dramatic difference here is that with parameters in the dense partition regarded as constant, the cost function is decoupled w.r.t. each relation r. In other words, the optimal choice of IHr , I T r is independent of IHr0 , I T r0 for any r
0 6= r. Therefore, we only need to consider the optimization for a single relation r, which is essentially an assignment problem. Note that, however, IHr and ITr are still coupled, without which we basically reach the situation in a backpack problem. In principle, one can explore combinatorial optimization techniques to optimize IHr0 , I T r0 jointly, which usually involve some iterative procedure. To avoid adding another inner loop to our algorithm, we turn to a simple but fast approximation method based on the following single-matrix cost.
Specifically, for each relation r, we consider the induced cost LHr,i where only a single projection matrix i is used for the head entity:
LHr,i = X
(h,r,t)⇠Pr, (h0,r,t0)⇠Nr
⇥ + fHr,i(h, t) fHr,i(h0, t0) ⇤ +
where fHr,i(h, t) = kDi · h + r ↵Tr · D · tk is the corresponding energy function, and the subscript in Pr and Nr denotes the subsets with relation r. Intuitively, LHr,i measures, given the current tail attention vector ↵Tr , if only one project matrix could be chosen for the head entity, how implausible Di would be. Hence, i⇤ = argmini LHr,i gives
us the best single projection matrix on the head side given ↵Tr .
Now, in order to choose the best k matrices, we basically ignore the interaction among projection matrices, and update IHr in the following way:
IHr,i ( 1, i 2 argpartitioni(LHr,i, k) 0, otherwise
where the function argpartitioni(xi, k) produces the index set of the lowest-k values of xi.
Analogously, we can define the single-matrix cost LTr,i and the energy function fTr,i(h, t) on the tail side in a symmetric way. Then, the update rule for IHr follows the same derivation. Admittedly, the approximation described here is relatively crude. But as we will show in section 4, the proposed algorithm yields good performance empirically. We leave the further improvement of the optimization method as future work.
3.3 Corrupted Sample Generating Method
Recall that we need to sample a negative triple (h0, r, t0) to compute hinge loss shown in Eq. 2, given a positive triple (h, r, t) 2 P . The distribution of negative triple is denoted by N(h, r, t). Previous work (Bordes et al., 2013; Lin et al., 2015b; Yang et al., 2015; Nguyen et al., 2016b) generally constructs a set of corrupted triples by replacing the head entity or tail entity with a random entity uniformly sampled from the KB.
However, uniformly sampling corrupted entities may not be optimal. Often, the head and tail entities associated a relation can only belong to a specific domain. When the corrupted entity comes from other domains, it is very easy for the model to induce a large energy gap between true triple and corrupted one. As the energy gap exceeds , there will be no training signal from this corrupted triple. In comparison, if the corrupted entity comes from the same domain, the task becomes harder for the model, leading to more consistent training signal.
Motivated by this observation, we propose to sample corrupted head or tail from entities in the same domain with a probability pr and from the whole entity set with probability 1 pr. The choice of relation-dependent probability pr is specified in Appendix A.1. In the rest of the paper, we refer to the new proposed sampling method as ”domain sampling”.
5
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
4 Experiments
4.1 Setup
To evaluate link prediction, we conduct experiments on the WN18 (WordNet) and FB15k (Freebase) introduced by Bordes et al. (2013) and use the same training/validation/test split as in (Bordes et al., 2013). The information of the two datasets is given in Table 1.
Dataset #E #R #Train #Valid #Test WN18 40,943 18 141,442 5,000 5,000 FB15k 14,951 1,345 483,142 50,000 59,071
Table 1: Statistics of FB15k and WN18 used in experiments. #E, #R denote the number of entities and relation types respectively. #Train, #Valid and #Test are the numbers of triples in the training, validation and test sets respectively.
In knowledge base completion task, we evaluate model’s performance of predicting the head entity or the tail entity given the relation and the other entity. For example, to predict head given relation r and tail t in triple (h, r, t), we compute the energy function fr(h0, t) for each entity h0 in the knowledge base and rank all the entities according to the energy. We follow Bordes et al. (2013) to report the filter results, i.e., removing all other correct candidates h0 in ranking. The rank of the correct entity is then obtained and we report the mean rank (mean of the predicted ranks) and Hits@10 (top 10 accuracy). Lower mean rank or higher Hits@10 mean better performance.
4.2 Implementation Details
We initialize the projection matrices with identity matrices added with a small noise sampled from normal distribution N (0, 0.0052). The entity and relation vectors of ITransF are initialized by TransE (Bordes et al., 2013), following Lin et al. (2015b); Ji et al. (2015); Garcı́a-Durán et al. (2016, 2015); Lin et al. (2015a). We ran minibatch SGD until convergence. We employ the “Bernoulli” sampling method to generate incorrect triples as used in Wang et al. (2014), Lin et al. (2015b), He et al. (2015), Ji et al. (2015) and Lin et al. (2015a).
STransE (Nguyen et al., 2016b) is the most similar knowledge embedding model to ours except that they use distinct projection matrices for each relation. We use the same hyperparameters as used in STransE and no significant improvement is observed when we alter hyperparameters. We set the
margin to 5 and dimension of embedding n to 50 for WN18, and = 1, n = 100 for FB15k. We set the batch size to 20 for WN18 and 1000 for FB15k. The learning rate is 0.01 on WN18 and 0.1 on FB15k. We use 30 matrices on WN18 and 300 matrices on FB15k. All the models are implemented with Theano (Bergstra et al., 2010). The Softmax temperature is set to 1/4.
4.3 Results & Analysis
The overall link prediction results1 are reported in Table 2. Our model consistently outperforms previous models without external information on both the metrics of WN18 and FB15k. On WN18, we even achieve a much better mean rank with comparable Hits@10 than current state-of-the-art model IRN employing external information.
We can see that path information is very helpful on FB15k and models taking advantage of path information outperform intrinsic models by a significant margin. Indeed, a lot of facts are easier to recover with the help of multi-step inference. For example, if we know Barack Obama is born in Honolulu, a city in the United States, then we easily know the nationality of Obama is the United States. An straightforward way of extending our proposed model to k-step path P = {ri}ki=1 is to define a path energy function k↵HP · D · h +P
ri2P ri ↵ T P · D · tk`, ↵HP is a concept association related to the path. We plan to extend our model to multi-step path in the future.
To provide a detailed understanding why the proposed model achieves better performance, we present some further analysis in the sequel.
Performance on Rare Relations In the proposed ITransF, we design an attention mechanism to encourage knowledge sharing across different relations. Naturally, facts associated with rare relations should benefit most from such sharing, boosting the overall performance. To verify this hypothesis, we investigate our model’s performance on relations with different frequency. Specifically, we sort all relations by their frequency in the training set, and split them into 5 buckets evenly. Within each bucket, we compare our model with STransE, as shown in Fig-
1Note that although IRN (Shen et al., 2016) does not explicitly exploit path information, it performs multi-step inference through the multiple usages of external memory. When IRN is allowed to access memory once for each prediction, its Hits@10 is 80.7, similar to models without path information.
6
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
Model Additional Information WN18 FB15kMean Rank Hits@10 Mean Rank Hits@10 SE (Bordes et al., 2011) No 985 80.5 162 39.8 Unstructured (Bordes et al., 2014) No 304 38.2 979 6.3 TransE (Bordes et al., 2013) No 251 89.2 125 47.1 TransH (Wang et al., 2014) No 303 86.7 87 64.4 TransR (Lin et al., 2015b) No 225 92.0 77 68.7 CTransR (Lin et al., 2015b) No 218 92.3 75 70.2 KG2E (He et al., 2015) No 348 93.2 59 74.0 TransD (Ji et al., 2015) No 212 92.2 91 77.3 TATEC (Garcı́a-Durán et al., 2016) No - - 58 76.7 NTN (Socher et al., 2013) No - 66.1 - 41.4 DISTMULT (Yang et al., 2015) No - 94.2 - 57.7 STransE (Nguyen et al., 2016b) No 206 (244) 93.4 (94.7) 69 79.7 ITransF No 205 94.2 65 81.0 ITransF (domain sampling) No 223 95.2 77 81.4 RTransE (Garcı́a-Durán et al., 2015) Path - - 50 76.2 PTransE (Lin et al., 2015a) Path - - 58 84.6 NLFeat (Toutanova and Chen, 2015) Node + Link Features - 94.3 - 87.0 Random Walk (Wei et al., 2016) Path - 94.8 - 74.7 IRN (Shen et al., 2016) External Memory 249 95.3 38 92.7
Table 2: Link prediction results on two datasets. Higher Hits@10 or lower Mean Rank indicates better performance. Following Nguyen et al. (2016b) and Shen et al. (2016), we divide the models into two groups. The first group contains intrinsic models without using extra information. The second group make use of additional information. Results in the brackets are another set of results STransE reported.
ure 1.2 As we can see, on WN18, ITransF outperforms STransE by a significant margin on rare relations. In particular, in the last bin (rarest relations), the average Hits@10 increases from 55.2 to 93.8, showing the great benefits of transferring statistical strength from common relations to rare ones. On FB15k, we can also observe a similar pattern, although the degree of improvement is less significant. We conjecture the difference roots in the fact that many rare relations on FB15k have disjoint domains, knowledge transfer through common concepts is harder.
Interpretability In addition to the quantitative evidence supporting the effectiveness of knowledge sharing, we provide some intuitive examples to show how knowledge is shared in our model. As we mentioned earlier, the sparse attention vectors fully capture the association between relations and concepts and hence the knowledge transfer among relations. Thus, we visualize the attention vectors for several relations on both WN18 and FB15K in Figure 2.
For WN18, the words “hyponym” and “hypernym” refer to words with more specific or general meaning respectively. For example, PhD is a hyponym of student and student is a hypernym of PhD. As we can see, concepts associated with the head entities in one relation are also associated
2Domain sampling is not employed.
with the tail entities in its reverse relation. Further, “instance hypernym” is a special hypernym with the head entity being an instance, and the tail entity being an abstract notion. A typical example is (New York,instance hypernym, city). This connection has also been discovered by our model, indicated by the fact that “instance hypernym(T)” and “hypernym(T)” share a common concept matrix. Finally, for symmetric relations like “similar to”, we see the head attention is identical to the tail attention, which well matches our intuition.
On FB15k, we also see the sharing between reverse relations, as in “(somebody) won award for (some work)” and “(some work) award winning work (somebody)”. What’s more, although relation “won award for” and “was nominated for” share the same concepts, their attention distributions are different, suggesting distinct emphasis. Finally, symmetric relations like spouse behave similarly as mentioned before.
Model Compression A byproduct of parameter sharing mechanism employed by ITransF is a much more compact model with equal performance. Figure 3 plots the average performance of ITransF against the number of projection matrices m, together with two baseline models. On FB15k, when we reduce the number of matrices from 2200 to 30 (⇠ 90⇥ compression), our model performance decreases by only 0.09% on
7
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
674
675
676
677
678
679
680
681
687
688
689
690
691
692
693
694
695
696
697
698
699
H its
@ 10
0
25
50
75
100
Relation Bin 1 2 3 4 5
ITransF STransE
(a) WN18
H its
@ 10
0
25
50
75
100
Relation Bin 1 2 3 4 5
ITransF STransE
(b) FB15k
(a) WN18 (b) FB15k
Figure 2: Heatmap visualization of attention vectors on WN18 and FB15k. Each row is an attention vector ↵Hr or ↵Tr for a relation’s head or tail concepts.
Hits@10, still outperforming STransE. Similarly, on WN18, ITransF continues to achieve the best performance when we reduce the number of concept project matrices to 18.
5 Analysis on Sparseness
Sparseness is desirable since it contribute to interpretability and computational efficiency of our model. We investigate whether enforcing sparseness would deteriorate the model performance and compare our method with another sparse encoding methods in this section.
Dense Attention vs Sparse Attention Although sparsity usually enjoys many practical advantages, it may deteriorate the model performance when applied improperly. Here, we show that our model employing sparse attention can achieve similar results with dense attention with a significantly less computational burden. We compare models in a setting where the computation time of dense attention model is acceptable3. We use 22 weight
3With 300 projection matrices, it takes 1h1m to run one epoch for a model with dense attention.
matrices on WN18 and 15 weight matrices on FB15k and train both the models for 1500 epochs. The results are reported in table 3. Generally, ITransF with sparse attention has slightly better performance comparing to dense attention except a higher mean rank on WN18.
Nonnegative Sparse Encoding In the proposed model, we induce the sparsity by a carefully designed iterative optimization procedure. Apart from this approach, one may utilize sparse encoding techniques to obtain sparseness based on the pretrained projection matrices from STransE. Concretely, stacking |2R| pretrained projection matrices into a 3-dimensional tensor X 2
8
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
H its
@ 10
70
73.25
76.5
79.75
83
# matrices 15 30 75 300 600 1200 1345 2200 2690
ITransF STransE CTransR
(a) FB15k
H its
@ 10
90
91.25
92.5
93.75
95
# matrices 18 22 26 30 36 45
ITransF STransE CTransR
(b) WN18
Figure 3: Performance with different number of projection matrices. Note that the X-axis denoting the number of matrices is not linearly scaled.
R2|R|⇥n⇥n, similar sparsity can be induced by solving an `1-regularized tensor completion problem minA,D ||X DA||22 + kAk`1 . Basically, A plays the same role as the attention vectors in our model. For more details, we refer readers to (Faruqui et al., 2015).
For completeness, we compare our model with the aforementioned approach4. The comparison is summarized in table 4. On both benchmarks, ITransF achieves significant improvement against sparse encoding on pretrained model. This performance gap should be expected since the objective function of sparse encoding methods is to minimize the reconstruction loss rather than optimize the criterion for link prediction.
Method WN18 FB15kMR H10 MR H10 Sparse Encoding 211 86.6 66 79.1 ITransF 205 94.2 65 81.0
Table 4: Different methods to obtain sparse representations
6 Related Work
In KBC, CTransR (Lin et al., 2015b) enables relation embedding sharing across similar relations, but they cluster relations before training rather than learning it in a principled way. Further, they do not solve the data sparsity problem because there is no sharing of projection matrices which have a lot more parameters.
Data sparsity is a common problem in many fields. Transfer learning (Pan and Yang, 2010) has been shown to be promising to transfer knowledge and statistical strengths across similar models or languages. For example, Bharadwaj et al.
4We use the toolkit provided by (Faruqui et al., 2015).
(2016) transfers models on resource-rich languages to low resource languages by parameter sharing through common phonological features in name entity recognition. Zoph et al. (2016) initialize from models trained by resource-rich languages to translate low-resource languages.
Several works on obtaining a sparse attention (Martins and Astudillo, 2016; Makhzani and Frey, 2014; Shazeer et al., 2017) share a similar idea of sorting the values before softmax and only keeping the K largest values. However, the sorting operation in these works is not GPU-friendly.
The block iterative optimization algorithm in our work is inspired by LightRNN (Li et al., 2016). They allocate every word in the vocabulary in a table. A word is represented by a row vector and a column vector depending on its position in the table. They iteratively optimize embeddings and allocation of words in tables.
7 Conclusion and Future Work
In summary, we propose a knowledge embedding model which can discover shared hidden concepts, and design a learning algorithm to induce the interpretable sparse representation. Empirically, we show our model can improve the performance on two benchmark datasets without external resources, over all previous models of the same kind.
In the future, we plan to enable ITransF to perform multi-step inference, and extend the sharing mechanism to entity and relation embeddings, further enhancing the statistical binding across parameters. In addition, our framework can also be applied to multi-task learning, promoting a finer sharing among different tasks.
9
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
This paper considers the problem of KB completion and proposes ITransF for this purpose. Unlike STransE that assigns each relation an independent matrix, this paper proposes to share the parameters between different relations. A model is proposed where a tensor D is constructed that contains various relational matrices as its slices and a selectional vector   alpha is used to select a subset of relevant relational matrix for composing a particular semantic relation. The paper then discuss a technique to make   alpha sparse. Experimental results on two standard benchmark datasets shows the superiority of ITransF over prior proposals.  The paper is overall well written and the experimental results are good. However, I have several concerns regarding this work that I hope the authors will answer in their response.  1. Just by arranging relational matrices in a tensor and selecting (or more appropriately considering a linearly weighted sum of the relational matrices) does not ensure any information sharing between different relational matrices. This would have been the case if you had performed some of a tensor decomposition and projected the different slices (relational matrices) into some common lower-dimensional core tensor. It is not clear why this approach was not taken despite the motivation to share information between different relational matrices. 2. The two requirements (a) to share information across different relational matrices and (b) make the attention vectors sparse are some what contradictory. If the attention vector is truly sparse and has many zeros then information will not flow into those slices during optimisation.  3. The authors spend a lot of space discussing techniques for computing sparse attention vectors. The authors mention in page 3 that   ell_1 regularisation did not work in their preliminary experiments. However, no experimental results are shown for   ell_1 regularisation nor they explain why   ell_1 is not suitable for this task. To this reviewer, it appears as an obvious baseline to try, especially given the ease of optimisation. You use   ell_0 instead and get into NP hard optimisations because of it. Then you propose a technique and a rather crude approximation in the end to solve it. All that trouble could be spared if   ell_1 was used. 4. The vector   alpha is performing a selection or a weighing over the slices of D. It is slightly misleading to call this as  attention d as it is a term used in NLP for a more different type of models (see attention model used in machine translation). 5. It is not clear why you need to initialise the optimisation by pre-trained embeddings from TransE. Why cannot you simply randomly initialise the embeddings as done in TransE and then update them? It is not fair to compare against TransE if you use TransE as your initial point.  Learning the association between semantic relations is an idea that has been used in related problems in NLP such as relational similarity measurement [Turney JAIR 2012] and relation adaptation [Bollegala et al. IJCAI 2011]. It would be good to put the current work with respect to such prior proposals in NLP for modelling inter-relational correlation similarity.  Thanks for providing feedback. I have read it.