MGRR-SQL: Multi-Granularity Relevant Retrieval-Based in-Context Learning Approach for Text-to-SQL Generation

In-Context learning serves as a vital component for enhancing Text-to-SQL task performance. However, current in-context learning methodologies for Text-to-SQL applications fail to sufficiently bridge the significant cross-domain correlation gap that exists between few-shot examples and the intended query target. Our approach overcomes these challenges through a novel relevant retrieval-based in-context learning method, which operates across three distinct granularity levels: (1) semantic similarity retrieval for analogous questions, (2) query kernel entity matching for retrieving strongly relevant questions and (3) character-level similarity analysis for fine-grained question retrieval. Additionally, we introduce a novel Object-Relational Mapping (ORM)-based database prompt and a post cell value linking method that effectively describes the schema while avoiding error propagation common in traditional schema linking approaches. Our experimental evaluations conducted on the benchmark datasets BIRD and Spider reveal that our approach delivers strong performance, comparable to state-of-the-art methods.

Authors

Institutions

Publication Details

Published
2025-03-21
DOI
https://doi.org/10.1109/icaace65325.2025.11019241
Primary Topic
Semantic Web and Ontologies
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

MGRR-SQL: Multi-Granularity Relevant Retrieval-Based in-Context Learning Approach for Text-to-SQL Generation

Zhao Li, Yang Li, Tong Chen, Shiwei Wu et al.
Semantic Web and Ontologies
article

MGRR-SQL: Multi-Granularity Relevant Retrieval-Based in-Context Learning Approach for Text-to-SQL Generation

Zhao Li, Yang Li, Tong Chen, Shiwei Wu, Yiming Zhan
article en

Abstract

In-Context learning serves as a vital component for enhancing Text-to-SQL task performance. However, current in-context learning methodologies for Text-to-SQL applications fail to sufficiently bridge the significant cross-domain correlation gap that exists between few-shot examples and the intended query target. Our approach overcomes these challenges through a novel relevant retrieval-based in-context learning method, which operates across three distinct granularity levels: (1) semantic similarity retrieval for analogous questions, (2) query kernel entity matching for retrieving strongly relevant questions and (3) character-level similarity analysis for fine-grained question retrieval. Additionally, we introduce a novel Object-Relational Mapping (ORM)-based database prompt and a post cell value linking method that effectively describes the schema while avoiding error propagation common in traditional schema linking approaches. Our experimental evaluations conducted on the benchmark datasets BIRD and Spider reveal that our approach delivers strong performance, comparable to state-of-the-art methods.

Qilu University of Technology (CN), Hainan University (CN), Shandong Academy of Sciences (CN)
Quality Education
Openalex Percentile: Top 94%
Semantic Web and Ontologies
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.