Metapath- and Entity-aware Graph Neural Network for Recommendation

Zhiwei Han, Muhammad Umer Anwaar, Shyam Arumugaswamy, Thomas Weber, Tianming Qiu, Hao Shen, Yuanting Liu, Martin KleinsteuberarXiv 2020

Abstract: In graph neural networks (GNNs), message passing iteratively aggregates nodes' information from their direct neighbors while neglecting the sequential nature of multi-hop node connections. Such sequential node connections e.g., metapaths, capture critical insights for downstream tasks. Concretely, in recommender systems (RSs), disregarding these insights leads to inadequate distillation of collaborative signals. In this paper, we employ collaborative subgraphs (CSGs) and metapaths to form metapath-aware subgraphs, which explicitly capture sequential semantics in graph structures. We propose metapath and Entity-Aware Graph Neural Network (PEAGNN), which trains multilayer GNNs to perform metapath-aware information aggregation on such subgraphs. This aggregated information from different metapaths is then fused using attention mechanism. Finally, PEAGNN gives us the representations for node and subgraph, which can be used to train MLP for predicting score for target user-item pairs. To leverage the local structure of CSGs, we present entity-awareness that acts as a contrastive regularizer on node embedding. Moreover, PEAGNN can be combined with prominent layers such as GAT, GCN and GraphSage. Our empirical evaluation shows that our proposed technique outperforms competitive baselines on several datasets for recommendation tasks. Further analysis demonstrates that PEAGNN also learns meaningful metapath combinations from a given set of metapaths.

Introduction

In modern recommender systems, user-item interactions and side information (like user profiles or item attributes) are often modeled as Heterogeneous Information Networks (HINs). Graph Neural Networks (GNNs) are highly effective at learning from these graphs, but standard GNNs aggregate information from all immediate neighbors simultaneously. This approach often mixes the distinct, sequential semantics of multi-hop connections—known as metapaths (e.g., User $\rightarrow$ Movie $\rightarrow$ Director $\rightarrow$ Movie).

While some recent models try to incorporate metapaths, they typically do so by explicitly reconstructing every single path instance, leading to unaffordable memory consumption. Furthermore, existing GNN-based recommenders often suffer from over-smoothing and fail to explicitly enforce the structural proximity between users/items and their specific feature entities in the embedding space.

The PEAGNN Framework

To address these challenges, the authors propose PEAGNN (MetaPath and Entity-Aware Graph Neural Network). The architecture is designed to capture rich sequential semantics and local graph structures without the massive memory overhead of prior methods.

Overview of the PEAGNN architecture, showing the four main stages from subgraph generation to prediction.

PEAGNN consists of several key architectural steps:

  1. Collaborative Subgraphs (CSGs): Instead of operating on the entire massive graph, the model extracts an $h$-hop enclosing subgraph centered around a target user-item pair.
  2. Metapath-Aware Subgraphs: The CSG is decomposed into several directed subgraphs, each representing a specific metapath schema (e.g., one subgraph only contains User-Movie-User links).
  3. Step-wise Propagation: Rather than explicitly listing all paths, PEAGNN runs standard GNN layers "on the fly" over these isolated metapath subgraphs.
  4. Attention Fusion: A soft attention mechanism learns the importance of each metapath for a specific node, fusing the representations together.
  5. Entity-Awareness Regularization: To preserve local graph structure, a contrastive loss term pulls user/item nodes closer to their connected feature entities (e.g., a specific genre or actor) in the embedding space, while pushing them away from unconnected ones.

Step-wise Propagation Detail

The core technical novelty lies in how the model processes sequential semantics. By performing message passing step-by-step along the metapath schema, the model avoids the combinatorial explosion of path enumeration while maintaining the order of node types.

Detailed view of the step-wise propagation mechanism for a specific metapath.

Experimental Evaluation

The authors evaluated PEAGNN on three standard benchmark datasets of varying sizes and sparsity: MovieLens-small (~100k ratings), MovieLens-25M (~25 million ratings), and Yelp (~10 million interactions). PEAGNN variants (PEAGCN, PEAGAT, PEASage) were compared against 9 strong baselines, including KGAT, NGCF, and LightGCN.

Key Results

  • Performance Gains: On MovieLens-small, PEASage achieved a 7.87% improvement in NDCG@10 and a 7.25% improvement in Hit Ratio (HR@10) over the best competitor. On Yelp, PEAGAT improved NDCG@10 by 8.23%.
  • Ablation on Entity-Awareness: Removing the contrastive regularizer consistently dropped performance across all datasets. The drop was most severe on the sparse ML-small dataset (up to a 1.9% drop in HR@10), proving its utility in low-data regimes.

Insights and Future Work

  • Explicit Modeling vs. Message Mixing: By separating message passing into distinct metapath subgraphs, the model prevents the "washing out" of specific sequential semantics. Knowing how two nodes are connected is as important as knowing that they are connected.
  • Interpretability through Attention: Because the model uses attention to fuse metapaths, we can analyze what drives recommendations. Ablation studies showed that the "Year-Movie-User" metapath was highly dominant in some cases, indicating that release year heavily influences user choices.

Limitations and Future Work: The framework currently relies on a predefined set of metapaths. While the attention mechanism weights them, the initial selection requires manual domain knowledge. Future work may involve automated metapath selection and leveraging the interpretable nature of the attention weights for explainable AI research.

Summary updated

BibTeX
@misc{han2020metapath,
  author = {Zhiwei Han and Muhammad Umer Anwaar and Shyam Arumugaswamy and Thomas Weber and Tianming Qiu and Hao Shen and Yuanting Liu and Martin Kleinsteuber},
  title = {{Metapath- and Entity-aware Graph Neural Network for Recommendation}},
  year = {2020},
  eprint = {2010.11793},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.11793},
}
Figure