# Embedding Entities and Relations for Learning and Inference in Knowledge Bases

Simple bilinear embeddings beat TransE for knowledge base link prediction

Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, Li Deng · arXiv · 2014-12-20

- **Problem** Neural embedding models for knowledge bases differ in how they represent entities and relations, but they were never compared under controlled conditions. Link prediction alone also says little about what relational structure the embeddings capture.
- **Method** The authors compare embedding models in one framework and mine rules from relation embeddings.
- **Results** Bilinear-diag reached 57.7 HITS@10 on FB15k against 53.9 for TransE (DISTADD), in the authors' own implementation.

## Why compare embedding designs under one framework

Knowledge bases store facts as subject-predicate-object triples, and neural embedding models learn low-dimensional vectors for entities together with operators that score how well a triple holds. Models such as TransE and NTN are similar in form but differ in how they parametrize relation operators and how they represent entities, and the choices have not been compared under controlled conditions.

Evaluation on link prediction only indirectly indicates whether the vectors encode meaningful relational properties, since it checks the ranking of unseen triples rather than what relations the vectors capture. The study therefore asks two questions: how different entity and relation representations affect link prediction within one framework, and whether relation embeddings learned this way can be composed to mine Horn rules that involve compositional reasoning.

## A shared scoring framework for entities and relations

The projection is written as follows, where f may be linear or non-linear and W may be randomly initialized or initialized from pre-trained vectors. \\\[ y\_{e} = f(W x\_{e}) \\\] Most earlier models use one-hot inputs, whereas NTN represents an entity as the average of its word vectors, which amounts to bag-of-words input with a learned word-vector projection.

Relation scoring is built from two operators: a linear operator over the concatenated entity vectors, and a bilinear operator on the two entity vectors. \\\[ g\_{ar}(y\_{e1}, y\_{e2}) = A\_r^{T} \\begin{pmatrix} y\_{e1} \\\\ y\_{e2} \\end{pmatrix}, \\qquad g\_{br}(y\_{e1}, y\_{e2}) = y\_{e1}^{T} B\_r \\, y\_{e2} \\\] Table 1 expresses the scoring functions of Distance, Single Layer, TransE and NTN as combinations of these two operators, which makes their differences explicit.

NTN is the most expressive of these, since it contains both operators as special cases, while TransE has the fewest relation parameters because it uses only a vector for its linear operator.

The study adds a basic bilinear score in which the relation matrix M\_r is a full n-by-n matrix, so the score is the bilinear form of the two entity vectors. \\\[ g\_{br}(y\_{e1}, y\_{e2}) = y\_{e1}^{T} M\_r \\, y\_{e2} \\\] Restricting M\_r to a diagonal matrix gives Bilinear-diag, which has the same number of relation parameters as TransE and scores a triplet by a weighted element-wise product of the entity vectors.

## Margin-based training and fixed settings

Training uses only observed triplets, so negative triplets are built by corrupting either the subject or the object of each positive triplet. The loss sums, over the positive set T and the corrupted set T', a hinge term that is positive only when a corrupted triplet scores within a margin of the observed one. Minimizing this loss pushes each observed triplet's score above the scores of its corrupted triplets, and the sum is taken over every pair of positive and negative triplets.

Training uses mini-batch stochastic gradient descent with AdaGrad, and at each step two negative triplets are sampled per positive, one with a corrupted subject and one with a corrupted object. Entity vectors are renormalized to unit length after each gradient step, which the authors report empirically improved all models, and relation parameters use standard L2 regularization.

For all models the entity dimensionality is 100, the regularization parameter is 0.0001, and the number of training epochs is 100 on FB15k and FB15k-401 and 300 on WN. The initial learning rate is 0.1 and is adapted by AdaGrad, and the epoch counts were chosen from learning curves where all models plateaued.

## Link prediction results across embedding models

Each test triplet is evaluated by treating each entity as the target in turn, ranking the correct entity against corrupted entities, and scoring the ranking with MRR, HITS@10 and MAP. The experiments use WN with 151,442 triplets, 40,943 entities and 18 relations, FB15k with 592,213 triplets, 14,951 entities and 1345 relations, and FB15k-401 with 560,209 triplets, 14,541 entities and 401 relations.

