PURPLE: Making a Large Language Model a Better SQL Writer
Not on the map. Why?
Abstract (arXiv)
Large Language Model (LLM) techniques play an increasingly important role in Natural Language to SQL (NL2SQL) translation. LLMs trained by extensive corpora have strong natural language understanding and basic SQL generation abilities without additional tuning specific to NL2SQL tasks. Existing LLMs-based NL2SQL approaches try to improve the translation by enhancing the LLMs with an emphasis on user intention understanding. However, LLMs sometimes fail to generate appropriate SQL due to their lack of knowledge in organizing complex logical operator composition. A promising method is to input the LLMs with demonstrations, which include known NL2SQL translations from various databases. LLMs can learn to organize operator compositions from the input demonstrations for the given task. In this paper, we propose PURPLE (Pre-trained models Utilized to Retrieve Prompts for Logical Enhancement), which improves accuracy by retrieving demonstrations containing the requisite logical operator composition for the NL2SQL task on hand, thereby guiding LLMs to produce better SQL translation. PURPLE achieves a new state-of-the-art performance of 80.5% exact-set match accuracy and 87.8% execution match accuracy on the validation set of the popular NL2SQL benchmark Spider. PURPLE maintains high accuracy across diverse benchmarks, budgetary constraints, and various LLMs, showing robustness and cost-effectiveness.
Key facts. Cited by 34 papers in the map (data through 14 Oct 2026). Builds on 46 of its 65 references that are in the map. First posted on arXiv 29 Mar 2024.
Builds on
46 of 65 references.
References · 46
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,893
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
- 2023Teaching Large Language Models to Self-Debugcited by 988
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 477
- 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 424
- 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 411
34 more
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 385
- 2022RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learningcited by 366
- 2022Dynamic Prompt Learning via Policy Gradient for Semi-structured Mathematical Reasoningcited by 350
- 2017Beam Search Strategies for Neural Machine Translationcited by 232
- 2019Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representationcited by 210
- 2023RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLcited by 195
- 2023C3: Zero-shot Text-to-SQL with ChatGPTcited by 164
- 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
- 2020Bridging Textual and Tabular Data for Cross-Domain Text-to-SQL Semantic Parsingcited by 133
- 2020Semantic Evaluation for Text-to-SQL with Distilled Test Suitescited by 126
- 2020Structure-Grounded Pretraining for Text-to-SQLcited by 126
- 2021LGESQL: Line Graph Enhanced Text-to-SQL Model with Mixed Local and Non-Local Relationscited by 119
- 2023A comprehensive evaluation of ChatGPT's zero-shot Text-to-SQL capabilitycited by 119
- 2021Towards Robustness of Text-to-SQL Models against Synonym Substitutioncited by 110
- 2022Evaluating the Text-to-SQL Capabilities of Large Language Modelscited by 101
- 2020SmBoP: Semi-autoregressive Bottom-up Semantic Parsingcited by 97
- 2023Graphix-T5: Mixing Pre-Trained Transformers with Graph-Aware Layers for Text-to-SQL Parsingcited by 93
- 2021Exploring Underexplored Limitations of Cross-Domain Text-to-SQL Generalizationcited by 92
- 2022RASAT: Integrating Relational Structures into Pretrained Seq2Seq Model for Text-to-SQLcited by 85
- 2019Representing Schema Structure with Graph Neural Networks for Text-to-SQL Parsingcited by 74
- 2023Exploring Chain-of-Thought Style Prompting for Text-to-SQLcited by 69
- 2021Natural SQL: Making SQL Easier to Infer from Natural Language Specificationscited by 68
- 2022Prompt Consistency for Zero-Shot Task Generalizationcited by 67
- 2023How to Prompt LLMs for Text-to-SQL: A Study in Zero-shot, Single-domain, and Cross-domain Settingscited by 58
- 2023Skill-Based Few-Shot Selection for In-Context Learningcited by 46
- 2023Enhancing Few-shot Text-to-SQL Capabilities of Large Language Models: A Study on Prompt Design Strategiescited by 45
- 2019Global Reasoning over Database Structures for Text-to-SQL Parsingcited by 43
- 2022S2SQL: Injecting Syntax to Question-Schema Interaction Graph Encoder for Text-to-SQL Parserscited by 41
- 2023Interleaving Pre-Trained Language Models and Large Language Models for Zero-Shot NL2SQL Generationcited by 24
- 2023Divide and Prompt: Chain of Thought Prompting for Text-to-SQLcited by 20
- 2022N-Best Hypotheses Reranking for Text-To-SQL Systemscited by 19
- 2024Metasql: A Generate-then-Rank Framework for Natural Language to SQL Translationcited by 17
- 2023Retrieval-augmented GPT-3.5-based Text-to-SQL Framework with Sample-aware Prompting and Dynamic Revision Chaincited by 12
- 2023Adapt and Decompose: Efficient Generalization of Text-to-SQL via Domain Adapted Least-To-Most Promptingcited by 8
Built on by
Citing papers per year: 2024: 8; 2025: 17; 2026: 9.
34 papers.
Sort:
By area:
- 2024Next-Generation Database Interfaces: A Survey of LLM-based Text-to-SQLcited by 120
- 2024A Survey on Employing Large Language Models for Text-to-SQL Taskscited by 67
- 2024A Survey of Text-to-SQL in the Era of LLMs: Where are we, and where are we going?cited by 56
- 2025Reliable Text-to-SQL with Adaptive Abstentioncited by 20
- 2025Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errorscited by 14
- 2024NAT-NL2GQL: A Novel Multi-Agent Framework for Translating Natural Language to Graph Query Languagecited by 9
- 2025Knapsack Optimization-based Schema Linking for LLM-based Text-to-SQL Generationcited by 9
- 2024Grounding Natural Language to SQL Translation with Data-Based Self-Explanationscited by 8
- 2024DataLab: A Unified Platform for LLM-Powered Business Intelligencecited by 8
- 2025ReEx-SQL: Reasoning with Execution-Aware Reinforcement Learning for Text-to-SQLcited by 8
- 2025AGRAG: Advanced Graph-based Retrieval-Augmented Generation for LLMscited by 7
- 2025Exploring the Landscape of Text-to-SQL with Large Language Models: Progresses, Challenges and Opportunitiescited by 4
22 more
- 2025SEED: Enhancing Text-to-SQL Performance and Practical Usability Through Automatic Evidence Generationcited by 4
- 2024Towards Robustness of Text-to-Visualization Translation against Lexical and Phrasal Variabilitycited by 2
- 2024Multi-Turn Interactions for Text-to-SQL with Large Language Modelscited by 2
- 2025Feather-SQL: A Lightweight NL2SQL Framework with Dual-Model Collaboration Paradigm for Small Language Modelscited by 2
- 2025Toward Real-World Table Agents: Capabilities, Workflows, and Design Principles for LLM-based Table Intelligencecited by 2
- 2025LoopServe: An Adaptive Dual-phase LLM Inference Acceleration System for Multi-Turn Dialoguescited by 2
- 2025Exploring Database Normalization Effects on SQL Generationcited by 2
- 2025GBV-SQL: Guided Generation and SQL2Text Back-Translation Validation for Multi-Agent Text2SQLcited by 1
- 2025DeKeyNLU: Enhancing Natural Language to SQL Generation through Task Decomposition and Keyword Extractioncited by 1
- 2025ORANGE: An Online Reflection ANd GEneration framework with Domain Knowledge for Text-to-SQLcited by 1
- 2025Beyond SELECT: A Comprehensive Taxonomy-Guided Benchmark for Real-World Text-to-SQL Translationcited by 1
- 2025Scaling Text2SQL via LLM-efficient Schema Filtering with Functional Dependency Graph Rerankerscited by 1
- 2026Beyond Static Pipelines: Learning Dynamic Workflows for Text-to-SQLcited by 1
- 2026ODUTQA-MDC: A Task for Open-Domain Underspecified Tabular QA with Multi-turn Dialogue-based Clarificationcited by 1
- 2026NL2SQLBench: A Modular Benchmarking Framework for LLM-Enabled NL2SQL Solutionscited by 1
- 2025OsmT: Bridging OpenStreetMap Queries and Natural Language with Open-source Tag-aware Language Modelscited by 0
- 2026Accurate Table Question Answering with Accessible LLMscited by 0
- 2026LEAF-SQL: Level-wise Exploration with Adaptive Fine-graining for Text-to-SQL Skeleton Predictioncited by 0
- 2026When Cognitive Graphs Meet LLMs: BDEI Cognitive Pathways for Panic Emotional Arousal Predictioncited by 0
- 2026Database Context Compression for Text-to-SQL on Real-World Large Databasescited by 0
- 2026Benchmarking Text-to-SQL under Role-Based Access Controlcited by 0
- 2026Are These Modules Worth Their Cost? A Paradigm-Level Accuracy-Cost Analysis of In-context Learning Text-to-SQLcited by 0
- 2026Are These Modules Worth Their Cost? A Paradigm-Level Accuracy-Cost Analysis of In-context Learning Text-to-SQL28 Aug 2026
- 2026Benchmarking Text-to-SQL under Role-Based Access Control24 Jul 2026
- 2026Database Context Compression for Text-to-SQL on Real-World Large Databases26 Jun 2026
- 2026When Cognitive Graphs Meet LLMs: BDEI Cognitive Pathways for Panic Emotional Arousal Prediction13 Jun 2026
- 2026LEAF-SQL: Level-wise Exploration with Adaptive Fine-graining for Text-to-SQL Skeleton Prediction10 May 2026
- 2026NL2SQLBench: A Modular Benchmarking Framework for LLM-Enabled NL2SQL Solutions13 Apr 2026
- 2026ODUTQA-MDC: A Task for Open-Domain Underspecified Tabular QA with Multi-turn Dialogue-based Clarification11 Apr 2026
- 2026Beyond Static Pipelines: Learning Dynamic Workflows for Text-to-SQL17 Feb 2026
- 2026Accurate Table Question Answering with Accessible LLMs6 Jan 2026
- 2025Scaling Text2SQL via LLM-efficient Schema Filtering with Functional Dependency Graph Rerankers18 Dec 2025
- 2025OsmT: Bridging OpenStreetMap Queries and Natural Language with Open-source Tag-aware Language Models4 Dec 2025
- 2025Beyond SELECT: A Comprehensive Taxonomy-Guided Benchmark for Real-World Text-to-SQL Translation17 Nov 2025
22 more
- 2025AGRAG: Advanced Graph-based Retrieval-Augmented Generation for LLMs2 Nov 2025
- 2025ORANGE: An Online Reflection ANd GEneration framework with Domain Knowledge for Text-to-SQL2 Nov 2025
- 2025Exploring Database Normalization Effects on SQL Generation2 Oct 2025
- 2025DeKeyNLU: Enhancing Natural Language to SQL Generation through Task Decomposition and Keyword Extraction18 Sep 2025
- 2025GBV-SQL: Guided Generation and SQL2Text Back-Translation Validation for Multi-Agent Text2SQL16 Sep 2025
- 2025LoopServe: An Adaptive Dual-phase LLM Inference Acceleration System for Multi-Turn Dialogues18 Jul 2025
- 2025Toward Real-World Table Agents: Capabilities, Workflows, and Design Principles for LLM-based Table Intelligence14 Jul 2025
- 2025SEED: Enhancing Text-to-SQL Performance and Practical Usability Through Automatic Evidence Generation9 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
- 2025Feather-SQL: A Lightweight NL2SQL Framework with Dual-Model Collaboration Paradigm for Small Language Models22 Mar 2025
- 2025Knapsack Optimization-based Schema Linking for LLM-based Text-to-SQL Generation18 Feb 2025
- 2025Reliable Text-to-SQL with Adaptive Abstention18 Jan 2025
- 2025Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errors16 Jan 2025
- 2024NAT-NL2GQL: A Novel Multi-Agent Framework for Translating Natural Language to Graph Query Language11 Dec 2024
- 2024DataLab: A Unified Platform for LLM-Powered Business Intelligence3 Dec 2024
- 2024Grounding Natural Language to SQL Translation with Data-Based Self-Explanations5 Nov 2024
- 2024Multi-Turn Interactions for Text-to-SQL with Large Language Models9 Aug 2024
- 2024A Survey of Text-to-SQL in the Era of LLMs: Where are we, and where are we going?9 Aug 2024
- 2024A Survey on Employing Large Language Models for Text-to-SQL Tasks21 Jul 2024
- 2024Next-Generation Database Interfaces: A Survey of LLM-based Text-to-SQL12 Jun 2024
- 2024Towards Robustness of Text-to-Visualization Translation against Lexical and Phrasal Variability10 Apr 2024
- 2024NAT-NL2GQL: A Novel Multi-Agent Framework for Translating Natural Language to Graph Query Languagecited by 9
- 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
- 2025GBV-SQL: Guided Generation and SQL2Text Back-Translation Validation for Multi-Agent Text2SQL16 Sep 2025
- 2025Toward Real-World Table Agents: Capabilities, Workflows, and Design Principles for LLM-based Table Intelligence14 Jul 2025
- 2024NAT-NL2GQL: A Novel Multi-Agent Framework for Translating Natural Language to Graph Query Language11 Dec 2024
- 2024Next-Generation Database Interfaces: A Survey of LLM-based Text-to-SQLcited by 120
- 2024A Survey on Employing Large Language Models for Text-to-SQL Taskscited by 67
- 2024A Survey of Text-to-SQL in the Era of LLMs: Where are we, and where are we going?cited by 56
- 2025Reliable Text-to-SQL with Adaptive Abstentioncited by 20
- 2025Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errorscited by 14
- 2025Knapsack Optimization-based Schema Linking for LLM-based Text-to-SQL Generationcited by 9
- 2024Grounding Natural Language to SQL Translation with Data-Based Self-Explanationscited by 8
- 2024DataLab: A Unified Platform for LLM-Powered Business Intelligencecited by 8
- 2025Exploring the Landscape of Text-to-SQL with Large Language Models: Progresses, Challenges and Opportunitiescited by 4
- 2025SEED: Enhancing Text-to-SQL Performance and Practical Usability Through Automatic Evidence Generationcited by 4
- 2024Towards Robustness of Text-to-Visualization Translation against Lexical and Phrasal Variabilitycited by 2
- 2025Feather-SQL: A Lightweight NL2SQL Framework with Dual-Model Collaboration Paradigm for Small Language Modelscited by 2
12 most cited of 26 All 26 (JSON)
- 2026Are These Modules Worth Their Cost? A Paradigm-Level Accuracy-Cost Analysis of In-context Learning Text-to-SQL28 Aug 2026
- 2026Benchmarking Text-to-SQL under Role-Based Access Control24 Jul 2026
- 2026Database Context Compression for Text-to-SQL on Real-World Large Databases26 Jun 2026
- 2026When Cognitive Graphs Meet LLMs: BDEI Cognitive Pathways for Panic Emotional Arousal Prediction13 Jun 2026
- 2026LEAF-SQL: Level-wise Exploration with Adaptive Fine-graining for Text-to-SQL Skeleton Prediction10 May 2026
- 2026NL2SQLBench: A Modular Benchmarking Framework for LLM-Enabled NL2SQL Solutions13 Apr 2026
- 2026ODUTQA-MDC: A Task for Open-Domain Underspecified Tabular QA with Multi-turn Dialogue-based Clarification11 Apr 2026
- 2026Beyond Static Pipelines: Learning Dynamic Workflows for Text-to-SQL17 Feb 2026
- 2026Accurate Table Question Answering with Accessible LLMs6 Jan 2026
- 2025Scaling Text2SQL via LLM-efficient Schema Filtering with Functional Dependency Graph Rerankers18 Dec 2025
- 2025OsmT: Bridging OpenStreetMap Queries and Natural Language with Open-source Tag-aware Language Models4 Dec 2025
- 2025Beyond SELECT: A Comprehensive Taxonomy-Guided Benchmark for Real-World Text-to-SQL Translation17 Nov 2025
12 newest of 26 All 26 (JSON)