A Retrieve-and-Read Framework for Knowledge Graph Link Prediction

Vardaan Pahuja, Boshi Wang, Hugo Latapie, Jayanth Srinivasa, Yu Su · DOI

Abstract

Knowledge graph (KG) link prediction aims to infer new facts based on existing facts in the KG. Recent studies have shown that using the graph neighborhood of a node via graph neural networks (GNNs) provides more useful information compared to just using the query information. Conventional GNNs for KG link prediction follow the standard message-passing paradigm on the entire KG, which leads to over-smoothing of representations and also limits their scalability. On a large scale, it becomes computationally expensive to aggregate useful information from the entire KG for inference. To address the limitations of existing KG link prediction frameworks, we propose a novel retrieve-and-read framework, which first retrieves a relevant subgraph context for the query and then jointly reasons over the context and the query with a high-capacity reader. As part of our exemplar instantiation for the new framework, we propose a novel Transformer-based GNN as the reader, which incorporates graph-based attention structure and cross-attention between query and context for deep fusion. This design enables the model to focus on salient context information relevant to the query. Empirical results on two standard KG link prediction datasets demonstrate the competitive performance of the proposed method.

Introduction

Knowledge Graphs (KGs) are massive repositories of structured information, typically represented as triples like (subject, relation, object). Link prediction is the fundamental task of predicting missing entities in these triples, such as identifying the occupation of a specific person.

Historically, link prediction has relied on two primary paradigms: shallow embeddings and Graph Neural Networks (GNNs). While shallow embeddings are computationally efficient, they often fail to capture complex, multi-hop relationships. Conversely, conventional GNNs use message-passing to aggregate information from neighbors. However, as KGs scale to millions of nodes, these GNNs become prohibitively expensive and suffer from "over-smoothing," where node representations become indistinguishable after multiple layers of aggregation.

The KG-R3 Framework

To overcome these limitations, we introduce KG-R3 (KG Reasoning with Retriever and Reader). This framework treats link prediction similarly to open-domain question answering: rather than processing the entire graph, the system first identifies a small, relevant neighborhood and then performs deep reasoning on that subset.

Comparison of the Retrieve-and-Read framework against conventional GNN and embedding-based approaches.

The framework consists of two distinct stages:

  1. The Retriever: This module acts as a scout, using methods like Breadth-First Search or reinforcement learning agents to extract a small subgraph contextually related to the query. This drastically reduces the search space, filtering out the 99% of the KG that is irrelevant to a specific query.
  2. The Reader: A high-capacity Transformer-based GNN that "reads" the retrieved subgraph to predict the missing entity.

Technical Implementation: The Reader

The core innovation of KG-R3 lies in its reader architecture. Unlike standard Transformers that allow every token to attend to every other token, our model employs Graph-induced Self-Attention. This mechanism constrains the attention mechanism to respect the actual topology of the retrieved subgraph, ensuring that nodes only aggregate information from their immediate structural neighbors.

The architecture of the Reader, highlighting Query Self-Attention, Subgraph Self-Attention with graph-induced structure, and Cross-Attention fusion.

Furthermore, a Cross-Attention layer allows the query (the question) to interact directly with the subgraph (the context). This deep fusion enables the model to filter out noise within the retrieved subgraph and focus on the most promising relational paths to the answer.

Experimental Results

We evaluated KG-R3 on two standard benchmarks: FB15K-237 (encyclopedic facts) and WN18RR (lexical relations).

  • Accuracy: On FB15K-237, KG-R3 achieved a Mean Reciprocal Rank (MRR) of 0.390, outperforming strong baselines such as HittER (0.373) and CompGCN (0.355).
  • Efficiency: By focusing on a retrieved subgraph rather than the entire KG, the model is significantly more scalable. On the large-scale ogbl-biokg dataset, KG-R3 demonstrated a 5.83x speedup in inference time compared to traditional message-passing GNNs.
  • Contextual Robustness: Analysis showed that the model's performance improves as the "degree" (number of connections) of an entity increases, as the retriever is able to provide more evidential context for the reader to process.

Conclusion and Future Work

KG-R3 demonstrates that modularity is a powerful tool for KG reasoning. By separating retrieval from reading, the framework allows for independent upgrades to either component. Our findings suggest that the primary bottleneck in KG link prediction is often finding the right neighborhood; once the "target coverage" is achieved by the retriever, the reader's accuracy increases nearly eightfold.

Future research will focus on making the reader more robust to noise within retrieved subgraphs and optimizing the framework for web-scale KGs containing billions of nodes through specialized engineering such as high-speed parameter servers.

Summary updated

BibTeX
@inproceedings{pahuja2022retrieve,
  author = {Vardaan Pahuja and Boshi Wang and Hugo Latapie and Jayanth Srinivasa and Yu Su},
  title = {{A Retrieve-and-Read Framework for Knowledge Graph Link Prediction}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2022},
  doi = {10.1145/3583780.3614769},
}
Figure