MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQL
Bing Wang, Changyu Ren, Jian Yang, Xinnian Liang, Jiaqi Bai, LinZheng, Chai, Zhao Yan, Qian-Wen Zhang, Di Yin, Xing Sun, Zhoujun Li

TL;DR
MAC-SQL introduces a multi-agent framework utilizing external tools and collaborative reasoning to significantly improve Text-to-SQL performance on complex databases, achieving state-of-the-art results.
Contribution
The paper presents MAC-SQL, a novel multi-agent framework that enhances Text-to-SQL tasks by integrating external tools and collaborative reasoning, with a fine-tuned open-source model rivaling GPT-4.
Findings
SQL-Llama achieves 43.94% accuracy, close to GPT-4's 46.35%.
MAC-SQL+GPT-4 achieves 59.59% accuracy on BIRD benchmark, setting new SOTA.
The framework effectively handles complex databases and multi-step reasoning.
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsScientific Computing and Data Management · Semantic Web and Ontologies · Advanced Database Systems and Queries
MethodsSparse Evolutionary Training · Multi-Head Attention · Attention Is All You Need · Linear Layer · Dense Connections · Position-Wise Feed-Forward Layer · Absolute Position Encodings · Label Smoothing · Adam · Residual Connection
