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

Knowledge Reasoning Language Model: Unifying Knowledge and Language for Inductive Knowledge Graph Reasoning

Xingrui Zhuo, Jiapu Wang, Gongqing Wu, Zhongyuan Wang, Jichen Zhang, Shirui Pan, Xindong Wu

TL;DR

Knowledge Reasoning Language Model (KRLM) is a novel framework that unifies Large Language Models (LLMs) with Knowledge Graph (KG) structures for inductive reasoning. By introducing a specialized tokenizer, a dynamic knowledge memory attention layer, and a structure-aware predictor, KRLM prevents "knowledge distortion" and eliminates hallucinations, outperforming existing state-of-the-art models across 25 real-world datasets.

What Problem Does This Paper Address?

Knowledge Graph Reasoning (KGR) is the task of predicting missing links in a network of facts (e.g., predicting that Shirley Henderson acted in Trainspotting). Inductive KGR is even more challenging: the model must reason about entities and relations it has never seen before during training.

While Large Language Models (LLMs) are renowned for their general reasoning capabilities, current attempts to adapt them for KGR suffer from two major flaws:

  1. Knowledge Distortion: When an LLM is provided with a "sparse" context (only a few isolated facts from a KG), that sparse data can confuse the model, causing it to ignore or distort its own dense internal knowledge.
  2. Generative Hallucinations: Standard LLMs are trained to predict the next text token. In a KG context, however, we need them to predict a specific entity node. Without strict constraints, LLMs often "hallucinate" entities that do not actually exist in the target graph.
Comparison of a standard LLM pipeline causing knowledge distortion versus the proposed KRLM architecture.

Methods

KRLM moves beyond simple prompt engineering by deeply integrating KG structures directly into the LLM's architecture. It achieves this through three key components:

Detailed architecture of the Knowledge Reasoning Language Model (KRLM), highlighting the KRL Tokenizer, Attention Layer, and Next-Entity Predictor.
  • KRL Tokenizer & PAA Module: Instead of relying solely on text, KRLM utilizes a Principal Attribute Aggregation (PAA) module to convert entity and relation descriptions into rich embeddings. Alongside this, a GNN-based Knowledge Encoder captures structural patterns. This dual approach allows the model to handle an infinite number of new entities with a constant number of parameters.
  • KRL Attention Layer: This represents the core innovation of the paper. The authors modified the standard transformer attention layer to include a Dynamic Knowledge Memory. This mechanism retrieves the top-K most relevant entities from the KG and uses them to "guide" the LLM’s attention, ensuring that internal language knowledge and external structural knowledge remain tightly coordinated.
  • Structure-Aware Next-Entity Predictor: To eliminate hallucinations, KRLM replaces the standard text-generation head. It maps the LLM’s hidden state back into the specific entity space of the target KG. This forces the model to choose exclusively from a "trustworthy domain" of valid entities.
  • Collaborative Training: The model employs a dual-distillation loss function to align the structural predictions of the Graph Neural Network (GNN) with the language-based predictions of the LLM.

Datasets

The researchers evaluated KRLM on a massive scale using 28 datasets:

  • 12 Inductive Entity (IndE) datasets: Based on GraIL (e.g., FB-V1, NELL-V1), where the model encounters entirely new entities.
  • 13 Inductive Entity and Relation (IndER) datasets: Based on InGram, representing a harder setting where both entities and relations are unseen.
  • 3 Transductive datasets: Used primarily for pre-training (FB15k-237, WN18RR, and CoDEx-M).

Key Insights and Ideas

  • Coordination vs. Injection: Most existing models simply "inject" KG data into a text prompt. KRLM, instead, "coordinates" it. By altering how the attention layer functions, the model learns when to trust its internal "common sense" and when to rely strictly on the provided graph structure.
  • The Distortion Metric: The authors introduce a quantitative way to measure the Distortion Rate (DR). They found that KRLM exhibits a significantly lower DR (297.01) compared to other LLM-based methods like PROLINK (612.78), proving it is much more robust to noisy or sparse graph data.
  • Zero-Shot Power: Because KRLM learns "structural invariants" (patterns that apply universally to any graph), it can perform reasoning on entirely new KGs without requiring any additional fine-tuning.

Key Results

  • Superior Performance: KRLM outperformed 87% of baseline models in zero-shot scenarios. On the IndE datasets, it achieved an average Hit@10 of 0.738 in pre-training, which rose to 0.751 after fine-tuning.
  • IndER Success: On the significantly more difficult IndER datasets (featuring new relations), KRLM consistently beat specialized state-of-the-art models like InGram and ULTRA.
  • Efficiency: Despite the added architectural complexity, KRLM's training time remains comparable to standard LoRA fine-tuning. For instance, on an A100 GPU, one epoch takes approximately 1 hour and 20 minutes—only 12 minutes longer than the simpler MKGL model.

Limitations and Future Work

  • Backbone Dependency: The model currently relies on a Llama2-7b backbone. While highly capable, this requires significant VRAM (approximately 30-36 GB) for deployment and training.
  • Memory Retrieval Bottleneck: The top-K entity retrieval process within the attention layer introduces a computational bottleneck as the number of candidate entities in the graph grows.
  • Future Directions: The authors suggest exploring Knowledge Editing (directly updating LLM parameters with new KG facts) and utilizing smaller, more efficient LLMs as "rule generators" to reduce the overall computational burden.

Summary updated

BibTeX
@inproceedings{zhuo2026knowledge,
  author = {Xingrui Zhuo and Jiapu Wang and Gongqing Wu and Zhongyuan Wang and Jichen Zhang and Shirui Pan and Xindong Wu},
  title = {{Knowledge Reasoning Language Model: Unifying Knowledge and Language for Inductive Knowledge Graph Reasoning}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=2g8EmFwNTB},
}
Figure