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

Enhancing Large Language Model for Knowledge Graph Completion via Structure-Aware Alignment-Tuning

Yu Liu, Yanan Cao, Xixun Lin, Yanmin Shang, Shi Wang, Shirui Pan

Abstract

Knowledge graph completion (KGC) aims to infer new knowledge and make predictions from knowledge graphs. Recently, large language models (LLMs) have exhibited remarkable reasoning capabilities. LLM-enhanced KGC methods primarily focus on designing task-specific instructions, achieving promising advancements. However, there are still two critical challenges. First, existing methods often ignore the inconsistent representation spaces between natural language and graph structures. Second, most approaches develop separate instructions for different KGC tasks, leading to duplicate works and time-consuming processes. To address these challenges, we propose SAT, a novel framework that enhances LLMs for KGC via structure-aware alignment-tuning. Specifically, we first introduce hierarchical knowledge alignment to align graph embeddings with the natural language space through multi-task contrastive learning. Then, we propose structural instruction tuning to guide LLMs in performing structure-aware reasoning over KGs, using a unified graph instruction combined with a lightweight knowledge adapter. Experimental results on two KGC tasks across four benchmark datasets demonstrate that SAT significantly outperforms state-of-the-art methods, especially in the link prediction task with improvements ranging from 8.7% to 29.8%.

Introduction

Knowledge Graphs (KGs) serve as the backbone for numerous AI applications, yet they are inherently incomplete. Knowledge Graph Completion (KGC)—the process of predicting missing links or verifying facts—is vital for maximizing their utility. While Large Language Models (LLMs) have demonstrated exceptional reasoning skills, applying them to KGs presents two major hurdles: the Representational Gap and Task Redundancy.

The representational gap stems from the fact that graph structures and natural language exist in different mathematical spaces. Simply "flattening" a graph into text often loses structural nuance and creates prohibitively long prompts. Conversely, raw graph embeddings are typically unintelligible to pre-trained LLMs. Furthermore, most current methods require bespoke instructions for different KGC tasks, leading to fragmented and inefficient workflows.

Comparison of text-based and embedding-based instruction for KGC.

The SAT Framework

To address these limitations, we introduce SAT (Structure-Aware Alignment-Tuning), a framework that treats KGC as a generative question-answering problem. SAT bridges the representational gap through two primary stages: Hierarchical Knowledge Alignment and Structural Instruction Tuning.

The SAT framework architecture, featuring Hierarchical Knowledge Alignment and Structural Instruction Tuning.

Hierarchical Knowledge Alignment

This stage uses multi-task contrastive learning to ensure graph embeddings "speak" the same language as the LLM:

  • Local Alignment: Aligns individual entity embeddings with their textual descriptions (e.g., Wikipedia snippets).
  • Global Alignment: Uses GPT-4 to extract subgraphs from documents, then aligns these subgraph embeddings with the original text. This helps the model understand how groups of entities relate within complex narratives.

Structural Instruction Tuning

Instead of messy text verbalization, SAT uses a lightweight knowledge adapter to project aligned graph embeddings directly into the LLM's attention layers.

  • Unified Template: Employs a single instruction format for all KGC tasks, eliminating redundancy.
  • Structural Context: Retrieves a $k$-hop neighborhood (optimally 2-hop) around query entities, feeding these as aligned embeddings to provide rich structural context.
  • Efficiency: During tuning, the LLM and Graph Encoder are frozen; only the adapter is trained, making the process computationally efficient.

Experimental Results

SAT was evaluated on four benchmark datasets: FB15k-237N, CoDeX-S, FB15k-237, and YAGO3-10. The framework consistently outperformed traditional KGC models (e.g., TransE, RotatE) and recent LLM-enhanced methods (e.g., KoPA, PKGC).

  • Link Prediction: SAT achieved massive gains in Hit@1, with relative improvements of 29.1% on FB15k-237N and 29.8% on CoDeX-S.
  • Triple Classification: The model achieved a state-of-the-art F1-score of 0.831 on FB15k-237N, significantly surpassing GPT-4's score of 0.647.

Key Insights

Analysis showed that Global Alignment (subgraphs to documents) is more critical for performance than node-to-word alignment alone. Additionally, the researchers found that a 2-hop neighborhood is the "sweet spot" for context; 3-hop neighborhoods introduced too much noise, degrading performance.

Conclusion

SAT effectively enhances LLMs for KGC by bridging the gap between structured knowledge and natural language. Through hierarchical alignment and a unified instruction-tuning approach with a knowledge adapter, SAT achieves superior performance and efficiency. Future work will explore deeper modality fusion and extending the framework to complex multi-hop reasoning and recommendation engines.

Summary updated

BibTeX
@inproceedings{liu2025enhancing,
  author = {Yu Liu and Yanan Cao and Xixun Lin and Yanmin Shang and Shi Wang and Shirui Pan},
  title = {{Enhancing Large Language Model for Knowledge Graph Completion via Structure-Aware Alignment-Tuning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
  url = {https://openreview.net/forum?id=Zq8H4NW4Xl},
}
Figure