Learning Triple Embeddings from Knowledge Graphs

Valeria Fionda, Giuseppe PirròAAAI 2020

Abstract

Triple2Vec is a novel embedding technique that directly learns vector representations for entire triples (subject, predicate, object) in a Knowledge Graph (KG). By transforming the graph into a semantically weighted "triple line graph," it captures the nuanced roles entities play across different contexts, significantly outperforming traditional aggregation-based embedding methods in classification and recommendation tasks.

Introduction

In Knowledge Graphs, research typically focuses on representing entities (nodes) and predicates (edges) as low-dimensional vectors. When a representation for a full "triple" (e.g., (Lauren Oliver, nationality, American)) is required, researchers often use simple heuristics like averaging or concatenating component vectors. This approach suffers from context blindness—where an entity's vector remains static regardless of its relational role—and structural limitations in standard line graphs. Triple2Vec addresses these issues by treating the triple itself as the primary unit of embedding.

Methodology

The Triple2Vec workflow involves three main stages to generate triple-level embeddings:

  1. Triple Line Graph ($G_L$) Construction: A new graph is built where each node represents a unique triple from the original KG. Nodes in $G_L$ are connected if their corresponding triples share an endpoint (subject or object). This ensures connectivity and preserves structural context.
  2. Semantic Edge Weighting: To account for predicate importance and prevent high-degree nodes from dominating, a "predicate relatedness" weighting mechanism (TF-ITF) is applied. If two triples share predicates that frequently appear in similar contexts, the edge between them in $G_L$ is weighted more heavily.
  3. Random Walks and Skip-gram: Truncated random walks on the weighted $G_L$ generate sequences of triples, which are processed by a Skip-gram model to produce final embeddings.
The transformation process from a standard Knowledge Graph (a) to a Triple Line Graph (b) and finally a weighted Triple Line Graph (c).

Experimental Setup

The model was evaluated on three datasets: DBLP (bibliographic), Foursquare (social network), and Yago (movie domain). Since standard triple classification benchmarks were unavailable, the authors created "meta-labels" by propagating entity labels to their participating triples for evaluation.

Results and Discussion

Triple2Vec consistently outperformed baselines such as node2vec, DeepWalk, and metapath2vec, as well as state-of-the-art KG models like ConvE and RotatE. In triple classification tasks, F1-score improvements reached 10-15% in several scenarios.

Visual analysis using t-SNE confirms the superiority of the learned representations. Triple2Vec produces clear, tight clusters of semantically related facts, whereas baseline methods often result in overlapping and noisy distributions.

t-SNE visualization of Triple2Vec embeddings showing distinct, tight clustering of related facts.

Furthermore, integrating Triple2Vec embeddings into recommendation models (like KPRN) improved ranking metrics (Hit@k and NDCG) on MovieLens and KKBox datasets, demonstrating the practical utility of high-quality triple representations in downstream tasks.

Conclusion

Triple2Vec demonstrates that learning embeddings directly at the triple level is superior to assembling them from pre-trained node and edge vectors. Future work includes scaling the triple line graph construction for massive KGs and incorporating explicit entity types to further enrich the embedding space.

Summary updated

BibTeX
@inproceedings{fionda2020learning,
  author = {Valeria Fionda and Giuseppe Pirrò},
  title = {{Learning Triple Embeddings from Knowledge Graphs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i04.5800},
}
Figure