MCS-SQL: Leveraging Multiple Prompts and Multiple-Choice Selection For Text-to-SQL Generation

Authors: Dongjun Lee, Choongwon Park, Jaehyuk Kim, Heesoo Park

Submitted to arXiv on 13 May. 2024
License: CC BY 4.0
Abstract

Recent advancements in large language models (LLMs) have enabled in-context learning (ICL)-based methods that significantly outperform fine-tuning approaches for text-to-SQL tasks. However, their performance is still considerably lower than that of human experts on benchmarks that include complex schemas and queries, such as BIRD. This study considers the sensitivity of LLMs to the prompts and introduces a novel approach that leverages multiple prompts to explore a broader search space for possible answers and effectively aggregate them. Specifically, we robustly refine the database schema through schema linking using multiple prompts. Thereafter, we generate various candidate SQL queries based on the refined schema and diverse prompts. Finally, the candidate queries are filtered based on their confidence scores, and the optimal query is obtained through a multiple-choice selection that is presented to the LLM. When evaluated on the BIRD and Spider benchmarks, the proposed method achieved execution accuracies of 65.5\% and 89.6\%, respectively, significantly outperforming previous ICL-based methods. Moreover, we established a new SOTA performance on the BIRD in terms of both the accuracy and efficiency of the generated queries.

The papers around it, by date and closeness

Higher is closer to this paper; left is older. Lines join papers close to each other: groups of lines are sub-topics. Select a point to see why it is there. Back to the summary of this paper

How to read this map? Illustrated guide

Closest papers Prior work it builds on Papers that cite it

Papers around this one

Ranked by how close their title and abstract are to this paper’s. Select some to read them together.