On FB15k, Bilinear-diag reached 57.7 HITS@10 against 53.9 for TransE (DISTADD), and on FB15k-401 it reached 58.5 against 54.7. NTN gives the lowest scores on both FB15k and WN, with 0.53 MRR and 66.1 HITS@10 on WN, and the authors read this as a sign of overfitting.

The authors' own TransE implementation reached 53.9 HITS@10 on FB15k, compared with 47.1 in the earlier published results, and 90.9 against 89.2 on WN. The authors attribute the gap mainly to the optimizer, AdaGrad against a constant learning rate, but the paper does not report a separate run that isolates this factor.

The text describes Bilinear as comparable or better than TransE, especially on WN, and the table shows 92.8 HITS@10 against 90.9 on WN. On FB15k, however, plain Bilinear reached 51.9 HITS@10 against 53.9 for TransE, so the plain bilinear model does not beat TransE on that dataset in Table 2.

The 73.2% HITS@10 figure in the abstract comes from DIST MULT-tanh-EV-init on FB15k-401 in a later table, not from plain Bilinear, and it is compared with the 54.7 TransE value from the link prediction table. Those two numbers therefore come from different model configurations and tables, and the comparison should be read with that difference in mind.

## Multiplicative versus additive composition of entities

Bilinear-diag and TransE have the same number of relation parameters, so the difference lies in how they combine two entity vectors. Bilinear-diag combines them by a weighted element-wise product, a multiplicative operation, while TransE subtracts them element-wise and adds a bias, an additive operation. The paper refers to these as DIST MULT and DISTADD to make the contrast explicit.

DIST MULT is higher than DISTADD on all datasets in Table 2. DIST MULT outperforms DISTADD in almost all categories, but for object prediction on n-to-1 relations DISTADD is higher, at 83.2 against 81.0.

## Non-linear projection and pre-trained entity vectors

The baseline is DIST MULT, which is compared with DIST MULT-tanh, using tanh as the entity projection, and with DIST MULT-tanh-EV-init, which starts entity parameters from 1000-dimensional word2vec entity vectors. A third variant, DIST MULT-tanh-WV-init, follows the NTN initialization by representing entities as averages of 300-dimensional word2vec word vectors.

The evaluation also reports MAP with entity-type checking, which filters predicted entities by the types that each relation accepts.

DIST MULT reached 0.36 MRR, 58.5 HITS@10 and 64.5 MAP, and DIST MULT-tanh reached 0.39, 63.3 and 76.0. DIST MULT-tanh-EV-init reached 0.42 MRR, 73.2 HITS@10 and 88.2 MAP, the highest on all three metrics in this table. DIST MULT-tanh-WV-init fell to 0.28 MRR, 52.5 HITS@10 and 65.5 MAP, below both DIST MULT and DIST MULT-tanh.

The authors suspect that word vectors fit poorly with entities named by non-compositional phrases, and they note that more than 73% of FB15k-401 entities are person names, locations, organizations or films. They conclude that pre-trained entity-level vectors from external text resources may help the embedding model, but this conclusion rests on the single EV-init setting tested here.

## Composing relation embeddings into Horn rules

A Horn rule has a head relation H and a chain of body relations B1 to Bn, where the body relations form a directed path and the head relation is an edge that closes the path. Body relations and the head must have distinct relation types, and the study works with rules of length 2 and 3. Inverse relations are used when two relations share a variable without forming a path, so that the shared variable connects the two relations in a consistent direction.

For length 2, the rule has the form B1(a,b) and B2(b,c) imply H(a,c), so the body is a composition of two relations in which a and c are related through some entity b. The method models this composition as addition for relation vectors and as multiplication for relation matrices, so the composed embedding stays in the same relation space.

The motivation is that a translation vector composed with another translation vector gives a translation of their sum, and a matrix product of two relations matches the bilinear score behavior of a chain.

