Home > Published Issues > 2024 > Volume 15, No. 10, 2024 >
JAIT 2024 Vol.15(10): 1157-1162
doi: 10.12720/jait.15.10.1157-1162

LLM4QA: Leveraging Large Language Model for Efficient Knowledge Graph Reasoning with SPARQL Query

Mingjing Lan, Yi Xia *, Gang Zhou, Ningbo Huang, Zhufeng Li, and Hao Wu
State Key Laboratory of Mathematical Engineering and Advanced Computing, Information Engineering University, Zhengzhou, China
Email: lanmingjing@126.com (M.L.); summer one520@163.com (Y.X.); gzhougzhou@126.com (G.Z.); rylynn ab@163.com (N.H.); 20086538@qq.com (Z.L.); wuhao186000@163.com (H.W.)
*Corresponding author

Manuscript received June 7, 2024; revised June 25, 2024; accepted July 4, 2024; published October 21, 2024.

Abstract—As one of the core technologies of general artificial intelligence, knowledge graph reasoning aims to infer new knowledge from existing knowledge in the knowledge base, providing decision support for knowledge-driven intelligent information services such as information retrieval, question answering, and recommendation systems. However, there are still some issues, such as poor interpretability and low reasoning efficiency, always decrease the current knowledge reasoning performance. To tackle the challenges, this paper proposes a knowledge graph reasoning method LLM4QA, which leverages fine-tuned large language models with chain-of-thought to generate graph query languages SPARQL (i.e., SPARQL Protocol and RDF Query Language) for reasoning. Firstly, an efficient instruction fine-tuning method is applied to fine-tune open-source large language models with chain-of-thought. Then, the fine-tuned open-source large model is used to convert natural language questions into logical forms. Finally, we utilize unsupervised entity relationship retrieval to generate graph database query languages, real-izing a natural language knowledge graph question-answering framework. Experimental results demonstrate that this method achieves well performance in terms of inference accuracy and significantly improves model retrieval efficiency.
 
Keywords—Large Language Model (LLM), knowledge graph, question answering system, chain of thought

Cite: Mingjing Lan, Yi Xia, Gang Zhou, Ningbo Huang, Zhufeng Li, and Hao Wu, "LLM4QA: Leveraging Large Language Model for Efficient Knowledge Graph Reasoning with SPARQL Query," Journal of Advances in Information Technology, Vol. 15, No. 10, pp. 1157-1162, 2024.

Copyright © 2024 by the authors. This is an open access article distributed under the Creative Commons Attribution License (CC BY-NC-ND 4.0), which permits use, distribution and reproduction in any medium, provided that the article is properly cited, the use is non-commercial and no modifications or adaptations are made.