Closest papers

  1. Very close Another approach to the problem
    PET-SQL: A Prompt-Enhanced Two-Round Refinement of Text-to-SQL with Cross-consistency
    Zhishuai Li, Xiang Wang, Jingjing Zhao et al. · 2024 · Computation and Language · cited 41 times · Not summarized yet

    PET-SQL uses reference-enhanced prompts, retrieved examples, and two-round refinement to generate Text-to-SQL, while MCS-SQL explores multiple prompts and selects among candidate queries.

    Abstract

    Recent advancements in Text-to-SQL (Text2SQL) emphasize stimulating the large language models (LLM) on in-context learning, achieving significant results. Nevertheless, they face challenges when dealing with verbose database information and complex user intentions. This paper presents a two-stage framework to enhance the performance of current LLM-based natural language to SQL systems. We first introduce a novel prompt representation, called reference-enhanced representation, which includes schema information and randomly sampled cell values from tables to instruct LLMs in generating SQL queries. Then, in the first stage, question-SQL pairs are retrieved as few-shot demonstrations, prompting…

  2. Very close Another approach to the problem
    Enhancing Text-to-SQL Capabilities of Large Language Models through Tailored Promptings
    Zhao Tan, X. Liu, Qing Shu et al. · 2024 · International Conference on Language Resources and Evaluation · cited 29 times · Not summarized yet

    Tailored Promptings guide table identification and clause-by-clause SQL generation, whereas MCS-SQL generates candidates from diverse prompts and selects among them.

    Abstract

    Large language models (LLMs) with prompting have achieved encouraging results on many natural language processing (NLP) tasks based on task-tailored promptings. Text-to-SQL is a critical task that generates SQL queries from natural language questions. However, prompting on LLMs haven’t show superior performance on Text-to-SQL task due to the absence of tailored promptings. In this work, we propose three promptings specifically designed for Text-to-SQL: SL-prompt, CC-prompt, and SL+CC prompt. SL-prompt is designed to guide LLMs to identify relevant tables; CC-prompt directs LLMs to generate SQL clause by clause; and SL+CC prompt is proposed to combine the strengths of these above promptings. …

  3. Very close Another approach to the problem
    Revealing the powerful ability of large language model prompts in Text-to-SQL tasks
    Zhihua Duan, Jialin Wang · 2024 · Other Conferences · Not summarized yet

    This framework uses JSON examples and chain-of-thought prompting for Text-to-SQL, while MCS-SQL refines schemas and selects among multiple candidate queries.

    Abstract

    Text-to-SQL is an important research direction in the field of artificial intelligence. This paper introduces a novel Text-to-SQL application framework based on large language models (LLMs), aiming to achieve more accurate Text-to-SQL generation. We propose three methods to effectively leverage the synergy between LLMs and Text-to-SQL prompts. Firstly, we employ prompt words in JSON format that include database query examples. Through interaction with LLMs, accurate SQL statements can be generated. Secondly, we utilize the Chain of Thought (CoT) prompt word method, prompting the model with query tables, fields, and conditions to generate SQL statements that comply with grammar rules. Finally…

  4. Very close Builds on this paper Cites this paper
    AGCS-SQL: Adaptive SQL Generation and Confidence-Aware Selection for Text-to-SQL
    Hong-Fu Jia, Xue-Jian Zhao, Qing-Yuan Ma et al. · 2026 · IEEE International Joint Conference on Neural Network · Not summarized yet

    AGCS-SQL cites MCS-SQL and also selects candidate SQL queries, adding difficulty-based routing and confidence-aware selection.

    Abstract

    Recent advancements in large language models (LLMs) have significantly propelled the performance of Text to-SQL tasks. However, existing LLM-based approaches still struggle with complex queries, where a unified generation strategy fails to accommodate varying reasoning difficulty, and candidate selection methods based on self-consistency often conflate execution frequency with correctness. In this paper, we propose AGCS-SQL, a Text-to-SQL framework that combines adaptive SQL generation with confidence-aware selection. AGCS-SQL first predicts query difficulty and dynamically routes queries to different generation strategies. For complex queries, it adopts a structure-content decoupled generat…

  5. Very close Builds on this paper Cites this paper
    CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQL
    Mohammadreza Pourreza, Hailong Li, Ruoxi Sun et al. · 2024 · International Conference on Learning Representations · cited 242 times · Not summarized yet

    CHASE-SQL cites MCS-SQL and generates diverse SQL candidates for selection, adding multi-agent reasoning and preference optimization.

    Abstract

    In tackling the challenges of large language model (LLM) performance for Text-to-SQL tasks, we introduce CHASE-SQL, a new framework that employs innovative strategies, using test-time compute in multi-agent modeling to improve candidate generation and selection. CHASE-SQL leverages LLMs' intrinsic knowledge to generate diverse and high-quality SQL candidates using different LLM generators with: (1) a divide-and-conquer method that decomposes complex queries into manageable sub-queries in a single LLM call; (2) chain-of-thought reasoning based on query execution plans, reflecting the steps a database engine takes during execution; and (3) a unique instance-aware synthetic example generation t…

  6. Very close Another approach to the problem
    Retrieval-augmented GPT-3.5-based Text-to-SQL Framework with Sample-aware Prompting and Dynamic Revision Chain
    Chunxi Guo, Zhiliang Tian, Jintao Tang et al. · 2023 · Information Retrieval · cited 33 times · AI summary available

    This framework retrieves sample-aware demonstrations and uses a dynamic revision chain, while MCS-SQL varies prompts and selects among generated queries.

    Abstract

    Text-to-SQL aims at generating SQL queries for the given natural language questions and thus helping users to query databases. Prompt learning with large language models (LLMs) has emerged as a recent approach, which designs prompts to lead LLMs to understand the input question and generate the corresponding SQL. However, it faces challenges with strict SQL syntax requirements. Existing work prompts the LLMs with a list of demonstration examples (i.e. question-SQL pairs) to generate SQL, but the fixed prompts can hardly handle the scenario where the semantic gap between the retrieved demonstration and the input question is large. In this paper, we propose a retrieval-augmented prompting meth…

  7. Very close Another approach to the problem
    Integrating Non-Parametric Attention and Prompt Refinement to Enhance LLM-Based Text-to-SQL Without External Knowledge
    Shouvon Sarker, Li-Jun Qian, Xi-Shuang Dong · 2025 · 2025 IEEE International Conference on Data Mining Workshops (ICDMW) · Not summarized yet

    This method combines non-parametric attention with prompt refinement for Text-to-SQL, whereas MCS-SQL uses multiple prompts and candidate selection.

    Abstract

    Text-to-SQL enables users without specialized database expertise to efficiently retrieve information by automatically translating natural language (NL) queries into machine-executable SQL statements. Recently, large language model (LLM)-based Text-to-SQL approaches have demonstrated remarkable performance by leveraging in-context learning and fine-tuning strategies. In particular, LLM-based Text-to-SQL without external knowledge offers a cost-effective solution while still achieving competitive performance compared to knowledge-enhanced methods. This study proposes a novel approach that integrates non-parametric attention and prompt refinement to further enhance LLM-based Text-to-SQL without…

  8. Very close Another approach to the problem
    MageSQL: Enhancing In-context Learning for Text-to-SQL Applications with Large Language Models
    Chen Shen, Jin Wang, Sajjadur Rahman et al. · 2025 · VLDB Workshops · cited 8 times · Not summarized yet

    MageSQL enhances in-context Text-to-SQL with contextual information and feedback, while MCS-SQL refines schema linking and selects among candidate queries.

    Abstract

    The text-to-SQL problem aims to translate natural language questions into SQL statements to ease the interaction between database systems and end users. Recently, Large Language Models (LLMs) have exhibited impressive capabilities in a variety of tasks, including text-to-SQL. While prior works have explored various strategies for prompting LLMs to generate SQL statements, they still fall short of fully harnessing the power of LLM due to the lack of (1) high-quality contextual information when constructing the prompts and (2) robust feedback mechanisms to correct translation errors. To address these challenges, we propose MageSQL, a text-to-SQL approach based on in-context learning over LLMs.…

