Introduction
Recommendation systems have evolved from simple collaborative filtering to complex reasoning over Knowledge Graphs (KGs). However, most path-based models treat the KG as a static entity, failing to capture the "why" behind the timing of a purchase. For instance, a static model might explain a phone case purchase by noting that similar users bought it, missing the crucial temporal intent: the user bought the case specifically because they just purchased a new smartphone.
TMER (Temporal Meta-path Guided Explainable Recommendation) bridges this gap. It explicitly models the paths between consecutive items in a user's history, using attention mechanisms to provide both high-accuracy suggestions and human-readable temporal explanations. By unifying sequential modeling with KG-based reasoning, TMER captures dynamic user evolution more effectively than traditional "black box" sequential models (like RNNs) or static path-based models.
Methodology
The TMER framework follows a four-stage architecture designed to integrate temporal dynamics into a heterogeneous information network:
- Initialization: The model uses DeepWalk on a user-item bipartite network to generate initial latent representations (embeddings) for all entities.
- Meta-path Extraction: Instead of focusing solely on user-item connections, TMER mines item-item meta-path instances (e.g., $Item \to Brand \to Item$ or $Item \to Category \to Item$) between consecutive purchases. A similarity-based sampling method is used to select the most relevant paths for efficiency.
- Combinational Feature Learning: Recognizing that a purchase can have multiple drivers (e.g., brand loyalty and color preference), TMER employs multi-head self-attention to learn the relative importance of different path instances.
- Temporal Updating: The model uses a two-layer attention mechanism to update item representations. It propagates information from the previous item and the connecting path into the current item’s embedding, creating a "memory" of the user's journey without the computational overhead of Recurrent Neural Networks (RNNs).
The final prediction is generated via a Multi-Layer Perceptron (MLP) that concatenates user, item, and path features to estimate the probability of the next interaction.
Key Insights and Results
The core innovation of TMER lies in treating item-item paths as sequential signals. These paths naturally capture dependencies like complementarity (e.g., buying a microphone pop filter before a cable) or substitution.
Performance Evaluation
The model was evaluated on three real-world Amazon datasets: Musical Instruments, Automotive, and Toys and Games. TMER significantly outperformed state-of-the-art baselines, including GRU4Rec and MCRec:
- Accuracy: On the Toys and Games dataset, TMER improved the Hit Ratio (HR@5) by 8% compared to the next best baseline.
- Ranking: Improvements in NDCG (Normalized Discounted Cumulative Gain) were consistent across all categories, proving TMER's superior ability to rank the "correct" item at the top of the list.
- Explainability: By analyzing the attention weights assigned to specific meta-paths, the system can generate reasons for its recommendations. If a $Item \to Category \to Item$ path has the highest weight, the system can explain the recommendation based on category consistency.
Conclusion and Future Work
TMER demonstrates that integrating temporal meta-paths into recommendation logic enhances both accuracy and transparency. While highly effective, the model currently relies on manually defined meta-path schemas, which require domain expertise. Future research directions include automating meta-path discovery, integrating Natural Language Generation (NLG) to translate paths into natural sentences, and exploring causality learning to move from correlation-based to cause-and-effect explanations.
Summary updated