ParaGraphE: A Library for Parallel Knowledge Graph Embedding

Xiao-Fan Niu, Wu-Jun LiarXiv 2017

Abstract

Knowledge Graph Embedding (KGE) is a critical technique for link prediction and knowledge graph completion. However, the computational cost of training these models on large-scale graphs is significant. We present ParaGraphE, an open-source library that parallelizes popular KGE models using a lock-free framework. Our results demonstrate that ParaGraphE achieves nearly linear speedups—up to 8x on 10 cores—while maintaining the convergence properties and accuracy of the original algorithms.

1. Introduction

Knowledge Graphs (KGs) represent factual information as triples of $(head, relation, tail)$. As KGs grow to encompass millions of entities, Knowledge Graph Embedding (KGE) has emerged as a standard method to map these discrete components into continuous low-dimensional vector spaces. While effective for downstream tasks like link prediction, the training process for KGE models is often a bottleneck due to its sequential nature in standard implementations. ParaGraphE addresses this by providing a unified, high-performance parallel framework for training KGE models.

2. Methodology

ParaGraphE is built upon a unified parallel learning framework that supports various translation-based models, including TransE, TransH, TransR, and TransD.

2.1 Unified Loss Function

Most KGE models aim to minimize a margin-based ranking loss that encourages "golden" (true) triples to have higher scores than "corrupted" (fake) triples by at least a margin $\gamma$. ParaGraphE abstracts this training objective, allowing different models to be implemented by simply defining their specific score functions.

2.2 Lock-Free Parallelism

To maximize throughput, ParaGraphE employs an asynchronous stochastic gradient descent (SGD) approach, similar to the "Hogwild!" algorithm. Multiple threads update the shared entity and relation embeddings simultaneously without using mutexes or locks. This strategy is particularly effective for KGE because updates are sparse; each triple update only affects a tiny fraction of the total parameters, minimizing the impact of race conditions on model convergence.

3. Experimental Evaluation

We evaluated ParaGraphE on two benchmark datasets: WN18 (WordNet subset) and FB15k (Freebase subset).

3.1 Convergence and Efficiency

A key concern with asynchronous updates is whether they degrade convergence. As shown in Figure 1, while increasing the number of threads significantly reduces the CPU time required for training, the loss per epoch remains remarkably consistent across different thread counts.

Convergence analysis: (a) epoch loss vs. time shows significant speedup as threads increase; (b) epoch loss vs. number of epochs shows identical convergence behavior regardless of parallelism.

3.2 Speedup Performance

ParaGraphE demonstrates strong scalability. On both WN18 and FB15k, the library achieves near-linear speedup. With 10 CPU cores, the system reaches approximately an 8x speedup compared to a single-threaded execution, closely following the ideal linear scaling curve.

Speedup results for WN18 and FB15k datasets. ParaGraphE achieves near-ideal linear speedup up to 10 cores.

4. Conclusion

ParaGraphE provides a robust and efficient solution for accelerating KGE training. By leveraging the inherent sparsity of knowledge graph updates, the library achieves significant speedups without sacrificing model precision. Future work will involve extending the framework to support a wider variety of embedding models and exploring distributed multi-node scaling.

Source Code: The library is available on GitHub at LIBBLE/ParaGraphE.

Summary updated

BibTeX
@misc{niu2017paragraphe,
  author = {Xiao-Fan Niu and Wu-Jun Li},
  title = {{ParaGraphE: A Library for Parallel Knowledge Graph Embedding}},
  year = {2017},
  eprint = {1703.05614},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1703.05614},
}
Figure