Candidate pairs are limited by type constraints on the subject and object domains of the relations, so that only pairs whose domains overlap with the head relation's domains are considered. Similarity between relation embeddings is measured by Euclidean distance for vectors and by the Frobenius norm for matrices, and the distance ranks candidate compositions by their closeness to the head relation.

Algorithm 1 selects the K nearest sequences to the head relation by computing the distance between the head embedding and the composed body embedding. A global threshold removes weak candidates, and a gap-based cut-off then keeps the sequences up to the position j where the difference between consecutive distances is largest. The footnote gives K=100 for each method, with threshold values of 9.2, 36.3, 1.9 and 3.4 for length-2 rules across the four embedding variants.

The rule extraction experiments use FB15k-401 after removing equivalence relations and some other relations, which leaves 485,741 facts, 14,417 entities and 373 relations. The algorithm identifies 60,020 possible length-2 relation sequences and 2,156,391 possible length-3 relation sequences, and the thresholding keeps about 3.9K length-2 rules and about 2K length-3 rules.

Four variants are implemented with embeddings from TransE (DISTADD), Bilinear, Bilinear-diag (DIST MULT) and DIST MULT-tanh-EV-init.

## Rule extraction against AMIE

AMIE was run with its default setting on the same training set, producing 2,201 length-1 rules and 46,975 length-2 rules, of which 3,952 have the close-path property. AMIE ranks rules by PCA confidence by default, but the authors found that standard confidence gave better performance on this Freebase dataset, so the standard confidence ranking is used for the comparison.

Precision is the ratio of generated predictions that appear in the unseen test data to all generated unseen predictions, and the authors labeled the top 30 unseen facts of each method by checking Wikipedia.

Across the top length-2 rules, the aggregated precision of rules from the bilinear-family embeddings, Bilinear, Bilinear-diag and DIST MULT-tanh-EV-init, is higher than that of AMIE up to 10K predictions. The authors read this as evidence that the bilinear embeddings carry enough information about relations to select rules without looking at entity instantiations.

The authors give a concrete case: AMIE misses the rule that combines TVProgramCountryofOrigin and CountryOfficialLanguage to imply TVProgramLanguage, because it depends on instantiations present in the observed KB. The bilinear variants of EMBED RULE extract that rule from the embeddings of the three relations alone.

The authors also find that multiplicative composition of matrix embeddings, from DIST MULT and Bilinear, gives better length-2 precision than additive composition of vector embeddings from DISTADD. In their examples, DISTADD assigns a large distance between a composed body and the head relation, so it prunes the composition FilmDistributorInRegion with RegionGDPCurrency for FilmBudgetCurrency, while DIST MULT ranks that composition as the nearest neighbor.

The authors link Bilinear's growing advantage over DIST MULT on longer rules to the limit of representing relations with diagonal matrices, since longer rules need more complex relation semantics.

EMBED RULE mines length-2 rules in 2 minutes and length-3 rules in 20 minutes, while AMIE mines rules of length at most 2 in 9 minutes. The authors report that the EMBED RULE timings are similar across the embedding types.

## Limitations

Bilinear-diag has the limitation that it cannot encode the difference between a relation and its inverse. Its diagonal restriction is also the reason the authors give for Bilinear's advantage on longer rules.

Precision is only an estimate, because a prediction that is not in the test data is not necessarily incorrect. The authors did not use the functional-property check suggested for AMIE, since most relations in their datasets are not functional, and they labeled only the top 30 unseen facts of each method. Rules whose head relations depend on dynamic factors, such as those involving the word current, were removed.

The authors note that the assumptions behind the composition properties may not hold in their implementations, and they leave how to enforce these constraints to future work. Rule extraction is evaluated on FB15k-401 only and reaches rules of length 2 and 3. The authors list learning deep structure in the framework as future work, and this direction is not tested in the paper.

## Paper info

