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 (KG) embedding involves representing entities and relations as vectors in a continuous space. Popular "translation-based" models like TransE assume that for a valid triple $(h, r, t)$, the vectors should satisfy $h + r \approx t$. To train these models, researchers typically use a margin-based loss function, which encourages the score of a "correct" triple to be lower than an "incorrect" one by at least a certain margin ($M$).
The authors identify two major flaws in current methods. First, the optimal margin is usually chosen from a tiny, arbitrary set of candidates via grid search, which is computationally inefficient. Second, existing methods use the same global margin for the entire graph, ignoring the fact that KGs are heterogeneous. A margin that works for a dense part of the graph might be inappropriate for a sparse part.
Methods
The core contribution is TransA, which adaptively determines the optimal margin ($M_{opt}$) based on the local topology of the graph. The margin is defined as a weighted combination of entity-specific and relation-specific components:
$$M_{opt} = \mu M_{ent} + (1 - \mu) M_{rel}$$
Entity-specific Margin ($M_{ent}$)
Inspired by Support Vector Machines (SVMs) and metric learning, this margin is calculated by finding the distance between the farthest "positive" entity and the nearest "negative" entity for a given head-relation pair. It essentially creates a "buffer zone" tailored to that specific entity's neighborhood.
Relation-specific Margin ($M_{rel}$)
This component quantifies the proximity of different relations, ensuring that similar relations are grouped appropriately while dissimilar ones are pushed further apart in the vector space.
Experimental Results
The authors evaluated TransA on standard benchmarks derived from WordNet and Freebase, specifically WN18 and FB15K for link prediction, and WN11, FB13, and FB15K for triple classification.
Link Prediction
On the FB15K dataset, TransA achieved a Mean Rank (Filter) of 58, a massive improvement over TransE (125) and TransH (84). A lower mean rank indicates the model is much better at placing the correct entity at the top of its predicted list.
Triple Classification
On WN11, TransA reached 93.2% accuracy, significantly higher than TransH (78.8%) and the Neural Tensor Network (70.4%). The results suggest that TransA is particularly superior on sparse graphs where local structure varies wildly.
Key Insights and Discussion
- The "Goldilocks" Margin: The paper provides a formal proof that the margin represents a trade-off. If the margin is too small, the model cannot distinguish between true and false triples; if it is too large, the model overfits to the training data.
- Locality Matters: By partitioning FB15K into subsets, the authors experimentally proved that different subgraphs require different optimal margins to achieve peak performance. A global margin is often a "one-size-fits-none" solution.
- Efficiency: To handle the computational cost of finding nearest negative entities, the authors adopted an "active set" method, checking only a small fraction of negative entities likely to be near the boundary.
While TransA shows significant gains, future work could explore making the hyperparameter $\mu$ adaptive and extending the model to more complex embedding spaces beyond $R^d$.
Summary updated