arXiv:2507.13859cs.IRcs.AI2025-07被引 9

评估大模型生成SPARQL查询时,训练数据记忆对问答质量的影响。

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

  • 设计三种条件测试:零样本、知识注入、匿名知识注入
  • 首次量化训练数据记忆对问答准确率的影响
  • 适合评估大模型在知识图谱问答中的真实能力

如今,具备自然语言用户界面的软件至关重要。在基于知识图谱的问答系统(KGQA)中,将自然语言问题转化为SPARQL查询(即查询构建)是核心任务。尽管大型语言模型(LLMs)被广泛认为可提升问答质量,但其训练数据来自网络,研究者无法确定基准或知识图谱是否已被包含在训练集中。本文提出一种新方法,在三种条件下评估LLM生成SPARQL查询的质量:(1)零样本生成,(2)知识注入,(3)匿名知识注入。该方法首次实现了对训练数据记忆效应的量化评估,有助于判断模型性能是源于真实推理能力,还是因训练数据中已包含测试集。该方法具有可移植性、鲁棒性强,适用于任意知识图谱和大模型,可一致揭示模型的真实能力。

原文摘要 · Abstract (English)

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.

知识图谱大模型问答系统SPARQL

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。