Prior work it builds on

  1. Close Groundwork for this paper Used in depth by this paper A method it uses
    Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLs
    Jinyang Li, Binyuan Hui, Ge Qu et al. · 2023 · Computation and Language · cited 1,358 times · AI summary available

    BIRD introduces a large-scale database-grounded Text-to-SQL benchmark that MCS-SQL uses to evaluate its approach.

    Abstract

    Text-to-SQL parsing, which aims at converting natural language instructions into executable SQLs, has gained increasing attention in recent years. In particular, Codex and ChatGPT have shown impressive results in this task. However, most of the prevalent benchmarks, i.e., Spider, and WikiSQL, focus on database schema with few rows of database contents leaving the gap between academic study and real-world applications. To mitigate this gap, we present Bird, a big benchmark for large-scale database grounded in text-to-SQL tasks, containing 12,751 pairs of text-to-SQL data and 95 databases with a total size of 33.4 GB, spanning 37 professional domains. Our emphasis on database values highlights…

  2. Close Groundwork for this paper A method it uses
    DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
    Mohammadreza Pourreza, Davood Rafiei · 2023 · Computation and Language · cited 984 times · AI summary available

    DIN-SQL decomposes Text-to-SQL into subproblems and uses self-correction, providing prior in-context methods that MCS-SQL cites.

    Abstract

    We study the problem of decomposing a complex text-to-sql task into smaller sub-tasks and how such a decomposition can significantly improve the performance of Large Language Models (LLMs) in the reasoning process. There is currently a significant gap between the performance of fine-tuned models and prompting approaches using LLMs on challenging text-to-sql datasets such as Spider. We show that SQL queries, despite their declarative structure, can be broken down into sub-problems and the solutions of those sub-problems can be fed into LLMs to significantly improve their performance. Our experiments with three LLMs show that this approach consistently improves their performance by roughly 10%…

  3. Very close Groundwork for this paper
    Exploring Chain-of-Thought Style Prompting for Text-to-SQL
    Chang-You Tai, Ziru Chen, Tianshu Zhang et al. · 2023 · Conference on Empirical Methods in Natural Language Processing · cited 132 times · Not summarized yet

    This study tests chain-of-thought prompting for Text-to-SQL reasoning, an in-context prompting approach cited by MCS-SQL.

    Abstract

    In-context learning with large language models (LLMs) has recently caught increasing attention due to its superior few-shot performance on various tasks. However, its performance on text-to-SQL parsing still has much room for improvement. In this paper, we hypothesize that a crucial aspect of LLMs to improve for text-to-SQL parsing is their multi-step reasoning ability. Thus, we systematically study how to enhance LLMs' reasoning ability through chain of thought (CoT) style prompting, including the original chain-of-thought prompting (Wei et al., 2022b) and least-to-most prompting (Zhou et al., 2023). Our experiments demonstrate that iterative prompting as in Zhou et al. (2023) may be unnece…

  4. Very close Groundwork for this paper
    Enhancing Text-to-SQL Capabilities of Large Language Models: A Study on Prompt Design Strategies
    Linyong Nan, Yilun Zhao, Weijin Zou et al. · 2023 · Conference on Empirical Methods in Natural Language Processing · cited 88 times · Not summarized yet

    This study examines prompt-design strategies for Text-to-SQL and is cited by MCS-SQL as prior work.

    Abstract

    ,

  5. Close Groundwork for this paper
    Prompting GPT-3.5 for Text-to-SQL with De-semanticization and Skeleton Retrieval
    Chunxi Guo, Zhiliang Tian, Jintao Tang et al. · 2023 · Pacific Rim International Conference on Artificial Intelligence · cited 35 times · Not summarized yet

    This framework retrieves demonstrations using de-semanticization and SQL skeletons, a prior prompting approach cited by MCS-SQL.

    Abstract

    Text-to-SQL is a task that converts a natural language question into a structured query language (SQL) to retrieve information from a database. Large language models (LLMs) work well in natural language generation tasks, but they are not specifically pre-trained to understand the syntax and semantics of SQL commands. In this paper, we propose an LLM-based framework for Text-to-SQL which retrieves helpful demonstration examples to prompt LLMs. However, questions with different database schemes can vary widely, even if the intentions behind them are similar and the corresponding SQL queries exhibit similarities. Consequently, it becomes crucial to identify the appropriate SQL demonstrations th…

