Locally Adaptive Translation for Knowledge Graph Embedding

Yantao Jia, Yuanzhuo Wang, Hailun Lin, Xiaolong Jin, Xueqi Cheng

Abstract

Knowledge graph embedding aims to represent entities and relations in a large-scale knowledge graph as elements in a continuous vector space. Existing methods, e.g., TransE and TransH, learn embedding representation by defining a global margin-based loss function over the data. However, the optimal loss function is determined during experiments whose parameters are examined among a closed set of candidates. Moreover, embeddings over two knowledge graphs with different entities and relations share the same set of candidate loss functions, ignoring the locality of both graphs. This leads to the limited performance of embedding related applications. In this paper, we propose a locally adaptive translation method for knowledge graph embedding, called TransA, to find the optimal loss function by adaptively determining its margin over different knowledge graphs. Experiments on two benchmark data sets demonstrate the superiority of the proposed method, as compared to the-state-of-the-art ones.

Introduction

Knowledge Graph Embedding (KGE) maps entities and relations into a continuous vector space to facilitate downstream tasks like link prediction and triple classification. Traditional models like TransE and TransH typically employ a margin-based loss function. This approach aims to ensure that the energy score of a valid triple $(h, r, t)$ is lower than that of a corrupted triple $(h', r, t')$ by at least a fixed margin $M$.

However, these methods suffer from two primary limitations. First, the margin is often treated as a global hyperparameter tuned via grid search over a limited set of values (e.g., {1, 2, 10}), which rarely captures the true mathematical optimum. Second, they ignore the "locality" of knowledge graphs. Different regions of a graph exhibit varying densities and structures; a single global margin fails to account for these local variations, leading to sub-optimal embeddings.

Methodology: TransA

To address these issues, we propose TransA, a model that adaptively determines the margin based on local graph structure. Instead of a fixed $M$, TransA calculates an optimal margin $M_{opt}$ as a weighted combination of entity-specific and relation-specific factors: $$M_{opt} = \mu M_{ent} + (1 - \mu) M_{rel}$$

Entity-Specific Margin ($M_{ent}$)

The entity-specific margin is designed to handle the local density of entities. For a given head entity, the model defines two concentric spheres. The inner sphere contains all "positive" tail entities (valid relations), while the outer sphere aims to exclude "negative" entities. $M_{ent}$ represents the distance between these spheres, effectively adapting to the local cluster size.

Illustration of the entity-specific margin $M_{ent}$ using concentric spheres.

Relation-Specific Margin ($M_{rel}$)

The relation-specific margin accounts for the proximity of different relations in the embedding space. If two relations are semantically similar, a smaller margin is used to distinguish them, whereas more distinct relations receive a larger margin.

Theoretical Foundation

We provide a mathematical proof demonstrating that an excessively large margin can lead to overfitting. By forcing the model to separate triples by an arbitrarily large distance, generalization error increases. This justifies the pursuit of "moderately small" adaptive margins that reflect the underlying data distribution.

Experiments and Results

We evaluated TransA on standard benchmarks: WN18 and FB15K for link prediction, and WN11, FB13, and FB15K for triple classification.

TransA significantly outperforms state-of-the-art baselines. As shown in the results table, TransA achieves the lowest Mean Rank across both "Raw" and "Filter" settings. For instance, on FB15K, TransA reaches a Filtered Mean Rank of 58, a substantial improvement over TransE (125) and TransH (84-87).

Link prediction results on WN18 and FB15K datasets comparing TransA with baselines.

Triple Classification

On the WN11 dataset, TransA achieved an accuracy of 93.2%, significantly higher than TransH (78.8%). Similar improvements were observed on FB15K (87.7% vs 80.2% for TransH).

Discussion and Conclusion

The success of TransA highlights the importance of locality in knowledge graph embeddings. By partitioning the FB15K dataset into subsets, the authors empirically confirmed that different subgraphs indeed have different optimal margins (e.g., one subset performed best with a margin of 3, while another preferred a margin of 2).

While TransA currently assumes entities and relations reside in the same vector space, it offers a scalable framework through the use of an "active set method" to efficiently calculate local margins. Future work could explore making the trade-off parameter $\mu$ adaptive or extending the model to heterogeneous vector spaces.

Summary updated

BibTeX
@inproceedings{jia2016locally,
  author = {Yantao Jia and Yuanzhuo Wang and Hailun Lin and Xiaolong Jin and Xueqi Cheng},
  title = {{Locally Adaptive Translation for Knowledge Graph Embedding}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2016},
  url = {https://openreview.net/forum?id=rJEuUk-ubS},
}
Figure