pith. sign in

arxiv: 2312.11242 · v6 · pith:T3D2FRVOnew · submitted 2023-12-18 · 💻 cs.CL

MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQL

classification 💻 cs.CL
keywords frameworkgpt-4mac-sqltext-to-sqlaccuracyagenttoolsachieves
0
0 comments X
read the original abstract

Recent LLM-based Text-to-SQL methods usually suffer from significant performance degradation on "huge" databases and complex user questions that require multi-step reasoning. Moreover, most existing methods neglect the crucial significance of LLMs utilizing external tools and model collaboration. To address these challenges, we introduce MAC-SQL, a novel LLM-based multi-agent collaborative framework. Our framework comprises a core decomposer agent for Text-to-SQL generation with few-shot chain-of-thought reasoning, accompanied by two auxiliary agents that utilize external tools or models to acquire smaller sub-databases and refine erroneous SQL queries. The decomposer agent collaborates with auxiliary agents, which are activated as needed and can be expanded to accommodate new features or tools for effective Text-to-SQL parsing. In our framework, We initially leverage GPT-4 as the strong backbone LLM for all agent tasks to determine the upper bound of our framework. We then fine-tune an open-sourced instruction-followed model, SQL-Llama, by leveraging Code Llama 7B, to accomplish all tasks as GPT-4 does. Experiments show that SQL-Llama achieves a comparable execution accuracy of 43.94, compared to the baseline accuracy of 46.35 for vanilla GPT-4. At the time of writing, MAC-SQL+GPT-4 achieves an execution accuracy of 59.59 when evaluated on the BIRD benchmark, establishing a new state-of-the-art (SOTA) on its holdout test set (https://github.com/wbbeyourself/MAC-SQL).

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 9 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. ExCyTIn-Bench: Evaluating LLM agents on Cyber Threat Investigation

    cs.CR 2025-07 unverdicted novelty 8.0

    ExCyTIn-Bench is the first benchmark of 7542 questions from Microsoft Sentinel threat investigation graphs, where the best LLM agent achieves a reward of 0.606.

  2. FINER-SQL: Boosting Small Language Models for Text-to-SQL

    cs.DB 2026-05 unverdicted novelty 6.0

    FINER-SQL boosts 3B-parameter small language models to 67.73% and 85% execution accuracy on BIRD and Spider benchmarks via dense memory and atomic rewards in group relative policy optimization, matching larger LLMs at...

  3. Reliable Answers for Recurring Questions: Boosting Text-to-SQL Accuracy with Template Constrained Decoding

    cs.CL 2026-04 unverdicted novelty 6.0

    TeCoD improves Text-to-SQL execution accuracy by up to 36% over in-context learning and cuts latency 2.2x on matched queries by extracting templates from historical pairs and enforcing them with constrained decoding.

  4. AV-SQL: Decomposing Complex Text-to-SQL Queries with Agentic Views

    cs.DB 2026-04 unverdicted novelty 6.0

    AV-SQL uses a pipeline of LLM agents to generate intermediate CTE views that decompose complex Text-to-SQL queries, reaching 70.38% execution accuracy on Spider 2.0.

  5. Knapsack Optimization-based Schema Linking for LLM-based Text-to-SQL Generation

    cs.CL 2025-02 unverdicted novelty 6.0

    KaSLA applies knapsack optimization hierarchically to schema linking for LLM text-to-SQL, claiming better results than large models and improved SQL generation on Spider and BIRD.

  6. Schema-First Retrieval: Embedding Catalogs for Natural Language Analytics

    cs.IR 2026-06 unverdicted novelty 5.0

    Schema-First Retrieval embeds catalog metadata rather than rows and uses parallel retrieval plus reranking to raise table and column recall and cut SQL execution errors on three benchmarks.

  7. AgentNLQ: A General-Purpose Agent for Natural Language to SQL

    cs.AI 2026-05 unverdicted novelty 5.0

    A multi-agent LLM framework with schema enrichment and business rules achieves 78.1% semantic accuracy on the BIRD NL2SQL benchmark.

  8. XiYan-SQL: A Novel Multi-Generator Framework For Text-to-SQL

    cs.CL 2025-07 unverdicted novelty 5.0

    XiYan-SQL achieves SOTA Text-to-SQL accuracy by combining schema filtering, a multi-generator ensemble fine-tuned on varied SQL formats, and a selection model.

  9. CHESS: Contextual Harnessing for Efficient SQL Synthesis

    cs.LG 2024-05 conditional novelty 5.0

    CHESS deploys four LLM agents to retrieve information, prune schemas, generate refined SQL candidates, and validate via unit tests, reporting up to 71.10% accuracy on BIRD with 83% fewer calls than leading proprietary...