Self-supervised heterogeneous graph neural networks have shown remarkable effectiveness in addressing the challenge of limited labeled data. However, current contrastive learning methods face limitations in leveraging neighborhood information for each node. Some approaches utilize the local information of the target node, ignoring useful signals from deeper neighborhoods. On the other hand, simply stacking convolutional layers to expand the neighborhood inevitably leads to over-smoothing. To address the problems, we propose HGNN-DB, a Self-supervised Heterogeneous Graph Neural Network Based on Deep and Broad Neighborhood Encoding to tackle the over-smoothing problem within heterogeneous graphs. Specifically, HGNN-DB aims to learn informative node representations by incorporating both deep and broad neighborhoods. We introduce a deep neighborhood encoder with a distance-weighted strategy to capture deep features of target nodes. Additionally, a single-layer graph convolutional network is employed for the broad neighborhood encoder to aggregate broad features of target nodes. Furthermore, we introduce a collaborative contrastive mechanism to learn the complementarity and potential invariance between the two views of neighborhood information. Experimental results on four real-world datasets and seven baselines demonstrate that our model significantly outperforms the current state-of-the-art techniques on multiple downstream tasks. The codes and datasets for this work are available at https://github.com/SSQiana/HGNN-DB.
Reinforcement learning (RL)-based multi-hop knowledge graph reasoning has achieved remarkable success in real-world applications and can effectively handle knowledge graph completion tasks. This approach involves a policy-based agent navigating the graph environment to extend reasoning paths and identify the target entity. However, most existing multi-hop reasoning models are typically constrained to stepwise inference, which inherently disrupts the global information of multi-hop paths. To overcome this limitation, we introduce discriminative features between valid and invalid paths as global information. Here, we propose a multi-hop path encoder specifically designed to extract these discriminative features. Firstly, a multi-hop path encoding module is employed to derive each path’s hidden features, using cross-attention mechanisms to strengthen the interaction between triple context and path features. Secondly, a discriminative feature extraction module is used to capture the differences between valid and invalid paths. Thirdly, an attention-enhanced gated fusion mechanism is implemented to integrate these discriminative features into the multi-hop inference decoder. We further evaluate our method on five standard datasets. Our method outperforms the baseline models, demonstrating the effectiveness of discriminative features in improving prediction performance, learning speed, and path interpretability.