Leveraging Large Language Model for Enhanced Text-to-SQL Parsing

Zecheng Zhan, E Haihong, Meina Song · IEEE Access · 2025

Text-to-SQL conversion, the process of generating SQL queries from natural language input, has gained significant attention due to its potential to simplify database interaction. Although benchmarks in this task have driven advancements in the field, the challenges posed by complex join logic and the rich diversity of natural language expressions remain significant obstacles. These complexities underscore the ongoing difficulty of accurately bridging the gap between natural language and structured query representations, particularly in cross-domain and real-world scenarios. Recent research, including intermediate representations, relation-aware transformers, and large language models such as T5 and LLaMA, has improved performance by addressing the semantic gap between natural language and SQL. In this work, we propose SLENet, a novel approach that uses state-of-the-art large language models (LLMs) to enhance semantic understanding and SQL generation. Our method integrates three core innovations: (1) the use of advanced LLMs for context-aware representations, (2) syntax-constrained SQL decoder to ensure grammatical correctness, and (3) search-based prompt optimization utilizing external knowledge sources like WikiSQL. These innovations collectively address schema comprehension and SQL generation complexities. Evaluations on the Spider benchmark demonstrate that SLENet significantly outperforms existing methods, achieving higher exact matching accuracy and effectively handling complex SQL components. Our contributions highlight the importance of combining LLMs with syntax constraints and external data for advancing cross-domain semantic parsing.

Read the paper · More papers on PaperTik