MAG-SQL: Multi-Agent Generative Approach with Soft Schema Linking and Iterative Sub-SQL Refinement for Text-to-SQL
On the map: LLM agents and tool use → Web, search, and research agents
Abstract (arXiv)
Recent In-Context Learning based methods have achieved remarkable success in Text-to-SQL task. However, there is still a large gap between the performance of these models and human performance on datasets with complex database schema and difficult questions, such as BIRD. Besides, existing work has neglected to supervise intermediate steps when solving questions iteratively with question decomposition methods, and the schema linking methods used in these works are very rudimentary. To address these issues, we propose MAG-SQL, a multi-agent generative approach with soft schema linking and iterative Sub-SQL refinement. In our framework, an entity-based method with tables' summary is used to select the columns in database, and a novel targets-conditions decomposition method is introduced to decompose those complex questions. Additionally, we build a iterative generating module which includes a Sub-SQL Generator and Sub-SQL Refiner, introducing external oversight for each step of generation. Through a series of ablation studies, the effectiveness of each agent in our framework has been demonstrated. When evaluated on the BIRD benchmark with GPT-4, MAG-SQL achieves an execution accuracy of 61.08%, compared to the baseline accuracy of 46.35% for vanilla GPT-4 and the baseline accuracy of 57.56% for MAC-SQL. Besides, our approach makes similar progress on Spider. The codes are available at https://github.com/LancelotXWX/MAG-SQL.
Key facts. Cited by 22 papers in the map (data through 7 Oct 2026). Placed in Web, search, and research agents, one of 16 directions in LLM agents and tool use. Builds on 29 of its 32 references that are in the map. First posted on arXiv 15 Aug 2024.
Builds on
29 of 32 references.
Closest ancestors · 1
Same direction, newest first
Other references · 28
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,397
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
- 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 679
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 667
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 465
- 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 420
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 378
- 2019Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representationcited by 210
16 more
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 183
- 2024CHESS: Contextual Harnessing for Efficient SQL Synthesiscited by 164
- 2023C3: Zero-shot Text-to-SQL with ChatGPTcited by 159
- 2017SQLNet: Generating Structured Queries From Natural Language Without Reinforcement Learningcited by 135
- 2021LGESQL: Line Graph Enhanced Text-to-SQL Model with Mixed Local and Non-Local Relationscited by 119
- 2024MCS-SQL: Leveraging Multiple Prompts and Multiple-Choice Selection For Text-to-SQL Generationcited by 103
- 2019A Comprehensive Exploration on WikiSQL with Table-Aware Word Contextualizationcited by 88
- 2023Exploring Chain-of-Thought Style Prompting for Text-to-SQLcited by 69
- 2020RYANSQL: Recursively Applying Sketch-based Slot Fillings for Complex Text-to-SQL in Cross-Domain Databasescited by 63
- 2018Robust Text-to-SQL Generation with Execution-Guided Decodingcited by 51
- 2021SADGA: Structure-Aware Dual Graph Aggregation Network for Text-to-SQLcited by 43
- 2023SQL-PaLM: Improved Large Language Model Adaptation for Text-to-SQL (extended)cited by 42
- 2024Decomposition for Enhancing Attention: Improving LLM-based Text-to-SQL through Workflow Paradigmcited by 31
- 2021Improving Text-to-SQL with Schema Dependency Learningcited by 25
- 2021Weakly Supervised Text-to-SQL Parsing through Question Decompositioncited by 15
- 2018Dynamic Self-Attention : Computing Attention over Words Dynamically for Sentence Embeddingcited by 8
Built on by
Citing papers per year: 2024: 2; 2025: 15; 2026: 5.
22 papers.
Sort:
By area:
- 2024RSL-SQL: Robust Schema Linking in Text-to-SQL Generationcited by 51
- 2025Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errorscited by 14
- 2025MTIR-SQL: Multi-turn Tool-Integrated Reasoning Reinforcement Learning for Text-to-SQLcited by 10
- 2025ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQLcited by 8
- 2025Text-to-SQL as Dual-State Reasoning: Integrating Adaptive Context and Progressive Generationcited by 8
- 2025LearNAT: Learning NL2SQL with AST-guided Task Decomposition for Large Language Modelscited by 7
- 2026APEX-SQL: Talking to the data via Agentic Exploration for Text-to-SQLcited by 7
- 2025DB-Explore: Automated Database Exploration and Instruction Synthesis for Text-to-SQLcited by 5
- 2025Exploring the Landscape of Text-to-SQL with Large Language Models: Progresses, Challenges and Opportunitiescited by 4
- 2025Chain-of-Query: Unleashing the Power of LLMs in SQL-Aided Table Understanding via Multi-Agent Collaborationcited by 4
- 2025Training-Free Time Series Classification via In-Context Reasoning with LLM Agentscited by 4
- 2024Evaluating and Enhancing LLMs for Multi-turn Text-to-SQL with Multiple Question Typescited by 3
10 more
- 2025Text2Schema: Filling the Gap in Designing Database Table Structures based on Natural Languagecited by 2
- 2025SDE-SQL: Enhancing Text-to-SQL Generation in Large Language Models via Self-Driven Exploration with SQL Probescited by 2
- 2025Toward Real-World Table Agents: Capabilities, Workflows, and Design Principles for LLM-based Table Intelligencecited by 2
- 2025GBV-SQL: Guided Generation and SQL2Text Back-Translation Validation for Multi-Agent Text2SQLcited by 1
- 2025Beyond SELECT: A Comprehensive Taxonomy-Guided Benchmark for Real-World Text-to-SQL Translationcited by 1
- 2026Both Ends Count! Just How Good are LLM Agents at "Text-to-Big SQL"?cited by 1
- 2026PExA: Parallel Exploration Agent for Complex Text-to-SQLcited by 1
- 2025Chatting with your ERP: A Recipecited by 0
- 2026DexterSQL: Deep Schema Exploration and Rule-based Correction for Text-to-SQL Generationcited by 0
- 2026ACTS-SQL: Agentic and Critic-Oriented Tree-Structured SQL Correctness with Large Language Modelscited by 0
- 2026ACTS-SQL: Agentic and Critic-Oriented Tree-Structured SQL Correctness with Large Language Models15 Aug 2026
- 2026DexterSQL: Deep Schema Exploration and Rule-based Correction for Text-to-SQL Generation12 Aug 2026
- 2026PExA: Parallel Exploration Agent for Complex Text-to-SQL24 Apr 2026
- 2026Both Ends Count! Just How Good are LLM Agents at "Text-to-Big SQL"?25 Feb 2026
- 2026APEX-SQL: Talking to the data via Agentic Exploration for Text-to-SQL11 Feb 2026
- 2025Text-to-SQL as Dual-State Reasoning: Integrating Adaptive Context and Progressive Generation26 Nov 2025
- 2025Beyond SELECT: A Comprehensive Taxonomy-Guided Benchmark for Real-World Text-to-SQL Translation17 Nov 2025
- 2025MTIR-SQL: Multi-turn Tool-Integrated Reasoning Reinforcement Learning for Text-to-SQL29 Oct 2025
- 2025Training-Free Time Series Classification via In-Context Reasoning with LLM Agents7 Oct 2025
- 2025GBV-SQL: Guided Generation and SQL2Text Back-Translation Validation for Multi-Agent Text2SQL16 Sep 2025
- 2025Chain-of-Query: Unleashing the Power of LLMs in SQL-Aided Table Understanding via Multi-Agent Collaboration14 Aug 2025
- 2025Chatting with your ERP: A Recipe31 Jul 2025
10 more
- 2025Toward Real-World Table Agents: Capabilities, Workflows, and Design Principles for LLM-based Table Intelligence14 Jul 2025
- 2025SDE-SQL: Enhancing Text-to-SQL Generation in Large Language Models via Self-Driven Exploration with SQL Probes8 Jun 2025
- 2025Exploring the Landscape of Text-to-SQL with Large Language Models: Progresses, Challenges and Opportunities28 May 2025
- 2025ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQL19 May 2025
- 2025LearNAT: Learning NL2SQL with AST-guided Task Decomposition for Large Language Models3 Apr 2025
- 2025Text2Schema: Filling the Gap in Designing Database Table Structures based on Natural Language31 Mar 2025
- 2025DB-Explore: Automated Database Exploration and Instruction Synthesis for Text-to-SQL6 Mar 2025
- 2025Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errors16 Jan 2025
- 2024Evaluating and Enhancing LLMs for Multi-turn Text-to-SQL with Multiple Question Types21 Dec 2024
- 2024RSL-SQL: Robust Schema Linking in Text-to-SQL Generation31 Oct 2024
- 2026APEX-SQL: Talking to the data via Agentic Exploration for Text-to-SQLcited by 7
- 2025Chain-of-Query: Unleashing the Power of LLMs in SQL-Aided Table Understanding via Multi-Agent Collaborationcited by 4
- 2025Toward Real-World Table Agents: Capabilities, Workflows, and Design Principles for LLM-based Table Intelligencecited by 2
- 2025GBV-SQL: Guided Generation and SQL2Text Back-Translation Validation for Multi-Agent Text2SQLcited by 1
- 2026Both Ends Count! Just How Good are LLM Agents at "Text-to-Big SQL"?cited by 1
- 2026PExA: Parallel Exploration Agent for Complex Text-to-SQLcited by 1
- 2026ACTS-SQL: Agentic and Critic-Oriented Tree-Structured SQL Correctness with Large Language Modelscited by 0
- 2026ACTS-SQL: Agentic and Critic-Oriented Tree-Structured SQL Correctness with Large Language Models15 Aug 2026
- 2026PExA: Parallel Exploration Agent for Complex Text-to-SQL24 Apr 2026
- 2026Both Ends Count! Just How Good are LLM Agents at "Text-to-Big SQL"?25 Feb 2026
- 2026APEX-SQL: Talking to the data via Agentic Exploration for Text-to-SQL11 Feb 2026
- 2025GBV-SQL: Guided Generation and SQL2Text Back-Translation Validation for Multi-Agent Text2SQL16 Sep 2025
- 2025Chain-of-Query: Unleashing the Power of LLMs in SQL-Aided Table Understanding via Multi-Agent Collaboration14 Aug 2025
- 2025Toward Real-World Table Agents: Capabilities, Workflows, and Design Principles for LLM-based Table Intelligence14 Jul 2025
- 2025MTIR-SQL: Multi-turn Tool-Integrated Reasoning Reinforcement Learning for Text-to-SQLcited by 10
- 2025ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQLcited by 8
- 2025Text-to-SQL as Dual-State Reasoning: Integrating Adaptive Context and Progressive Generationcited by 8
- 2025Training-Free Time Series Classification via In-Context Reasoning with LLM Agentscited by 4
- 2025Text-to-SQL as Dual-State Reasoning: Integrating Adaptive Context and Progressive Generation26 Nov 2025
- 2025MTIR-SQL: Multi-turn Tool-Integrated Reasoning Reinforcement Learning for Text-to-SQL29 Oct 2025
- 2025Training-Free Time Series Classification via In-Context Reasoning with LLM Agents7 Oct 2025
- 2025ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQL19 May 2025
- 2024RSL-SQL: Robust Schema Linking in Text-to-SQL Generationcited by 51
- 2025Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errorscited by 14
- 2025LearNAT: Learning NL2SQL with AST-guided Task Decomposition for Large Language Modelscited by 7
- 2025Exploring the Landscape of Text-to-SQL with Large Language Models: Progresses, Challenges and Opportunitiescited by 4
- 2024Evaluating and Enhancing LLMs for Multi-turn Text-to-SQL with Multiple Question Typescited by 3
- 2025Text2Schema: Filling the Gap in Designing Database Table Structures based on Natural Languagecited by 2
- 2025SDE-SQL: Enhancing Text-to-SQL Generation in Large Language Models via Self-Driven Exploration with SQL Probescited by 2
- 2025Beyond SELECT: A Comprehensive Taxonomy-Guided Benchmark for Real-World Text-to-SQL Translationcited by 1
- 2025Chatting with your ERP: A Recipecited by 0
- 2026DexterSQL: Deep Schema Exploration and Rule-based Correction for Text-to-SQL Generationcited by 0
- 2026DexterSQL: Deep Schema Exploration and Rule-based Correction for Text-to-SQL Generation12 Aug 2026
- 2025Beyond SELECT: A Comprehensive Taxonomy-Guided Benchmark for Real-World Text-to-SQL Translation17 Nov 2025
- 2025Chatting with your ERP: A Recipe31 Jul 2025
- 2025SDE-SQL: Enhancing Text-to-SQL Generation in Large Language Models via Self-Driven Exploration with SQL Probes8 Jun 2025
- 2025Exploring the Landscape of Text-to-SQL with Large Language Models: Progresses, Challenges and Opportunities28 May 2025
- 2025LearNAT: Learning NL2SQL with AST-guided Task Decomposition for Large Language Models3 Apr 2025
- 2025Text2Schema: Filling the Gap in Designing Database Table Structures based on Natural Language31 Mar 2025
- 2025Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errors16 Jan 2025
- 2024Evaluating and Enhancing LLMs for Multi-turn Text-to-SQL with Multiple Question Types21 Dec 2024
- 2024RSL-SQL: Robust Schema Linking in Text-to-SQL Generation31 Oct 2024
Similar, not cited
Close in wording, no citation either way
- 2026AV-SQL: Decomposing Complex Text-to-SQL Queries with Agentic Views
- 2025SQL-of-Thought: Multi-agentic Text-to-SQL with Guided Error Correction
- 2025AGENTIQL: An Agent-Inspired Multi-Expert Framework for Text-to-SQL Generation
- 2024PET-SQL: A Prompt-Enhanced Two-Round Refinement of Text-to-SQL with Cross-consistency
- 2024Cooperative SQL Generation for Segmented Databases By Using Multi-functional LLM Agents
- 2025RAISE: Reasoning Agent for Interactive SQL Exploration
- 2025SING-SQL: A Synthetic Data Generation Framework for In-Domain Text-to-SQL Translation
- 2024ROUTE: Robust Multitask Tuning and Collaboration for Text-to-SQL