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)$.
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:
- 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.
- 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.
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