NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TFLEX: Temporal Feature-Logic Embedding Framework for Complex Reasoning over Temporal Knowledge Graph

Xueyuan Lin, Haihong E, Chengjin Xu, Gengxian Zhou, Haoran Luo, Tianyi Hu, Fenglong Su, Ningyuan Li, Mingzhi Sun

Introduction

Multi-hop logical reasoning over knowledge graphs plays a fundamental role in many artificial intelligence tasks. However, most real-world knowledge is dynamic, with facts changing over time. While static Knowledge Graphs (KGs) represent facts as simple triples (head, relation, tail), Temporal Knowledge Graphs (TKGs) add a critical fourth dimension: time.

Existing multi-hop reasoning methods, such as Query2box or BetaE, are designed primarily for static KGs. They struggle with TKGs because they cannot effectively answer temporal questions (e.g., "When did this event happen?") or handle temporal logic (e.g., "During the presidency of X, what happened after event Y?"). To bridge this gap, this paper introduces the Temporal Feature-Logic Embedding framework (TFLEX), the first framework specifically designed for multi-hop logical reasoning over TKGs. By combining a novel "feature-logic" embedding with fuzzy logic, TFLEX can answer complex queries involving both standard logical operators (AND, OR, NOT) and temporal constraints.

Methodology

The core innovation of TFLEX is its unified approach to representing both entities and timestamps as fuzzy sets in a shared embedding space.

Feature-Logic Embeddings

Unlike standard geometric embeddings that use a single vector, TFLEX represents every object (whether an entity, a query, or a timestamp) with a dual-part embedding:

  • Feature Part ($q_f$): A vector in $\mathbb{R}^d$ representing the semantic "center" of the object.
  • Logic Part ($q_l$): A vector in $[0, 1]^d$ representing uncertainty or the "width" of the set, adhering to fuzzy logic principles.

Fuzzy Logic Operators

TFLEX utilizes fuzzy logic to implement standard First-Order Logic (FOL) operations. For example, the AND operation is modeled as the element-wise multiplication of the logic parts. This allows the model to naturally handle negation and disjunction (unions), which are notoriously difficult for many traditional geometric embedding methods.

Temporal Reasoning

To handle the dimension of time, the authors extend their fuzzy logic framework to include three new temporal operators: After, Before, and Between. They treat a timestamp set as an interval. For instance, the After operator shifts the time feature and adjusts the logic part to represent all points following a given interval.

The computation of the time part for temporal operators Before and After.

Datasets and Experimental Setup

To evaluate TFLEX, the researchers generated three new large-scale datasets for temporal multi-hop reasoning, based on standard TKG completion benchmarks:

  • ICEWS14 and ICEWS05-15: Derived from the Integrated Crisis Early Warning System, focusing heavily on international political events.
  • GDELT-500: Based on the Global Database of Events, Language, and Tone.

These datasets encompass 40 different complex query patterns, ranging from simple relational projections to intricate combinations of temporal and logical constraints.

Key Insights

  • The Alignment Rule: A critical insight is that reasoning on TKGs requires aligning entity sets with their corresponding timestamp sets. When intersecting two entity sets, TFLEX also intersects their associated time intervals to ensure the final answer is temporally consistent.
  • Avoiding Semantic Conflict: The authors discovered that simply "plugging in" existing static KG embeddings (like the geometric ConE) into a temporal framework leads to poor performance due to "semantic conflict" between different embedding geometries. TFLEX’s unified fuzzy logic approach for both entities and time avoids this issue entirely.
  • Neural Temporal Operators: While FOL operators are fixed by fuzzy logic, the projection operators (moving from one entity to another via a relation) are learned via Multi-Layer Perceptrons (MLPs), allowing the model to capture complex, non-linear relationships in the data.

Key Results

TFLEX significantly outperformed state-of-the-art static query embedding baselines across all datasets and query types.

Average MRR results across different query groups and datasets.
  • Superior Accuracy: On the ICEWS14 dataset, TFLEX achieved an average Mean Reciprocal Rank (MRR) of 35.93, a substantial improvement over the adapted ConE baseline (30.13).
  • Out-of-Data Reasoning: TFLEX demonstrated a strong ability to generalize to "unseen" query structures (like unions) that were not present in the training set, proving the robustness of its fuzzy logic foundation.
  • Interpretability: The model successfully answers both entity-based queries (e.g., "Which countries did Xi Jinping visit?") and time-based queries (e.g., "When did this visit occur?") with high precision.

Limitations and Future Work

The authors acknowledge several areas for future improvement. Currently, the framework supports a limited temporal vocabulary of three operators; future work could incorporate more complex relations from Allen’s interval algebra (e.g., overlaps, starts, finishes). Additionally, timestamps are currently randomly initialized. Using positional embeddings or order-aware features could help the model better understand the linear nature of time. Finally, generating complex queries for training remains computationally expensive, suggesting a need for more efficient sampling strategies to scale to even larger TKGs.

Summary updated

BibTeX
@inproceedings{lin2023tflex,
  author = {Xueyuan Lin and Haihong E and Chengjin Xu and Gengxian Zhou and Haoran Luo and Tianyi Hu and Fenglong Su and Ningyuan Li and Mingzhi Sun},
  title = {{TFLEX: Temporal Feature-Logic Embedding Framework for Complex Reasoning over Temporal Knowledge Graph}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=oaGdsgB18L},
}
Figure