让大模型零样本问答跨知识图谱,靠的是结构化提示与本体引导。
Ontology-Guided, Hybrid Prompt Learning for Generalization in Knowledge Graph Question Answering
- 分两阶段生成SPARQL:先构架后填充,解耦语义解析与图依赖。
- 在多个基准上表现媲美顶尖方法,无需微调即可跨域适配新知识图谱。
- 适合需要快速部署到新领域知识图谱的开发者和研究者。
现有知识图谱问答(KGQA)系统通常针对特定知识图谱(如Wikidata、DBpedia或Freebase)设计,由于底层图模式、拓扑结构和断言存在异质性,多数系统无法在无大量训练数据的前提下迁移到未见过的知识图谱。本文提出一种基于大语言模型的新型KGQA方法OntoSCPrompt,采用两阶段架构:首先生成包含SELECT、ASK、WHERE等关键字及占位符的SPARQL查询结构,再填充具体图谱信息。为增强对底层知识图谱的理解,提出一种本体引导的混合提示学习策略,将知识图谱本体融入离散与连续提示向量的学习过程。同时设计多种任务特异性解码策略,确保生成的SPARQL在两阶段均正确且可执行。实验表明,OntoSCPrompt在CWQ、WebQSP和LC-QuAD 1.0等多个基准上表现不逊于现有最优方法,以资源高效方式实现零样本迁移,且能良好泛化至如DBLP-QuAD和CoyPu等领域特定知识图谱。
原文摘要 · Abstract (English)
Most existing Knowledge Graph Question Answering (KGQA) approaches are designed for a specific KG, such as Wikidata, DBpedia or Freebase. Due to the heterogeneity of the underlying graph schema, topology and assertions, most KGQA systems cannot be transferred to unseen Knowledge Graphs (KGs) without resource-intensive training data. We present OntoSCPrompt, a novel Large Language Model (LLM)-based KGQA approach with a two-stage architecture that separates semantic parsing from KG-dependent interactions. OntoSCPrompt first generates a SPARQL query structure (including SPARQL keywords such as SELECT, ASK, WHERE and placeholders for missing tokens) and then fills them with KG-specific information. To enhance the understanding of the underlying KG, we present an ontology-guided, hybrid prompt learning strategy that integrates KG ontology into the learning process of hybrid prompts (e.g., discrete and continuous vectors). We also present several task-specific decoding strategies to ensure the correctness and executability of generated SPARQL queries in both stages. Experimental results demonstrate that OntoSCPrompt performs as well as SOTA approaches without retraining on a number of KGQA datasets such as CWQ, WebQSP and LC-QuAD 1.0 in a resource-efficient manner and can generalize well to unseen domain-specific KGs like DBLP-QuAD and CoyPu KG Code: \href{https://github.com/LongquanJiang/OntoSCPrompt}{https://github.com/LongquanJiang/OntoSCPrompt}
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。