Abstract
Research on link prediction in knowledge graphs has mainly focused on static multi-relational data. In this work we consider temporal knowledge graphs where relations between entities may only hold for a time interval or a specific point in time. In line with previous work on static knowledge graphs, we propose to address this problem by learning latent entity and relation type representations. To incorporate temporal information, we utilize recurrent neural networks to learn time-aware representations of relation types which can be used in conjunction with existing latent factorization methods. The proposed approach is shown to be robust to common challenges in real-world KGs: the sparsity and heterogeneity of temporal expressions. Experiments show the benefits of our approach on four temporal KGs.
Introduction
Knowledge Graphs (KGs) such as Wikidata or YAGO typically represent facts as static triples $(s, p, o)$. However, many real-world facts are inherently temporal. For instance, the fact that Barack Obama was the President of the United States is only valid for a specific time interval. Traditional link prediction models often treat KGs as static, ignoring these temporal constraints.
Temporal Knowledge Graph Completion (TKGC) faces two primary challenges:
- Sparsity: The continuous nature of time leads to an infinite number of possible timestamps, making it impractical to learn unique embeddings for every discrete point in time.
- Heterogeneity: Temporal data is often represented inconsistently, ranging from specific years to complex intervals like "occursSince" or "occursUntil".
This paper proposes a sequence-based encoding method that treats timestamps as sequences of digits, allowing models to generalize across time and handle unseen dates.
Methodology
The core innovation of this work is the use of a Recurrent Neural Network (RNN), specifically a Long Short-Term Memory (LSTM) network, to encode temporal expressions into "time-aware" relation representations.
Predicate Sequences
Instead of treating a relation as a single atomic unit, the authors construct a predicate sequence. A fact like (Barack Obama, bornIn, US, 1961) is transformed into a sequence: [bornIn, 1y, 9y, 6y, 1y]. This sequence includes the base relation, temporal modifiers, and the individual digits of the timestamp.
LSTM Encoder
The predicate sequence is fed into an LSTM. The final hidden state of the LSTM, $e_{p_{seq}}$, serves as the time-aware embedding for the relation.
By processing digits individually, the model shares parameters across different years (e.g., "1998" and "1999" share the same prefix), creating an inductive bias that captures chronological proximity. This approach also allows the model to generate embeddings for dates not seen during training, provided it has learned the representations for the digits 0-9.
Integration with Scoring Functions
The time-aware embedding $e_{p_{seq}}$ can be integrated into standard KG completion frameworks. The authors evaluate this approach using TransE (a distance-based model) and DistMult (a latent factor model), creating "Time-Aware" (TA) variants: TA-TransE and TA-DistMult.
Experimental Results
The models were evaluated on four temporal datasets, including ICEWS 2014 and ICEWS 2005-15. The experimental results demonstrate that incorporating temporal sequences significantly improves performance over static baselines and existing temporal models.
As shown in the table above, TA-DistMult and TA-TransE consistently outperform their static counterparts and the TTransE baseline. Notably, on the ICEWS datasets, the TA-variants achieve superior Mean Reciprocal Rank (MRR) and Hits@10. The ability to generalize across sparse timestamps is a key advantage of the digit-level encoding.
Key Insights
- Inductive Bias: Breaking years into digits allows the model to naturally learn that facts in the same decade or century are semantically related.
- Memory Efficiency: The "temporal vocabulary" is extremely small (32 tokens), making the model much more memory-efficient than those requiring unique embeddings for every timestamp.
- Handling Unseen Dates: Because the model encodes digits, it can generate a representation for any date as long as it has seen the individual digits 0-9 before.
Conclusion
This paper presents a robust method for Temporal Knowledge Graph Completion by encoding timestamps as sequences of digits using an LSTM. This approach effectively addresses the issues of sparsity and heterogeneity in temporal data. Future work could explore extending this digit-level logic to other numerical attributes in KGs, such as population counts or geographic coordinates, which face similar representation challenges.
Summary updated