# Ontology-Guided, Hybrid Prompt Learning for Generalization in Knowledge Graph Question Answering

Source: [Ontology-Guided, Hybrid Prompt Learning for Generalization in Knowledge Graph Question Answering](<https://www.sota2.com/research/paper/68fa76e51e209131cea6fc04>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-26T04:05:09.252Z

Authors: Longquan Jiang, Junbo Huang, Cedric M\\"oller, Ricardo Usbeck

Published: 2025-02-06T11:47:58.000Z

## Abstract

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}

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Knowledge Graph Question Answering on CWQ](<https://www.sota2.com/research/sota/knowledge-graph-question-answering-on-cwq.md>): Knowledge Graph Question Answering; CWQ; Hit@1: 48.8.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2502.03992>)

[PDF](<https://arxiv.org/pdf/2502.03992.pdf>)
