Abstract
Knowledge graph (KG) embedding encodes the entities and relations from a KG into low-dimensional vector spaces to support various applications such as KG completion, question answering, and recommender systems. In real world, knowledge graphs (KGs) are dynamic and evolve over time with addition or deletion of triples. However, most existing models focus on embedding static KGs while neglecting dynamics. To adapt to the changes in a KG, these models need to be retrained on the whole KG with a high time cost. In this paper, to tackle the aforementioned problem, we propose a new context-aware Dynamic Knowledge Graph Embedding (DKGE) method which supports the embedding learning in an online fashion. DKGE introduces two different representations (i.e., knowledge embedding and contextual element embedding) for each entity and each relation, in the joint modeling of entities and relations as well as their contexts, by employing two attentive graph convolutional networks, a gate strategy, and translation operations. This effectively helps limit the impacts of a KG update in certain regions, not in the entire graph, so that DKGE can rapidly acquire the updated KG embedding by a proposed online learning algorithm. Furthermore, DKGE can also learn KG embedding from scratch. Experiments on the tasks of link prediction and question answering in a dynamic environment demonstrate the effectiveness and efficiency of DKGE.
The Challenge of Dynamic Knowledge Graphs
Knowledge Graphs (KGs) are foundational to modern AI, powering everything from search engines to recommendation systems. However, these graphs are rarely static; they evolve constantly as new facts emerge and old ones become obsolete.
Traditional KG embedding models are designed for static snapshots. When the graph changes, these models suffer from a "chain reaction" problem: because entities are highly interconnected, a single update can necessitate adjusting vectors across the entire system. Consequently, practitioners are often forced to retrain models from scratch—a process that is computationally expensive and slow for large-scale, frequently updated graphs.
DKGE: A Context-Aware Architecture
To address this, researchers developed DKGE (Dynamic Knowledge Graph Embedding). The core innovation lies in its dual-representation system and the use of attentive graph neural networks.
DKGE relies on three main pillars:
- Dual Representations: Every entity and relation is assigned two distinct vectors: a knowledge embedding (representing the object itself) and a contextual element embedding (representing its role within its local neighborhood).
- Attentive Graph Convolutional Networks (AGCNs): DKGE uses AGCNs to encode the "context" of an entity or relation into a single subgraph embedding. The attention mechanism allows the model to prioritize significant neighbors.
- Gate Strategy: A gating mechanism merges the "self" knowledge and "contextual" information into a final joint representation ($h^*, r^*, t^*$) used for downstream tasks like link prediction.
Online Learning for Rapid Updates
The primary advantage of DKGE is its ability to perform online updates. Instead of retraining the entire graph, DKGE identifies "affected regions"—triples involving new entities or those whose local neighborhoods have changed.
By freezing the parameters of the AGCNs and the embeddings of unchanged regions, the model retrains only the necessary subset. This "quarantines" the impact of updates, preventing the chain reaction that plagues static models. This approach effectively limits the impacts of a KG update to specific regions rather than the entire graph.
Key Results and Insights
The effectiveness of DKGE was tested on several new dynamic datasets, including YAGO-3SP and IMDB-30SP.
- Efficiency: DKGE achieved a 6x to 20x speedup in updates compared to retraining from scratch. On a large IMDB dataset, an update that would normally take a week was completed in just two hours.
- Effectiveness: Despite the speed, the online version (DKGE-OL) maintained accuracy nearly identical to the "from-scratch" version and significantly outperformed existing dynamic baselines like puTransE.
- Handling Complexity: By incorporating context, DKGE better handles "1-to-N" relationships (e.g., one director for many movies), as the contextual embeddings of the tail entities remain distinct even if the relation is the same.
Conclusion
DKGE represents a significant step forward in making knowledge graph embeddings practical for real-world, evolving data. By separating intrinsic knowledge from local context, it enables rapid, accurate updates that scale to massive datasets. Future work will focus on mitigating "underfitting accumulation" over long sequences of updates and exploring continual learning to prevent catastrophic forgetting.
Summary updated