SPARQL Query Generation with LLMs: Measuring the Impact of Training Data Memorization and Knowledge Injection
Not on the map. Why?
Abstract (arXiv)
Nowadays, the importance of software with natural-language user interfaces cannot be underestimated. In particular, in Question Answering (QA) systems, generating a SPARQL query for a given natural-language question (often named Query Building) from the information retrieved from the same question is the central task of QA systems working over Knowledge Graphs (KGQA). Due to the rise of Large Language Models (LLMs), they are considered a well-suited method to increase the quality of the question-answering functionality, as there is still a lot of room for improvement, aiming for enhanced quality and trustworthiness. However, LLMs are trained on web data, where researchers have no control over whether the benchmark or the knowledge graph was already included in the training data. In this paper, we introduce a novel method that evaluates the quality of LLMs by generating a SPARQL query from a natural-language question under various conditions: (1) zero-shot SPARQL generation, (2) with knowledge injection, and (3) with "anonymized" knowledge injection. This enables us, for the first time, to estimate the influence of the training data on the QA quality improved by LLMs. Ultimately, this will help to identify how portable a method is or whether good results might mostly be achieved because a benchmark was already included in the training data (cf. LLM memorization). The developed method is portable, robust, and supports any knowledge graph; therefore, it could be easily applied to any KGQA or LLM, s.t., generating consistent insights into the actual LLM capabilities is possible.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 15 of its 33 references that are in the map. First posted on arXiv 18 Jul 2025.
Builds on
15 of 33 references.
References · 15
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2023ToolQA: A Dataset for LLM Question Answering with External Toolscited by 274
- 2024Large Language Models Meet NLP: A Surveycited by 103
- 2022QALD-9-plus: A Multilingual Dataset for Question Answering over DBpedia and Wikidata Translated by Native Speakerscited by 39
- 2024SPINACH: SPARQL-Based Information Navigation for Challenging Real-World Questionscited by 27
- 2024LLM-based SPARQL Query Generation from Natural Language over Federated Knowledge Graphscited by 22
- 2024SPARQL Generation: an analysis on fine-tuning OpenLLaMA for Question Answering over a Life Science Knowledge Graphcited by 19
- 2024Triad: A Framework Leveraging a Multi-Role LLM-based Agent to Solve Knowledge Base Question Answeringcited by 18
- 2024Assessing SPARQL capabilities of Large Language Modelscited by 14
- 2024Leveraging small language models for Text2SPARQL tasks to improve the resilience of AI assistancecited by 13
3 more
- 2021Compositional Generalization in Multilingual Semantic Parsing over Wikidatacited by 9
- 2023A Comprehensive Evaluation of Neural SPARQL Query Generation from Natural Language Questionscited by 9
- 2024How Proficient Are Large Language Models in Formal Languages? An In-Depth Insight for Knowledge Base Question Answeringcited by 5
Built on by
Citing papers per year: 2025: 1; 2026: 5.
6 papers.
- 2025SPARQL-LLM: Real-Time SPARQL Query Generation from Natural Language Questionscited by 3
- 2026Better Later Than Sooner: Neuro-Symbolic Knowledge Graph Construction via Ontology-grounded Post-extraction Correctioncited by 1
- 2026HOME-KGQA: A Benchmark Dataset for Multimodal Knowledge Graph Question Answering on Household Daily Activitiescited by 0
- 2026MARS: Multi-hop Adaptive Retrieval and SPARQL Generation for KGQAcited by 0
- 2026KGVoyager: Knowledge Graph Agnostic Question Answering via Agentic Navigationcited by 0
- 2026Natural Language Questions as an Interface for Knowledge Graphs: QRAKEN Graph Distillation and Semantic Self-Healingcited by 0
- 2026Natural Language Questions as an Interface for Knowledge Graphs: QRAKEN Graph Distillation and Semantic Self-Healing6 Oct 2026
- 2026KGVoyager: Knowledge Graph Agnostic Question Answering via Agentic Navigation1 Sep 2026
- 2026MARS: Multi-hop Adaptive Retrieval and SPARQL Generation for KGQA16 Jul 2026
- 2026Better Later Than Sooner: Neuro-Symbolic Knowledge Graph Construction via Ontology-grounded Post-extraction Correction27 May 2026
- 2026HOME-KGQA: A Benchmark Dataset for Multimodal Knowledge Graph Question Answering on Household Daily Activities10 May 2026
- 2025SPARQL-LLM: Real-Time SPARQL Query Generation from Natural Language Questions16 Dec 2025