Self-Exploring Language Models for Explainable Link Forecasting on Temporal Graphs via Reinforcement Learning

Zifeng Ding, Shenyang Huang, Zeyu Cao, Emma Kondrup, Zachary Yang, Xingyue Huang, Yuan Sui, Zhangdie Yuan, Yuqicheng Zhu, Xianglong Hu, Yuan He, Farimah Poursafaei, Michael M. Bronstein, Andreas Vlachos · DOI

Introduction

Temporal Graphs (TGs) are essential for modeling dynamic real-world interactions, such as social network evolutions, financial transactions, and transportation logistics. Traditionally, link forecasting in these domains has been dominated by Temporal Graph Neural Networks (TGNNs). While effective, TGNNs operate as "black boxes," providing numerical probabilities without human-interpretable reasoning. Furthermore, they often struggle with generalization, requiring extensive retraining when applied to new, unseen graph structures.

To address these limitations, researchers have introduced ReaL-TG (Reasoning-Enhanced Learning for Temporal Graphs). This framework leverages Large Language Models (LLMs) to perform link forecasting through structural reasoning rather than semantic memorization. By employing reinforcement learning (RL), ReaL-TG enables relatively small models (e.g., 4-billion parameters) to outperform significantly larger models and traditional neural networks while providing faithful, logical explanations for their predictions.

The ReaL-TG Framework

The ReaL-TG framework is designed to bridge the gap between graph topology and natural language reasoning. It consists of three primary components: Temporal Context Graph Selection, Reinforcement Learning via GRPO, and an automated evaluation system.

The ReaL-TG framework overview, illustrating the pipeline from graph selection to RL-based optimization and LLM-as-a-Judge evaluation.

1. Temporal Context Graph Selection (T-CGS)

Feeding an entire massive graph into an LLM is computationally infeasible. T-CGS utilizes an "$\alpha$-temporal random walk" to extract a concise, relevant subgraph. This method prioritizes nodes that are topologically and temporally proximate to the query, ensuring the LLM receives the most informative context within its token limits.

2. Reinforcement Learning via GRPO

Instead of relying on expensive, human-annotated reasoning chains for supervised fine-tuning, ReaL-TG uses Grouped Regularized Policy Optimization (GRPO). The model is trained using an outcome-based reward system—specifically the F1 score of its link predictions. This encourages the model to "self-explore" and refine its internal logic to reach the correct answer. During this process, the model learns to identify critical patterns, such as interaction recency and recurring motifs, without explicit instruction.

3. Reasoning and Instruction Tuning

To ensure the model follows a structured thought process, the authors implemented a specific prompting strategy. The model is instructed to provide an internal monologue within <think> tags before delivering a final answer in <answer> tags. This "Chain-of-Thought" approach is critical for both the RL optimization and the eventual explainability of the model's output.

The instruction and prompt format used to guide the LLM through temporal graph reasoning tasks.

Experimental Evaluation

The study utilized anonymized datasets from the Temporal Graph Benchmark (TGB), including wiki, subreddit, coin, and flight for training, and uci and enron for zero-shot evaluation. By using numerical IDs instead of semantic names, the researchers ensured the model reasoned based on graph structure rather than pre-trained factual knowledge.

Key Results

  • Superior Performance: The fine-tuned Qwen3-4B (ReaL-TG-4B) achieved an overall Mean Reciprocal Rank (MRR) of 0.552, surpassing Llama-3.3-70B (0.521) and GPT-4o mini (0.456). This demonstrates that specialized RL training can be more effective than raw parameter scale for specific reasoning tasks.
  • Robust Generalization: On unseen datasets (uci and enron), ReaL-TG-4B maintained its performance lead, proving that the learned reasoning strategies are transferable across different network types.
  • High-Quality Explanations: Using an LLM-as-a-Judge system, the authors found that ReaL-TG-4B’s reasoning traces scored high on faithfulness (0.885) and logical consistency (0.872), matching human assessments.
  • The Reasoning Floor: The researchers noted that very small models (e.g., 0.6B) struggled with "reward hacking," often claiming to see answers in the context that weren't there. This suggests a minimum capacity threshold is required for effective self-exploring RL.

Conclusion and Future Work

ReaL-TG demonstrates that LLMs can be transformed into powerful, explainable tools for temporal graph analysis. By moving away from black-box TGNNs toward self-exploring reasoning models, the framework provides both accuracy and transparency. Future work will focus on expanding the context window to capture longer-range dependencies and applying the framework to larger base models to further reduce hallucinations and improve complex multi-hop reasoning.

Summary updated

BibTeX
@inproceedings{ding2025self,
  author = {Zifeng Ding and Shenyang Huang and Zeyu Cao and Emma Kondrup and Zachary Yang and Xingyue Huang and Yuan Sui and Zhangdie Yuan and Yuqicheng Zhu and Xianglong Hu and Yuan He and Farimah Poursafaei and Michael M. Bronstein and Andreas Vlachos},
  title = {{Self-Exploring Language Models for Explainable Link Forecasting on Temporal Graphs via Reinforcement Learning}},
  booktitle = {NPGML @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=p30azkwIer},
}
Figure