DNPrune-GT: Graph Transformer with Dynamic Neighbor Pruning for Knowledge Graph Reasoning
摘要
A core challenge in knowledge graph reasoning lies in reconciling topological structure awareness with semantic correlation modeling. When updating knowledge graphs based on embedding representations from local or global perspective, traditional approaches often encounter significant limitations due to noisy neighborhood interference, excessive local smoothing, and a lack of long-range dependency modeling. To address these issues, we propose DNPrune-GT, a Dynamic Neighbor Pruning Graph Transformer that facilitates multi-granularity reasoning through a semantically guided hierarchical architecture. Specifically, DNPrune-GT introduces a dynamic pruning mechanism based on semantic similarity to construct context-aware subgraphs by retaining the top-k most relevant neighbors at each layer, effectively suppressing noise propagation. Furthermore, we leverage the modularity-optimized Leiden algorithm to partition the graph into functional communities, enabling a hierarchical reasoning process that transitions from local aggregation to community-level reorganization and global interaction. To further enhance the model’s capacity to capture long-range semantic dependencies across communities, we design a topology-aware graph Transformer module that incorporates community positional encodings and multi-order adjacency matrices. Extensive experiments on the FB15k-237 and WN18RR datasets demonstrate the superiority of DNPrune-GT, achieving mean reciprocal rank (MRR) scores of 0.385 and 0.497, respectively surpassing the best-performing Graph Transformer baselines by 3.5% and 0.8% while improving Hits@10 by 2.3% and 1.6%. These results highlight the effectiveness of our proposed dynamic pruning and hierarchical semantic integration framework in enhancing the modeling of complex relational structures in heterogeneous graphs.