Time-aware Path Reasoning on Knowledge Graph for Recommendation

Yuyue Zhao, Xiang Wang, Jiawei Chen, Wei Tang, Yashen Wang, Xiangnan He, Haiyong XieACM Trans. Information Systems 2021 · DOI

TL;DR

This paper introduces TPRec, a novel method for explainable recommendation that leverages temporal information within knowledge graphs. By incorporating time-aware interactions, TPRec generates more relevant recommendations and provides more plausible explanations than existing methods that ignore temporal dynamics.

What Problem Does This Paper Address?

Traditional knowledge graph (KG)-based recommendation systems excel at providing explanations by tracing paths through the KG. However, these methods often treat user-item interactions as static, ignoring crucial temporal information like purchase times or recommendation timestamps. This oversight can lead to recommendations that are contextually inappropriate or explanations that lack real-world relevance, diminishing user trust and satisfaction. The paper aims to bridge this gap by developing a recommendation system that explicitly accounts for the temporal patterns of user behavior.

Methods

TPRec introduces a three-component approach:

  1. Time-aware Interaction Relation Extraction: This component constructs a Time-aware Collaborative Knowledge Graph (TCKG). It first extracts temporal statistical and structural features from interaction timestamps. These features are then used to cluster timestamps, effectively creating time-aware interaction relations that capture seasonal, monthly, or even daily patterns. This process transforms a static KG into a dynamic TCKG.
  2. Time-aware Representation Learning: Using the constructed TCKG, TPRec employs a TransE-based method to learn embeddings for entities and relations. This step ensures that both structural and temporal information are encoded into these representations.
  3. Time-aware Path Reasoning: This core component frames recommendation as a Markov Decision Process (MDP). A key innovation is the introduction of a personalized time-aware reward shaping mechanism. Instead of a binary reward, TPRec uses a soft reward function that considers the temporal relevance of a recommended item to the user's history and the recommendation time. This personalized reward guides a reinforcement learning agent to explore more relevant reasoning paths, leading to better recommendations and explanations. A bidirectional LSTM is used to encode the state history, capturing temporal dependencies in the reasoning process.

Datasets

The authors conducted experiments on three real-world e-commerce datasets from Amazon:

  • Clothing
  • Cell Phones
  • Beauty

These datasets were preprocessed to extract time-aware interaction relations, and standard 5-core versions were used.

Key Insights and Ideas

  • Temporal Context is Crucial for Explainability: Ignoring timestamps leads to recommendations that might be technically valid within a static KG but contextually irrelevant (e.g., recommending a "sweater" in summer).
  • Clustering Timestamps is Key: Directly using every timestamp is infeasible. Clustering them into meaningful temporal groups (seasons, months, etc.) allows for manageable and informative time-aware relations.
  • Personalized Temporal Rewards Drive Better Exploration: A generic reward signal is insufficient. Tailoring the reward based on a user's specific temporal interaction history and the recommendation context significantly improves the RL agent's ability to find relevant paths.
  • Structural Features Offer Robust Temporal Signals: While statistical features (like month/year) are useful, structural features (like trends in interaction frequency) appear to provide more stable and reliable signals for capturing user behavior similarity over time.

Key Results

  • Superior Performance: TPRec consistently outperformed state-of-the-art KG-based and sequence-based recommendation methods across all three datasets and evaluation metrics (NDCG, Recall, HR, Precision). For instance, on the Cell Phones dataset, TPRec showed significant improvements over baselines like PGPR.
  • Improved Explainability: Case studies demonstrated that TPRec's temporal reasoning led to more intuitive and contextually relevant explanations, such as recommending a "sweater" when the temporal context indicated "winter" and "cold."
  • Ablation Studies Highlight Contributions: Removing temporal features, personalized rewards, or the bidirectional LSTM encoder led to significant performance degradation, underscoring the importance of each component.
  • Parameter Sensitivity: The model showed robustness to variations in action space size and state history length, with optimal performance often achieved when time cluster quantity was adaptively determined.

Limitations and Future Work

  • Dataset Specificity: The performance gains of TPRec were more pronounced on datasets like Clothing and Cell Phones compared to Beauty, suggesting that the complexity and temporal dynamics of different domains can influence the method's effectiveness.
  • Next Item Prediction: The current TPRec is not directly designed for next-item prediction tasks in the same way as sequence-based models. Adapting it for this purpose, possibly by constructing dynamic edge masks on the KG, is a future direction.
  • Adversarial Learning for Rewards: The authors plan to explore adversarial learning to automatically shape rewards, aiming for even more accurate recommendations.
  • Causal Inference: Integrating causal inference is proposed as a way to achieve better interpretability.
  • Broader Evaluation: Evaluating TPRec on more datasets from diverse product domains and online vendors is suggested.

Summary updated

BibTeX
@article{zhao2021time,
  author = {Yuyue Zhao and Xiang Wang and Jiawei Chen and Wei Tang and Yashen Wang and Xiangnan He and Haiyong Xie},
  title = {{Time-aware Path Reasoning on Knowledge Graph for Recommendation}},
  journal = {ACM Trans. Information Systems},
  year = {2021},
  doi = {10.1145/3531267},
}
Figure