NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learning Query Adaptive Anchor Representation for Inductive Relation Prediction

Zhiwen Xie, Yi Zhang, Jin Liu, Guangyou Zhou, Jimmy Xiangji HuangACL 2023

Abstract

Inductive relation prediction is a critical task for maintaining Knowledge Graphs (KGs) as they evolve with new, unseen entities. Existing methods often struggle with computational inefficiency and poor feature representation. We present QAAR (Query Adaptive Anchor Representation), a framework that shifts from candidate-specific "enclosing subgraphs" to a single "opening subgraph" per query. By utilizing entity-independent "anchors" and rich structural labeling, QAAR achieves state-of-the-art accuracy while operating up to 20x faster than previous leading methods.

Introduction

Knowledge Graphs (KGs) like Wikidata and Freebase are foundational for many AI applications but are inherently incomplete. Traditional transductive models learn fixed embeddings for specific entities, requiring expensive retraining whenever new entities are added. Inductive relation prediction addresses this by learning to predict links based on local graph structure rather than entity identity.

However, current state-of-the-art (SOTA) inductive methods, such as GraIL, face significant bottlenecks. They typically extract a unique "enclosing subgraph" for every possible candidate tail entity, leading to linear scaling of computation time with the number of candidates. Furthermore, many models rely on simple distance metrics that fail to capture the semantic richness of the local neighborhood.

Methodology

QAAR introduces a more efficient and expressive approach to inductive reasoning through three primary innovations.

1. Opening Subgraph Extraction

Instead of searching for paths between a head and a specific tail, QAAR extracts a single $k$-hop "opening" subgraph around the query entity. This allows the model to evaluate all potential candidate entities within that neighborhood simultaneously in one forward pass.

The QAAR pipeline: from opening subgraph extraction to query-adaptive anchor construction.

2. Query Adaptive Anchors

To ensure features are transferable to entities never seen during training, QAAR defines "anchors" that are independent of entity IDs. These anchors include the query relation itself, the center node (query entity), and the specific relations connecting the center node to its immediate neighbors.

3. Rich Node Labeling and Query-aware GAT

Every node in the subgraph is assigned a multi-faceted label:

  • Relation-aware: Captures the types of relations connected to the node.
  • Structure-aware: Defines the node's position relative to the query anchors.
  • Distance-based: Records the hop-distance from the center.

These features are processed by a Query-aware Graph Attention Network (GAT). Unlike standard GATs, its attention mechanism is "steered" by the specific relation being queried, ensuring the model prioritizes neighborhood information most relevant to the current task.

Experimental Evaluation

The model was evaluated on 12 standard inductive benchmarks derived from WN18RR, FB15k-237, and NELL-995. In these benchmarks, the training and testing graphs consist of entirely disjoint sets of entities, strictly testing the model's inductive capabilities.

Key Results and Insights

QAAR demonstrates that in an inductive setting, the role an entity plays within a structure is more important than its identity. By anchoring representations to relations and relative positions, the model learns the underlying "logic" of the graph.

Structural labeling of different candidate entities within the query's neighborhood.
  • Performance: QAAR outperformed baselines like GraIL, CoMPILE, and ConGLR on 10 out of 12 benchmark versions. On FB15k-237, it achieved a nearly 12% improvement in average Hits@10 over previous GCN-based methods.
  • Efficiency: By processing all candidates at once, QAAR is significantly faster. In tests on FB15k-237, it was approximately 20x faster than GraIL when ranking 50 candidates. Crucially, QAAR's inference time remains stable as the candidate pool grows, whereas baseline times scale linearly.
  • Beyond Distance: The results confirm that while distance is a useful signal, it is often too coarse. QAAR’s inclusion of relation-aware and structure-aware features allows it to distinguish between nodes that are equidistant from the query but semantically different.

Conclusion and Future Work

QAAR proves that inductive reasoning in KGs can be both highly accurate and computationally efficient. While the current model performs exceptionally well, future work could address memory constraints in extremely dense graphs through neighbor sampling. Additionally, integrating explicit symbolic logical rules with QAAR's neural architecture could further enhance its reasoning capabilities on complex, large-scale Knowledge Graphs.

Summary updated

BibTeX
@inproceedings{xie2023learning,
  author = {Zhiwen Xie and Yi Zhang and Jin Liu and Guangyou Zhou and Jimmy Xiangji Huang},
  title = {{Learning Query Adaptive Anchor Representation for Inductive Relation Prediction}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.882},
}
Figure