Few-Shot Learning or RAG in LLM-Based Text-to-SPARQL? Why Not Both?

This paper introduces a hybrid approach for the text-to-SPARQL task involving Large Language Models (LLMs) by integrating Retrieval-Augmented Generation (RAG) with fewshot learning techniques. The approach enhances the AutoKGQA framework by incorporating query examples into the LLM while selecting minimal knowledge graph (KG) subgraphs as context, thereby improving its ability to interpret and answer natural language queries. Experimental results on the SciQA benchmark indicate that this integration increased the F1-score by 0.16. Notably, the framework excelled in the zero-shot setting with an F1-score of 0.73, significantly outperforming the prior score of 0.26. Additionally, the paper introduces an automated procedure to extract a minimal T-Box from KGs lacking an explicit schema, optimizing query processing by limiting deep neighborhood exploration. These findings suggest that combining KG context with query examples is an effective strategy, particularly for developing generalizable systems.

Authors

Institutions

Publication Details

Published
2025-02-03
DOI
https://doi.org/10.1109/icsc64641.2025.00016
Citations
1
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
2.48
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Few-Shot Learning or RAG in LLM-Based Text-to-SPARQL? Why Not Both?

Wellington Franco, Caio Viktor S. Avila, Marco A. Casanova, Vânia Maria Ponte Vidal
1 citations
Natural Language Processing Techniques
2.48
article

Few-Shot Learning or RAG in LLM-Based Text-to-SPARQL? Why Not Both?

Wellington Franco, Caio Viktor S. Avila, Marco A. Casanova, Vânia Maria Ponte Vidal
article en
1 citations

Abstract

This paper introduces a hybrid approach for the text-to-SPARQL task involving Large Language Models (LLMs) by integrating Retrieval-Augmented Generation (RAG) with fewshot learning techniques. The approach enhances the AutoKGQA framework by incorporating query examples into the LLM while selecting minimal knowledge graph (KG) subgraphs as context, thereby improving its ability to interpret and answer natural language queries. Experimental results on the SciQA benchmark indicate that this integration increased the F1-score by 0.16. Notably, the framework excelled in the zero-shot setting with an F1-score of 0.73, significantly outperforming the prior score of 0.26. Additionally, the paper introduces an automated procedure to extract a minimal T-Box from KGs lacking an explicit schema, optimizing query processing by limiting deep neighborhood exploration. These findings suggest that combining KG context with query examples is an effective strategy, particularly for developing generalizable systems.

Pontifícia Universidade Católica do Rio de Janeiro (BR)
Quality Education
Openalex Percentile: Top 10%
Natural Language Processing Techniques
2.48
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Few-Shot Learning or RAG in LLM-Based Text-to-SPARQL? Why Not Both? — Wellington Franco, Caio Viktor S. Avila, et al. · (2025) | TGRS Research Map | TGRS