Papers that cite it

  1. Very close Review Uses this paper in depth
    A Survey on Employing Large Language Models for Text-to-SQL Tasks
    Liang Shi, Zheng-Ju Tang, Nan Zhang et al. · 2024 · ACM Computing Surveys · cited 179 times · Not summarized yet

    This survey reviews LLM-based Text-to-SQL benchmarks, prompting, and fine-tuning methods, including work such as MCS-SQL.

    Abstract

    With the development of the Large Language Models (LLMs), a large range of LLM-based Text-to-SQL(Text2SQL) methods have emerged. This survey provides a comprehensive review of LLM-based Text2SQL studies. We first enumerate classic benchmarks and evaluation metrics. For the two mainstream methods, prompt engineering and finetuning, we introduce a comprehensive taxonomy and offer practical insights into each subcategory. We present an overall analysis of the above methods and various models evaluated on well-known datasets and extract some characteristics. Finally, we discuss the challenges and future directions in this field.

  2. Very close Builds on this paper Uses this paper in depth
    DCG-SQL: Enhancing In-Context Learning for Text-to-SQL with Deep Contextual Schema Link Graph
    Jih-Yun Lee, Jin-Seop Lee, Jaehoon Lee et al. · 2025 · Annual Meeting of the Association for Computational Linguistics · cited 15 times · Not summarized yet

    DCG-SQL cites MCS-SQL and improves in-context Text-to-SQL through contextual schema-link graphs for demonstration retrieval.

    Abstract

    Text-to-SQL, which translates a natural language question into an SQL query, has advanced with in-context learning of Large Language Models (LLMs). However, existing methods show little improvement in performance compared to randomly chosen demonstrations, and significant performance drops when smaller LLMs (e.g., Llama 3.1-8B) are used. This indicates that these methods heavily rely on the intrinsic capabilities of hyper-scaled LLMs, rather than effectively retrieving useful demonstrations. In this paper, we propose a novel approach for effectively retrieving demonstrations and generating SQL queries. We construct a Deep Contextual Schema Link Graph, which contains key information and seman…

  3. Very close Builds on this paper Uses this paper in depth
    AID-SQL: Adaptive In-Context Learning of Text-to-SQL with Difficulty-Aware Instruction and Retrieval-Augmented Generation
    Xiuwen Li, Qi-Feng Cai, Yang Shu et al. · 2025 · IEEE International Conference on Data Engineering · cited 10 times · Not summarized yet

    AID-SQL cites MCS-SQL and adds difficulty-aware instructions and retrieval-augmented generation to in-context Text-to-SQL.

    Abstract

    Recent research in Text-to-SQL translation has primarily adopted in-context learning methods leveraging large language models (LLMs), achieving significant progress. However, these methods face challenges in adapting to natural language questions of varying difficulty and the relevance of the few-shot examples provided. In this paper, we propose an adaptive in-context learning approach with difficulty-aware instruction and retrieval-augmented generation to enhance the performance of Text-to-SQL translation (AID-SQL). First, we introduce adaptive instructions for LLMs, which employ precise difficulty classification to apply difficulty-adaptive generative guidelines and chain of thought (CoT) …

  4. Close Builds on this paper Uses this paper in depth
    MAG-SQL: Multi-Agent Generative Approach with Soft Schema Linking and Iterative Sub-SQL Refinement for Text-to-SQL
    Wenxuan Xie, Gaoche Wu, Bo-Wen Zhou · 2024 · arXiv.org · preprint, not peer reviewed · cited 41 times · Not summarized yet

    MAG-SQL cites MCS-SQL and also addresses complex BIRD queries, using soft schema linking, multiple agents, and iterative Sub-SQL refinement.

    Abstract

    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 se…

  5. Close Builds on this paper Uses this paper in depth
    XiYan-SQL: A Novel Multi-Generator Framework for Text-to-SQL
    Yifu Liu, Yin Zhu, Yingqi Gao et al. · 2025 · IEEE Transactions on Knowledge and Data Engineering · cited 62 times · Not summarized yet

    XiYan-SQL cites MCS-SQL and likewise generates multiple SQL candidates for selection, using a multi-generator ensemble and candidate reorganization.

    Abstract

    To leverage the advantages of LLM in addressing challenges in the Text-to-SQL task, we present XiYan-SQL, an innovative framework effectively generating and utilizing multiple SQL candidates. It consists of three components: 1) a Schema Filter module filtering and obtaining multiple relevant schemas; 2) a multi-generator ensemble approach generating multiple high-quality and diverse SQL queries; 3) a selection model with a candidate reorganization strategy implemented to obtain the optimal SQL query. Specifically, for the multi-generator ensemble, we employ a multi-task fine-tuning strategy to enhance the capabilities of SQL generation models for the intrinsic alignment between SQL and text,…

How are these papers found?

We compare the title and abstract of this paper with those of every paper summarized on this site, and with the papers Semantic Scholar recommends, those it cites and those citing it (for a much-cited paper, its most recent citations and, from OpenAlex, the most cited ones). Among the prior work and the follow-ups, the papers that use each other in depth, a method it uses and the much-cited follow-ups come a little higher. The levels (very close, close, related) come from the similarity of the texts, not from a judgment of quality; * marks a paper without an abstract, compared by its title. The sentence under a paper is written by an AI from the two abstracts: check it in the papers. A paper marked not relevant by three readers leaves the list.

Updated on 2 November 2026.

The illustrated guide to the papers around a paper