Abstract
Embedding models for entities and relations are extremely useful for recovering missing facts in a knowledge base. Intuitively, a relation can be modeled by a matrix mapping entity vectors. However, relations reside on low dimension sub-manifolds in the parameter space of arbitrary matrices---for one reason, composition of two relations $\boldsymbol{M}_1,\boldsymbol{M}_2$ may match a third $\boldsymbol{M}_3$ (e.g. composition of relations currency_of_country and country_of_film usually matches currency_of_film_budget), which imposes compositional constraints to be satisfied by the parameters (i.e. $\boldsymbol{M}_1\cdot \boldsymbol{M}_2\approx \boldsymbol{M}_3$). In this paper we investigate a dimension reduction technique by training relations jointly with an autoencoder, which is expected to better capture compositional constraints. We achieve state-of-the-art on Knowledge Base Completion tasks with strongly improved Mean Rank, and show that joint training with an autoencoder leads to interpretable sparse codings of relations, helps discovering compositional constraints and benefits from compositional training.
Introduction
Knowledge Bases (KBs) like Freebase or WordNet are massive repositories of facts, yet they are notoriously incomplete. Knowledge Base Completion (KBC) aims to predict missing links by representing entities as vectors and relations as matrices that map a "head" entity to a "tail" entity. However, this approach suffers from parameter explosion: a $d \times d$ matrix has $d^2$ parameters, leading to overfitting and a failure to share information between similar relations.
Previous solutions imposed "hard" constraints—such as forcing matrices to be diagonal or using simple translations—which are often too rigid to capture complex compositional constraints. For instance, the composition of country_of_film and currency_of_country should logically approximate currency_of_film_budget.
Joint Training with an Autoencoder
The proposed framework balances two competing objectives to regularize the relation matrices effectively:
- KB-Learning Objective ($L_1$): A standard bilinear score function that predicts triple validity using Noise Contrastive Estimation (NCE).
- Reconstruction Objective ($L_2$): An autoencoder that vectorizes the relation matrix, compresses it into a low-dimensional "coding" using a ReLU activation, and then reconstructs the original matrix.
By backpropagating the reconstruction error into the relation matrices, the autoencoder acts as a soft regularizer. Instead of imposing a fixed structure, it encourages the model to discover a low-dimensional manifold that best represents the data. The model also incorporates compositional training, where it is trained on paths of relations (e.g., $M_{r1} \cdot M_{r2} \approx M_{r3}$), allowing it to learn the underlying logic of the KB.
Key Insights and Interpretability
A major advantage of this joint training is the emergence of interpretable sparse codings. The ReLU activation in the autoencoder forces the relation codings to be sparse, where specific dimensions naturally correspond to semantic concepts.
As shown in the heatmap above, relations like currency_of_country and currency_of_company share high activation in specific dimensions (e.g., dimension 12), making the model's internal logic "readable" to humans. Additionally, UMAP visualizations confirm that joint training pulls infrequent relations toward clusters of frequent ones, facilitating better parameter sharing and generalization.
Key Results
The model was evaluated on standard KBC benchmarks (WN18, FB15k) and their more challenging versions (WN18RR, FB15k-237).
- State-of-the-Art Mean Rank (MR): Significant improvements were achieved across all datasets. On WN18RR, the joint model improved the MR from 4371 to 4233; with compositional training, it reached 2268.
- Compositional Discovery: The joint model significantly outperformed base models in identifying logical compositions, proving it successfully learns the "algebra" of the knowledge base.
- Robustness: The "Base" model, when tuned with specific optimization tricks like identity initialization, outperformed many complex existing models even before adding the autoencoder.
Conclusion
Joint training with an autoencoder provides a powerful mechanism for learning interpretable and compositional relation embeddings. By discovering low-dimensional manifolds rather than imposing rigid constraints, the model achieves state-of-the-art performance while providing transparent, semantically meaningful representations.
Summary updated