RECIPE-TKG: From Sparse History to Structured Reasoning for LLM-based Temporal Knowledge Graph Completion

Ömer Faruk Akgül, Feiyu Zhu, Yuxin Yang, Rajgopal Kannan, Viktor Prasanna

TL;DR

This paper introduces RECIPE-TKG, a novel framework that significantly improves the ability of Large Language Models (LLMs) to complete Temporal Knowledge Graphs (TKGs). By employing a structured approach to history sampling, contrastive fine-tuning, and test-time filtering, RECIPE-TKG achieves state-of-the-art performance, especially in challenging scenarios with limited historical data.

What Problem Does This Paper Address?

Temporal Knowledge Graphs (TKGs) represent dynamic facts as relationships between entities over time. A key task is TKG completion, which involves predicting missing or future links. While LLMs have shown promise for this, existing methods often struggle, particularly when historical information is sparse or indirect. The authors identify three main failure modes: (1) current retrieval strategies miss crucial multi-hop connections, (2) standard fine-tuning leads to memorization rather than true relational reasoning, and (3) LLM outputs can be contextually implausible. RECIPE-TKG aims to overcome these limitations by providing a more principled and task-specific approach to LLM-based TKG completion.

Methods

RECIPE-TKG is a three-stage framework:

  1. Rule-Based Multi-Hop History Sampling (RBMH): This stage goes beyond simple 1-hop neighborhood retrieval. It uses a two-phase strategy: first, rule-based retrieval to capture relational patterns, and second, context-guided expansion to identify structurally diverse and temporally relevant facts, even those not directly connected to the query. This aims to provide richer grounding for reasoning.
  2. Contrastive Fine-Tuning (CFT): Instead of just predicting the correct next token, this method trains lightweight adapters (using LoRA) to explicitly learn to differentiate between semantically plausible and implausible entity completions. It uses a contrastive loss that pulls positive examples closer and pushes negative examples farther apart in the embedding space, fostering relational generalization.
  3. Similarity-Based Test-Time Filtering: At inference time, this component filters out predictions that lack semantic alignment with the input context. It uses a sentence transformer to compute similarity scores and accepts predictions that exceed a learned threshold or are already present in the history. If multiple generations fail, it falls back to a history-aware scoring mechanism.

Datasets

The authors evaluate RECIPE-TKG on four standard temporal knowledge graph benchmarks:

  • ICEWS14
  • ICEWS18
  • GDELT
  • YAGO

These datasets represent geopolitical events, global political events, and curated facts, with varying time granularities. No new datasets were introduced.

Key Insights and Ideas

  • The importance of multi-hop reasoning: Standard 1-hop retrieval is insufficient for many TKG completion tasks, especially when historical context is sparse. RECIPE-TKG's RBMH sampling effectively addresses this by exploring deeper graph structures.
  • Contrastive learning for relational generalization: Simply fine-tuning LLMs on next-token prediction leads to memorization. Contrastive fine-tuning reshapes the embedding space to better capture relational semantics, improving generalization to unseen or indirectly connected entities.
  • Test-time filtering is crucial for plausibility: Even with improved retrieval and training, LLMs can still generate contextually implausible outputs. Semantic similarity filtering acts as a vital safety net to ensure generated entities are semantically aligned with the input.
  • Robustness across history lengths: RECIPE-TKG consistently outperforms baselines not only in sparse history settings but also with longer contexts, demonstrating the combined benefits of its components.

Key Results

  • RECIPE-TKG achieves state-of-the-art results on four benchmark datasets, with relative improvements in Hits@10 ranging from 8% to 30.6% (on ICEWS18).
  • On ICEWS14 and YAGO, RECIPE-TKG sets new performance records, with up to 11.9% relative improvement over competing methods.
  • The framework produces more semantically coherent predictions, especially for samples with limited historical context.
  • Ablation studies show that each component (RBMH sampling, contrastive fine-tuning, and test-time filtering) contributes significantly to the overall performance.

Limitations and Future Work

  • Clean, fully observed TKGs: The current framework assumes complete and accurate historical data. Real-world scenarios often involve incomplete or noisy information, which future work could address.
  • Offline rule mining: The rule mining step for RBMH is performed offline and needs to be repeated if the TKG changes.
  • Dynamic updates: The framework assumes static TKGs. Future research could explore designs that support dynamic updates and reasoning under partially observed histories.
  • Use of AI Tools: The authors acknowledge using AI assistants for writing and code generation, with all outputs subject to human verification.

Summary updated

BibTeX
@inproceedings{akgul2026recipe,
  author = {Ömer Faruk Akgül and Feiyu Zhu and Yuxin Yang and Rajgopal Kannan and Viktor Prasanna},
  title = {{RECIPE-TKG: From Sparse History to Structured Reasoning for LLM-based Temporal Knowledge Graph Completion}},
  booktitle = {EACL (Volume 1: Long Papers)},
  year = {2026},
  doi = {10.18653/v1/2026.eacl-long.86},
}
Figure