Salvato in:
Dettagli Bibliografici
Autori principali: Tripathi, Anurag, Patle, Vaibhav, Jain, Abhinav, Pundir, Ayush, Menon, Sairam, Singh, Ajeet Kumar, Herremans, Dorien
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:https://arxiv.org/abs/2508.06387
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909730446770176
author Tripathi, Anurag
Patle, Vaibhav
Jain, Abhinav
Pundir, Ayush
Menon, Sairam
Singh, Ajeet Kumar
Herremans, Dorien
author_facet Tripathi, Anurag
Patle, Vaibhav
Jain, Abhinav
Pundir, Ayush
Menon, Sairam
Singh, Ajeet Kumar
Herremans, Dorien
contents Text-to-SQL bridges the gap between natural language and structured database language, thus allowing non-technical users to easily query databases. Traditional approaches model text-to-SQL as a direct translation task, where a given Natural Language Query (NLQ) is mapped to an SQL command. Recent advances in large language models (LLMs) have significantly improved translation accuracy, however, these methods all require that the target database is pre-specified. This becomes problematic in scenarios with multiple extensive databases, where identifying the correct database becomes a crucial yet overlooked step. In this paper, we propose a three-stage end-to-end text-to-SQL framework to identify the user's intended database before generating SQL queries. Our approach leverages LLMs and prompt engineering to extract implicit information from natural language queries (NLQs) in the form of a ruleset. We then train a large db\_id prediction model, which includes a RoBERTa-based finetuned encoder, to predict the correct Database identifier (db\_id) based on both the NLQ and the LLM-generated rules. Finally, we refine the generated SQL by using critic agents to correct errors. Experimental results demonstrate that our framework outperforms the current state-of-the-art models in both database intent prediction and SQL generation accuracy.
format Preprint
id arxiv_https___arxiv_org_abs_2508_06387
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle End-to-End Text-to-SQL with Dataset Selection: Leveraging LLMs for Adaptive Query Generation
Tripathi, Anurag
Patle, Vaibhav
Jain, Abhinav
Pundir, Ayush
Menon, Sairam
Singh, Ajeet Kumar
Herremans, Dorien
Machine Learning
Artificial Intelligence
Text-to-SQL bridges the gap between natural language and structured database language, thus allowing non-technical users to easily query databases. Traditional approaches model text-to-SQL as a direct translation task, where a given Natural Language Query (NLQ) is mapped to an SQL command. Recent advances in large language models (LLMs) have significantly improved translation accuracy, however, these methods all require that the target database is pre-specified. This becomes problematic in scenarios with multiple extensive databases, where identifying the correct database becomes a crucial yet overlooked step. In this paper, we propose a three-stage end-to-end text-to-SQL framework to identify the user's intended database before generating SQL queries. Our approach leverages LLMs and prompt engineering to extract implicit information from natural language queries (NLQs) in the form of a ruleset. We then train a large db\_id prediction model, which includes a RoBERTa-based finetuned encoder, to predict the correct Database identifier (db\_id) based on both the NLQ and the LLM-generated rules. Finally, we refine the generated SQL by using critic agents to correct errors. Experimental results demonstrate that our framework outperforms the current state-of-the-art models in both database intent prediction and SQL generation accuracy.
title End-to-End Text-to-SQL with Dataset Selection: Leveraging LLMs for Adaptive Query Generation
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2508.06387