🤖 AI Summary
This work addresses the prevalent issue of semantic incompatibility in SPARQL queries generated by large language model (LLM) agents for knowledge base question answering, which often stems from neglecting type information and leads to empty results. The authors propose a training-free, schema-aware framework that systematically integrates knowledge base schema constraints into the interactive SPARQL generation process. Their approach features bidirectional type state tracking, on-the-fly filtering of incompatible properties during query construction, a compact graph representation enriched with schema annotations, and a mechanism leveraging both experiential and trajectory-based local evidence to handle incomplete schema information. Evaluated on nine benchmarks over Wikidata and Freebase, the method significantly improves semantic compatibility and execution success, achieving state-of-the-art F1 scores across all datasets—along with the highest exact match rates on eight—and substantially reducing the incidence of empty-result queries.
📝 Abstract
Complex knowledge base question answering (KBQA) is commonly approached through either information retrieval over a question-specific subgraph or semantic parsing into an executable logical form. We study the latter paradigm. Recent large language model agents make semantic parsing interactive: they alternate between reasoning, querying the knowledge base, and extending a partial SPARQL query. This interleaving reduces reliance on one-shot generation, but makes the quality of \emph{KB grounding} depend on what the interaction tools expose. Existing agents retrieve or prune candidate properties mainly through lexical relevance and instance-level observations, without systematically conditioning on entity types, property domains and ranges, or the expected answer type. We call this failure mode \emph{type-blind grounding}. It enlarges the grounding search space and often produces plausible-looking but semantically incompatible triple patterns that execute to empty results. We propose SAGA (\underline{S}chema-\underline{A}ware \underline{G}rounding for \underline{A}gentic Text-to-SPARQL Generation), a training-free framework that turns property exploration into a schema-constrained grounding operation. SAGA maintains a persistent bidirectional type state, filters known-incompatible property candidates at construction time, presents the remaining graph patterns in a compact schema-annotated format, and handles missing schema information permissively through empirical and trace-local evidence. Across nine benchmark settings over Wikidata and Freebase, SAGA achieves the highest F1 on all nine settings and the highest exact-match accuracy on eight, while reducing empty-result queries across all reported Wikidata settings.