- **Authors**: Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, Li Deng
- **Venue**: arXiv · Preprint
- **First published**: 2014-12-20
- **Added**: 2026-11-12
- **Updated**: 2015-8-29
- **Version**: v4
- **arXiv**: 1412.6575
- **Category**: cs.CL
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1412.6575v4) · [PDF ↗](https://arxiv.org/pdf/1412.6575v4)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, Li Deng (2014). Embedding Entities and Relations for Learning and Inference in Knowledge Bases. arXiv:1412.6575v4. https://arxiv.org/abs/1412.6575v4

**BibTeX**

```
@misc{yang2014embedding,
  title = {{Embedding Entities and Relations for Learning and Inference in Knowledge Bases}},
  author = {Bishan Yang and Wen-tau Yih and Xiaodong He and Jianfeng Gao and Li Deng},
  year = {2014},
  eprint = {1412.6575},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1412.6575v4}
}
```

## Other paper commentary

- [Semantics derived automatically from language corpora contain human-like biases](https://refivu.com/en/papers/abf5bfd6-5402-457c-958c-81fe475605f3-semantics-derived-automatically-from-language-corpora.md)
- [Using Information Content to Evaluate Semantic Similarity in a Taxonomy](https://refivu.com/en/papers/23ad22de-7daf-406d-8e06-0f53f8035655-using-information-content-to-evaluate-semantic-similarity-in.md)
- [Thumbs Up or Thumbs Down? Semantic Orientation Applied to Unsupervised Classification of Reviews](https://refivu.com/en/papers/6e4064ce-2095-4d56-8950-560f38e43e69-thumbs-up-or-thumbs-down-semantic-orientation-applied.md)
- [A large annotated corpus for learning natural language inference](https://refivu.com/en/papers/7e4b0424-7bbb-49b5-a1e2-69bf72d8d16b-a-large-annotated-corpus-for-learning-natural-language.md)
- [Recent Trends in Deep Learning Based Natural Language Processing](https://refivu.com/en/papers/6cdbf953-5aaa-4de2-9e22-528902a11655-recent-trends-in-deep-learning-based-natural-language.md)
- [A Broad-Coverage Challenge Corpus for Sentence Understanding through Inference](https://refivu.com/en/papers/6a9a87c0-1034-4d6f-8def-43a3279e4725-a-broad-coverage-challenge-corpus-for-sentence-understanding.md)
- [PointRCNN: 3D Object Proposal Generation and Detection from Point Cloud](https://refivu.com/en/papers/fd8426c6-d509-42eb-acc7-0541fd5f7fdd-pointrcnn-3d-object-proposal-generation-and-detection-from.md)
- [SphereFace: Deep Hypersphere Embedding for Face Recognition](https://refivu.com/en/papers/f6744cc0-1f38-4983-a7df-1f878512f241-sphereface-deep-hypersphere-embedding-for-face-recognition.md)
- [Performance Measures and a Data Set for Multi-Target, Multi-Camera Tracking](https://refivu.com/en/papers/9fda5f2a-866b-4d9c-a173-3e82bc5e8e0e-performance-measures-and-a-data-set-for-multi.md)
- [VGGFace2: A dataset for recognising faces across pose and age](https://refivu.com/en/papers/71a96842-a08d-49a9-b6a5-7cdbf9f76e4f-vggface2-a-dataset-for-recognising-faces-across-pose.md)
- [A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks](https://refivu.com/en/papers/22cf25fe-084f-44ca-aecf-bc06457c3a2c-a-baseline-for-detecting-misclassified-and-out-of.md)
- [$π\_0$: A Vision-Language-Action Flow Model for General Robot Control](https://refivu.com/en/papers/ad843b5e-218a-430e-9583-5911212661b1-0-a-vision-language-action-flow-model-for.md)

## Terms in this paper

- [precision](https://refivu.com/en/terms/29bee1303774-precision)
- [Adagrad](https://refivu.com/en/terms/d6141e5e2b98-adagrad)
- [word2vec](https://refivu.com/en/terms/aa6ca7ebd6f5-word2vec)
- [Mean Average Precision (MAP)](https://refivu.com/en/terms/aea689215183-mean-average-precision-map)
- [TransE](https://refivu.com/en/terms/ac9e869295ee-transe)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/d1a4fc27-43e3-48ba-b0b6-d1a50a552670-embedding-entities-and-relations-for-learning-and-inference)
