Abstract
Reasoning on large-scale knowledge graphs has been long dominated by embedding methods. While path-based methods possess the inductive capacity that embeddings lack, their scalability is limited by the exponential number of paths. Here we present ANet, a scalable path-based method for knowledge graph reasoning. Inspired by the A algorithm for shortest path problems, our ANet learns a priority function to select important nodes and edges at each iteration, to reduce time and memory footprint for both training and inference. The ratio of selected nodes and edges can be specified to trade off between performance and efficiency. Experiments on both transductive and inductive knowledge graph reasoning benchmarks show that ANet achieves competitive performance with existing state-of-the-art path-based methods, while merely visiting 10% nodes and 10% edges at each iteration. On a million-scale dataset ogbl-wikikg2, ANet not only achieves a new state-of-the-art result, but also converges faster than embedding methods. ANet is the first path-based method for knowledge graph reasoning at such scale.
Introduction
Knowledge graphs (KGs) are essential for various AI applications, including search and recommendation. Reasoning over KGs involves predicting missing links or inferring new facts. Historically, this has been approached via two main paradigms: embedding methods and path-based methods. Embedding methods are scalable but struggle with inductive reasoning (unseen entities). Path-based methods generalize well but suffer from exponential path growth, limiting their application to large-scale graphs.
Methodology: Bringing A* Search to KGs
ANet addresses the scalability bottleneck of path-based reasoning by incorporating principles from the A search algorithm. Traditional path-based methods, such as those using a Bellman-Ford approach, propagate information across all nodes and edges at each step, which is computationally prohibitive for massive graphs.
The core innovation of ANet is a learned neural priority function. Unlike handcrafted heuristics, this function estimates the importance of a node relative to a specific query. At each iteration, ANet selects only the top-K nodes and top-L edges with the highest priority for expansion. This selective search drastically reduces the memory and time complexity. To train this function without explicit path labels, A*Net employs weight sharing between the priority function and the predictor, allowing the reasoning task to provide weak supervision.
Experimental Results
The authors evaluated ANet across transductive, inductive, and large-scale benchmarks. A key finding is that ANet can achieve state-of-the-art results while visiting only 10% of the graph's nodes and edges.
Performance on Large-Scale Graphs
On the ogbl-wikikg2 dataset, which contains 2.5 million entities and 16 million triplets, A*Net achieved a new state-of-the-art Mean Reciprocal Rank (MRR) of 0.6767. Notably, it outperformed established embedding methods and was the only path-based method capable of running on this scale without memory errors.
As shown in the figure above, A*Net (red line) not only reaches a higher MRR but also converges significantly faster than traditional embedding models like TransE and RotatE. This efficiency is further highlighted by an observed speedup of up to 8.7x over exhaustive path-based methods with minimal performance degradation.
Conclusion
ANet represents a significant step forward in knowledge graph reasoning, successfully bridging the gap between the inductive power of path-based methods and the scalability of embedding methods. By learning to prioritize the most informative paths, ANet enables efficient reasoning on million-scale graphs, offering both high performance and inherent interpretability. Future work will focus on optimizing system implementations to better leverage hardware acceleration for these sparse, prioritized search operations.
Summary updated