Knowledge-Enhanced Hierarchical Graph Transformer Network for Multi-Behavior Recommendation

Lianghao Xia, Chao Huang, Yong Xu, Peng Dai, Xiyue Zhang, Hongsheng Yang, Jian Pei, Liefeng Bo

Abstract

Modern recommendation systems often struggle to capture the complexity of multi-behavior data and the rich semantic relationships between items. We present the Knowledge-Enhanced Hierarchical Graph Transformer (KHGT), a framework that integrates temporal dynamics and item-side knowledge graphs. By utilizing a hierarchical architecture to model specific behaviors and their inter-dependencies, KHGT significantly improves recommendation accuracy and ranking quality. Our experiments on three real-world datasets demonstrate that KHGT consistently outperforms state-of-the-art baselines, particularly in data-sparse scenarios.

Introduction

Real-world user journeys are rarely monolithic. Before a purchase, a user typically engages in a series of interactions such as clicking, favoriting, or adding items to a cart. Most existing recommendation engines focus solely on the "target" behavior, failing to leverage the predictive power of these auxiliary actions. Furthermore, items are part of a broader semantic web of categories and brands that can inform recommendations. KHGT addresses these challenges by modeling multi-behavior inter-dependencies, integrating external knowledge graphs, and accounting for the temporal order and timing of user actions.

Methodology

KHGT employs a two-stage approach to learn sophisticated user and item representations.

Attentive Heterogeneous Message Aggregation

The framework represents users and items as nodes in a heterogeneous graph. It utilizes a Graph Transformer with a multi-head attention mechanism to propagate information, allowing the model to learn the relative importance of different neighboring nodes.

  • Temporal Encoding: KHGT uses sinusoidal functions to map timestamps into the embedding space, enabling the model to capture the temporal decay and periodic patterns of user behaviors.
  • Global Context Channels: To maintain parameter efficiency, a gating mechanism shares global behavior patterns across different interaction types.

Behavior Hierarchical Dependency Modeling

After learning individual behavior representations, KHGT uses a Mutual Attention Encoder to explicitly model the relationships between behaviors (e.g., the correlation between "add-to-cart" and "purchase"). This hierarchical structure allows the model to capture a richer signal of user intent.

The KHGT architecture features multi-behavior interaction graphs, attentive message aggregation, and hierarchical dependency modeling.

To handle large-scale datasets, the authors implement a random-walk-based sub-graph sampling strategy, ensuring the model remains computationally feasible.

Experimental Results

KHGT was evaluated on three diverse datasets: Yelp, MovieLens (ML10M), and Online Retail.

Performance and Ranking

KHGT consistently outperformed state-of-the-art baselines such as NGCF and MBGCN. On the Online Retail dataset, KHGT achieved a Hit Ratio (HR@10) of 0.464, a significant improvement over KGAT (0.377). On Yelp, the model achieved an NDCG@10 of 0.603, demonstrating superior ranking quality.

Performance comparison (HR@k) on the Yelp dataset, showing KHGT's effectiveness across different recommendation list lengths.

Key Insights

  • Knowledge Graph Synergy: For "cold start" users with limited history, item-item relations from the knowledge graph provide a vital scaffold for making accurate recommendations.
  • Sparsity Resilience: The performance gap between KHGT and its competitors widens as user data becomes sparser, proving the robustness of the knowledge-enhanced hierarchical approach.

Conclusion

The Knowledge-Enhanced Hierarchical Graph Transformer (KHGT) effectively navigates the complexities of multi-behavior recommendation by integrating temporal context and semantic item relationships. While computationally intensive, its hierarchical modeling and sub-graph sampling make it a powerful tool for modern recommendation tasks. Future work will explore real-time streaming updates and enhancing the interpretability of learned behavior weights.

Summary updated

BibTeX
@inproceedings{xia2021knowledge,
  author = {Lianghao Xia and Chao Huang and Yong Xu and Peng Dai and Xiyue Zhang and Hongsheng Yang and Jian Pei and Liefeng Bo},
  title = {{Knowledge-Enhanced Hierarchical Graph Transformer Network for Multi-Behavior Recommendation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i5.16576},
}
Figure