Abstract
Knowledge Graph Question Answering (KGQA) typically requires a dual-module architecture: a text encoder for question understanding and a reasoning module for graph navigation. However, this separation often leads to information loss and limited semantic integration. We present ReasoningLM, a unified framework that enables a single Pre-trained Language Model (PLM) to perform structural reasoning directly. By introducing subgraph-aware self-attention and an adaptation tuning phase using synthetic data, ReasoningLM bridges the gap between text-heavy language models and structure-heavy Knowledge Graphs. Our approach achieves state-of-the-art results on multiple KGQA benchmarks, including a significant improvement on complex multi-hop tasks, while updating only 1 million parameters.
Introduction
Answering complex questions using a Knowledge Graph (KGQA) is a challenging task that demands both deep semantic understanding and precise structural navigation. Traditional systems often rely on a "two-brain" setup: a Text Encoder (e.g., BERT) to parse the question and a Reasoning Module (e.g., a Graph Neural Network) to traverse the graph.
The authors of ReasoningLM identify two critical flaws in this decoupled approach. First, Loose Integration prevents the rich semantic nuances captured by the PLM from fully informing the GNN's search. Second, Semantic Poverty in GNNs makes them less effective for complex questions where word meanings and world knowledge are as vital as connection paths. ReasoningLM unifies these functions into a single model, treating the Transformer architecture as a flexible graph processor.
Methodology
ReasoningLM transforms a standard PLM into a graph-reasoning engine through three primary innovations:
1. BFS-based Subgraph Serialization
To process graph data within a sequence-based model, KG subgraphs are flattened into a sequence of entities and relations (e.g., [entity1, relation1, entity2...]) using Breadth-First Search (BFS). This allows the model to ingest structural data as a linear input.
2. Subgraph-aware Self-Attention
This is the core architectural modification. Instead of standard global self-attention, ReasoningLM employs a custom mask that forces the PLM to imitate a GNN's behavior. As illustrated in Figure 1, the attention is partitioned into specific interactions:
- Structural Attention: Entities are restricted to attending only to their immediate neighbors in the graph.
- Cross-Modal Interaction: Subgraph tokens can attend to question tokens to gain context for the search.
- Question Protection: Question tokens are prevented from attending to the subgraph to avoid "noise pollution" from irrelevant graph nodes.
3. Adaptation Tuning
To bridge the gap between natural language and serialized graphs, the authors utilized a synthetic dataset of 20,000 subgraphs. By using ChatGPT to generate natural language questions for these subgraphs, they "tuned" the PLM to predict correct answer entities. This phase allows the model to learn the logic of graph reasoning before tackling specific downstream tasks.
Experimental Results
ReasoningLM was evaluated on three major KGQA benchmarks: WebQuestionsSP (WebQSP), ComplexWebQuestions (CWQ), and MetaQA. The model demonstrated significant performance gains, particularly on multi-hop reasoning tasks.
As shown in Figure 3, ReasoningLM achieved a 69.0 Hits@1 on the difficult CWQ dataset, representing a staggering improvement over the previous state-of-the-art PLM-based model, UniKGQA (50.7). On WebQSP, it reached 78.5 Hits@1, outperforming specialized reasoning models like TransferNet and NSM. Notably, these results were achieved with high parameter efficiency, updating only 1 million parameters via an adapter-based strategy.
Discussion and Conclusion
The success of ReasoningLM suggests that Transformers are inherently capable of graph reasoning if their attention mechanisms are appropriately constrained. By "downgrading" the fully connected Transformer into a specific graph structure while retaining its pre-trained semantic weights, the model achieves a superior balance of structure and semantics.
While the model is currently limited by the context window of standard PLMs (typically 512 tokens), preventing the processing of very large subgraphs, its efficiency is remarkable. ReasoningLM reached competitive performance with as few as 5,000 adaptation samples, proving that subgraph-aware architectures are a highly effective path forward for structured reasoning in language models.
Summary updated