Adaptive Margin Ranking Loss for Knowledge Graph Embeddings via a Correntropy Objective Function

Mojtaba Nayyeri, Xiaotian Zhou, Sahar Vahdati, Hamed Shariat Yazdi, Jens LehmannarXiv 2019

TL;DR

This paper introduces Adaptive Margin Loss (AML), a novel loss function for training translation-based Knowledge Graph Embedding (KGE) models like TransE. By utilizing a slack variable and a correntropy objective function, AML automatically adjusts the optimization margin during training. This eliminates the need for tedious, multi-variable hyperparameter grid searches while simultaneously achieving state-of-the-art accuracy on link prediction tasks.

What Problem Does This Paper Address?

Knowledge Graphs (KGs) represent real-world information as triples: (head entity, relation, tail entity), or $(h, r, t)$. Because real-world KGs are notoriously incomplete, researchers use Knowledge Graph Embeddings (KGEs) to map entities and relations into a continuous vector space to predict missing links. The classic model, TransE, assumes that the vector addition of the head and the relation should approximate the tail: $h + r \approx t$.

To train these models, researchers traditionally rely on Margin Ranking Loss (MRL). MRL ensures that a true ("positive") triple scores better than a corrupted ("negative") triple by at least a fixed margin ($\gamma$). However, MRL has a major flaw: it only cares about the relative difference between positive and negative scores. As a result, positive triples can end up with excessively high absolute scores, violating the core $h + r \approx t$ assumption.

Previous attempts to fix this introduced upper and lower bounds ($\gamma_1$ and $\gamma_2$) to constrain the scores. Unfortunately, finding the right combination of these bounds requires an expensive, trial-and-error grid search with a complexity of $O(n^2)$.

Figure 1: Illustration of Loss Functions.

Methods

The authors propose Adaptive Margin Loss (AML) to automate margin adjustment. Instead of searching for two separate bounds, AML focuses on a single hyperparameter: $\gamma$, the center of the margin. It then introduces a global slack variable ($\xi$) to dynamically expand or contract the margin around that center during the learning process.

The paper outlines two distinct approaches for managing this slack variable:

  1. Contraction Approach: The margin starts artificially wide and gradually shrinks to an optimal size by penalizing the square of the slack variable ($\xi^2$) in the loss function.
  2. Expansion Approach: The margin starts at zero and automatically expands. To achieve this smoothly, the authors employ a correntropy objective function featuring a Gaussian kernel. This non-linear maximum-entropy framework naturally drives the gradient descent algorithm to push the margin wider until it reaches a stable convergence point.
Figure 2: Illustration of Adaptive Margin Loss.

Datasets

The proposed AML loss function was evaluated on two standard, widely recognized benchmark datasets for knowledge graph completion:

  • WN18: A subset of the WordNet lexical database containing English words and their semantic relations.
  • FB15k: A subset of Freebase, a large collaborative knowledge base of general world facts.

Key Insights and Ideas

  • Simplifying the Search Space: By shifting the optimization problem from finding two rigid boundaries ($\gamma_1, \gamma_2$) to dynamically tuning a single center point ($\gamma$), AML reduces hyperparameter tuning complexity from $O(n^2)$ to $O(n)$.
  • The Power of Correntropy: Using a correntropy objective function with a Gaussian kernel provides a robust, smooth mechanism for margin expansion. It prevents the optimization from getting stuck in poor local minima early in the training process.
  • Absolute vs. Relative Quality: Forcing the margin to adapt dynamically ensures that positive triples are driven toward low absolute scores, satisfying the geometric assumptions of translation models far better than standard MRL.

Key Results

The authors integrated AML into the TransE architecture (dubbed TransEAML) and evaluated it using Mean Rank (MR) and Hits@10 (the percentage of times the correct entity appears in the top 10 results).

TransEAML significantly outperformed standard TransE and previous limited-based loss functions:

  • WN18 (Filtered Hits@10): TransEAML achieved 95.2%, outperforming standard TransE (89.2%) and the previous best variant, TransE-RS (93.7%).
  • FB15k (Filtered Hits@10): TransEAML reached 77.8%, a massive leap over standard TransE (47.1%) and a notable improvement over TransE-RS (72.3%).

Limitations and Future Work

The primary limitation noted in the paper is that the Contraction and Expansion approaches are independent, solitary methods. The authors observe that the ideal choice between expansion and contraction depends heavily on the specific dataset and underlying model state, leaving this choice to the user via empirical testing.

For future work, the authors suggest exploring ways to automatically determine whether to expand or contract the margin, as well as applying AML to non-translation-based KGE architectures.

Summary updated

Abstract

Translation-based embedding models have gained significant attention in link prediction tasks for knowledge graphs. TransE is the primary model among translation-based embeddings and is well-known for its low complexity and high efficiency. Therefore, most of the earlier works have modified the score function of the TransE approach in order to improve the performance of link prediction tasks. Nevertheless, proven theoretically and experimentally, the performance of TransE strongly depends on the loss function. Margin Ranking Loss (MRL) has been one of the earlier loss functions which is widely used for training TransE. However, the scores of positive triples are not necessarily enforced to be sufficiently small to fulfill the translation from head to tail by using relation vector (original assumption of TransE). To tackle this problem, several loss functions have been proposed recently by adding upper bounds and lower bounds to the scores of positive and negative samples. Although highly effective, previously developed models suffer from an expansion in search space for a selection of the hyperparameters (in particular the upper and lower bounds of scores) on which the performance of the translation-based models is highly dependent. In this paper, we propose a new loss function dubbed Adaptive Margin Loss (AML) for training translation-based embedding models. The formulation of the proposed loss function enables an adaptive and automated adjustment of the margin during the learning process. Therefore, instead of obtaining two values (upper bound and lower bound), only the center of a margin needs to be determined. During learning, the margin is expanded automatically until it converges. In our experiments on a set of standard benchmark datasets including Freebase and WordNet, the effectiveness of AML is confirmed for training TransE on link prediction tasks.
BibTeX
@misc{nayyeri2019adaptive,
  author = {Mojtaba Nayyeri and Xiaotian Zhou and Sahar Vahdati and Hamed Shariat Yazdi and Jens Lehmann},
  title = {{Adaptive Margin Ranking Loss for Knowledge Graph Embeddings via a Correntropy Objective Function}},
  year = {2019},
  eprint = {1907.05336},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1907.05336},
}

Loading related content...

Figure