Manuscript Offprint

arXiv:2611.00171

Reimagining Text-to-SQL: A Survey of Large Language Model Architectures and Strategies

Shikhar Dave, Bhaskarjit Sarmah, Stefano Pasquali

Abstract

Text-to-SQL systems translate natural language questions into executable SQL queries, democratizing access to relational data. Early approaches relied on handcrafted rules and template matching, while subsequent neural methods introduced encoder-decoder architectures, schema linking, and constrained decoding to handle increasingly complex queries. The emergence of large language models (LLMs), exemplified by systems such as ReFoRCE, Agentar-Scale-SQL, Snowflake's Arctic-Text2SQL-R1, and the modular XiYan-SQL framework, has dramatically advanced the field, pushing execution accuracy to new state-of-the-art levels on challenging benchmarks such as Spider, Spider 2.0, and BIRD. In parallel, modular frameworks decompose the task into sub-problems (schema retrieval, sketch-based generation, repair, and ranking), while agentic systems coordinate multiple specialized agents that communicate and dynamically allocate sub-tasks. This survey systematically reviews these LLM-driven approaches within a unified taxonomy of five paradigms (in-context learning, supervised and parameter-efficient fine-tuning, agentic and tool-augmented orchestration, retrieval-augmented generation, and reinforcement learning) and characterizes them by model granularity (monolithic vs. modular), level of supervision (zero-shot, fine-tuned, or reinforcement-based), and reasoning style (direct decoding vs. decomposed multi-step reasoning). We further analyze evaluation metrics, datasets, and open challenges, including domain generalization, efficiency, and real-world deployment, and we examine the role of the semantic layer in production systems. As LLMs increasingly access sensitive databases, we also discuss responsible AI practices. We survey over 100 papers and technical resources, focusing on work published between 2022 and 2026.

Keywords: Text-to-SQL, large language models, semantic parsing, agentic systems, reinforcement learning, database interfaces

1 Introduction

Relational databases are the backbone of data infrastructure in industries such as finance, healthcare, logistics, and e-commerce, where vast volumes of structured data are queried daily to support decision-making and operations. But working with this data usually means writing SQL, which is a real barrier for business analysts, product managers, and other non-technical stakeholders who need answers from the data but do not necessarily have the training to query it themselves. According to recent industry statistics, around two in three people in the global workforce have access to business intelligence tools, but only 21% are confident in their ability to work with data in impactful ways [33]. Text-to-SQL systems address this challenge by translating natural language questions into executable SQL, thereby democratizing data access. By offering conversational interfaces to complex datasets, these technologies can simplify analytics workflows, lower engineering costs, and accelerate insight generation across a wide range of enterprise applications.

Most early Text-to-SQL solutions were template- or rule-based, relying on fixed SQL structures and manually designed grammars. These systems worked for narrow domains, but they did not scale and struggled with complex or previously unseen schemas. Semantic parsing and schema understanding improved significantly with the emergence of deep learning, particularly encoder-decoder models based on LSTMs and Transformers. Models such as Seq2SQL [98], SQLNet [89], and RAT-SQL [79] leveraged structured decoding, pointer networks [77], and schema-linking techniques to handle more realistic and compositional queries.

More recently, powerful large language models (LLMs) such as T5 [67], Codex [12], PaLM [14], and GPT-4 [55] have transformed the landscape of Text-to-SQL by enabling generalizable and highly accurate SQL generation across a wide variety of schemas and query styles. Modern LLM-based Text-to-SQL systems can be broadly grouped into three families:

  • In-context learning (ICL) approaches. These use frozen LLMs with carefully designed prompts, often leveraging few-shot examples, SQL sketches, or demonstration chains. Advances such as Chain-of-Thought (CoT) prompting [85], self-consistency decoding [83], and SQL skeleton prompting [28] have improved reasoning and compositional generalization without updating model weights.

  • Fine-tuning approaches. These methods adapt pre-trained language models to the Text-to-SQL task using supervised datasets such as Spider [93] or BIRD [47]. Two strategies dominate: full-parameter fine-tuning, which updates all model weights to specialize the model for SQL generation, and parameter-efficient fine-tuning (PEFT), which freezes most weights and trains lightweight modules (e.g., LoRA [34] or adapters) to reduce compute and memory costs while retaining performance.

  • Agentic and modular approaches. Inspired by tool-augmented reasoning, these methods decompose Text-to-SQL into specialized sub-components such as schema linking, sub-query generation, correction, and ranking. Frameworks such as XiYan-SQL [25] adopt a multi-generator ensemble with dedicated refiners and selectors, while agent-based methods such as MAC-SQL [80] and SQLFixAgent [7] integrate execution feedback and iterative self-correction. These systems often use external tools, database lookups, or validators to improve reliability.

A fourth family, reinforcement learning (RL) with execution-based rewards, has emerged since 2025 and now underpins many of the strongest systems on public leaderboards; we treat it as a distinct paradigm in this survey. Industry-grade models such as Arctic-Text2SQL-R1 [92] from Snowflake illustrate the practical promise of these approaches, achieving state-of-the-art execution accuracy at the time of release. By combining large-scale pretraining with structured decoding, task decomposition, execution feedback, and careful prompt design, modern LLM-based Text-to-SQL systems achieve substantially better scalability and accuracy, reduce error rates on complex queries, and are becoming increasingly practical for enterprise settings.

References (92)