Updating Embeddings for Dynamic Knowledge Graphs

Christopher Wewer, Florian Lemmerich, Michael CochezarXiv 2021

Abstract

Knowledge Graphs (KGs) are dynamic entities, yet most embedding techniques treat them as static snapshots, requiring a full, costly retraining every time a new node or edge appears. This paper introduces an efficient update strategy that combines "smart" initialization for new entities with "change-specific" training epochs. This approach maintains high-quality link prediction performance while running up to five times faster and offering significantly better vector stability than retraining from scratch.

Introduction

Knowledge Graphs—such as DBpedia or those powering modern search engines—are dynamic by nature; new facts are added, and old ones are corrected or deleted. To utilize this data in machine learning, entities and relations are typically "embedded" into high-dimensional vectors.

The current standard approach treats the KG as a static snapshot. When the graph changes, researchers usually recompute the entire embedding from scratch. This presents two major hurdles:

  1. Computational Cost: Retraining on massive graphs is slow and resource-intensive.
  2. Instability: Every time a model is retrained from scratch, the resulting vectors can end up in completely different parts of the vector space. This "jitter" breaks downstream models that rely on consistent coordinate values.

This research seeks a way to update embeddings incrementally without sacrificing the accuracy of link prediction.

Methodology

The proposed "Online Method" for updating embeddings consists of a two-stage process:

1. Smart Initialization

Instead of placing new entities randomly, the method uses the existing embeddings of their neighbors to find a "best-fit" starting position. While analytical global optima (calculating the mathematical center) were tested, numerical optimization (mini-pre-training for new nodes while keeping the rest of the graph fixed) proved superior. This is because numerical optimization accounts for "negative evidence," ensuring new nodes are not just near their neighbors but also distant from unrelated entities.

2. Change-Specific Epochs

Once new nodes are initialized, the model undergoes training epochs focusing specifically on the added and deleted triples. To prevent the model from "forgetting" the existing graph structure or over-biasing toward recent changes, these change-specific epochs are interleaved with a small number of general epochs that sample the entire training set.

Visualization of the sets of triples involved in an update from time $t$ to $t+1$. $\Delta E^-$ represents deleted triples, while $\Delta E^+$ represents added triples.

The approach was evaluated across six different embedding models, including Translational Distance models (e.g., TransE, TransH) and Semantic Matching models (e.g., DistMult, RESCAL).

Experimental Setup

The researchers evaluated their approach on four distinct datasets:

  • Synthetic FB15K: A version of the Freebase dataset modified to simulate 20 consecutive snapshots of growth and deletion.
  • NELL (Never-Ending Language Learner): A real-world knowledge base incrementally populated by web crawling.
  • MathOverflow: A temporal interaction graph representing a data stream use case.
  • Higgs Twitter: A large-scale dataset used to test scalability.

Key Results and Insights

Performance and Speed

On the large-scale Higgs Twitter dataset, the online update method was 3x to 5x faster than full retraining. For example, updating a TransH model took approximately 54 minutes compared to 3.6 hours for a full recalculation. In almost all cases, the link prediction quality (measured by Mean Reciprocal Rank) remained nearly identical to embeddings recomputed from scratch.

Vector Stability

One of the most striking findings is that updating an embedding is much more stable than recalculating it. Recalculated embeddings showed 10–20x more "jitter" (measured by Normalized Mean Change) than the updated ones. This stability is crucial for production environments where downstream models require consistent inputs.

The "Negative Evidence" Paradox

The authors found that placing a new node at its mathematically "optimal" spot based solely on its links actually hurts performance (specifically Hits@10). Without considering negative samples during initialization, new nodes often end up in "crowded" areas of the vector space where they are easily mistaken for other entities.

Conclusion and Future Work

The proposed update strategy works exceptionally well for Translational models but faces more challenges with Semantic Matching models like RESCAL, which are more sensitive to global structure. Future work includes automating hyperparameter tuning for change-specific epochs and moving toward a truly "streaming" embedding system that updates triple-by-triple in real-time.

Summary updated

BibTeX
@misc{wewer2021updating,
  author = {Christopher Wewer and Florian Lemmerich and Michael Cochez},
  title = {{Updating Embeddings for Dynamic Knowledge Graphs}},
  year = {2021},
  eprint = {2109.10896},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.10896},
}
Figure