mlsanityData to 14 Oct 2026

SPARQL Query Generation with LLMs: Measuring the Impact of Training Data Memorization and Knowledge Injection

arXiv 2507.13859 ↗First posted 18 Jul 2025cs.IR cs.AI cs.CLcited by 6

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

  1. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  2. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
  3. 2024Qwen2.5 Technical Reportcited by 4,942
  4. 2023ToolQA: A Dataset for LLM Question Answering with External Toolscited by 274
  5. 2024Large Language Models Meet NLP: A Surveycited by 103
  6. 2022QALD-9-plus: A Multilingual Dataset for Question Answering over DBpedia and Wikidata Translated by Native Speakerscited by 39
  7. 2024SPINACH: SPARQL-Based Information Navigation for Challenging Real-World Questionscited by 27
  8. 2024LLM-based SPARQL Query Generation from Natural Language over Federated Knowledge Graphscited by 22
  9. 2024SPARQL Generation: an analysis on fine-tuning OpenLLaMA for Question Answering over a Life Science Knowledge Graphcited by 19
  10. 2024Triad: A Framework Leveraging a Multi-Role LLM-based Agent to Solve Knowledge Base Question Answeringcited by 18
  11. 2024Assessing SPARQL capabilities of Large Language Modelscited by 14
  12. 2024Leveraging small language models for Text2SPARQL tasks to improve the resilience of AI assistancecited by 13
3 more
  1. 2021Compositional Generalization in Multilingual Semantic Parsing over Wikidatacited by 9
  2. 2023A Comprehensive Evaluation of Neural SPARQL Query Generation from Natural Language Questionscited by 9
  3. 2024How Proficient Are Large Language Models in Formal Languages? An In-Depth Insight for Knowledge Base Question Answeringcited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 5.

6 papers.