MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQL
Arian Askari, Christian Pölitz, Xinye Tang
摘要
Self-correction in text-to-SQL is the process of prompting large language model (LLM) to revise its previously incorrectly generated SQL, and commonly relies on manually crafted self-correction guidelines by human experts that are not only labor-intensive to produce but also limited by the human ability in identifying all potential error patterns in LLM responses. We introduce MAGIC, a novel multi-agent method that automates the creation of the self-correction guideline. MAGIC uses three specialized agents: a manager, a correction, and a feedback agent. These agents collaborate on the failures of an LLM-based method on the training set to iteratively generate and refine a self-correction guideline tailored to LLM mistakes, mirroring human processes but without human involvement. Our extensive experiments show that MAGIC's guideline outperforms expert human's created ones. We empirically find out that the guideline produced by MAGIC enhances the interpretability of the corrections made, providing insights in analyzing the reason behind the failures and successes of LLMs in selfcorrection. All agent interactions are publicly available at https://huggingface.co/datasets/microsoft/MAGIC .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 11 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQL 引用了 DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
- SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQL 引用了 Teaching Large Language Models to Self-Debug
- SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQL 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Self-Refine: Iterative Refinement with Self-Feedback 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQL 引用了 DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
- SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQL 引用了 Teaching Large Language Models to Self-Debug
- SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQL 引用了 CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquing
- Teaching Large Language Models to Self-Debug 引用了 Self-Refine: Iterative Refinement with Self-Feedback
- Teaching Large Language Models to Self-Debug 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquing 引用了 Self-Refine: Iterative Refinement with Self-Feedback
- CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquing 引用了 Teaching Large Language Models to Self-Debug
- CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquing 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- PTD-SQL: Partitioning and Targeted Drilling with LLMs in Text-to-SQL 引用了 Self-Refine: Iterative Refinement with Self-Feedback
- PTD-SQL: Partitioning and Targeted Drilling with LLMs in Text-to-SQL 引用了 DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
- PTD-SQL: Partitioning and Targeted Drilling with LLMs in Text-to-SQL 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
引用它的顶会 Paper11
- SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQLYue Gong, Chuan Lei, Xiao Qin, Kapil Vaidya 等NeurIPS 2025 · 21 次引用
- ExCyTIn-Bench: Evaluating LLM agents on Cyber Threat InvestigationYiran Wu, Mauricio Velazco, Andrew Zhao, Manuel Luján 等ICML 2026 · 14 次引用
- SHARE: An SLM-based Hierarchical Action CorREction Assistant for Text-to-SQLGe Qu, Jinyang Li, Bowen Qin, Xiaolong Li 等ACL 2025 · 13 次引用
- Uncovering the Impact of Chain-of-Thought Reasoning for Direct Preference Optimization: Lessons from Text-to-SQLHanbing Liu, Haoyang Li, Xiaokang Zhang, Ruotong Chen 等ACL 2025 · 10 次引用
- PTD-SQL: Partitioning and Targeted Drilling with LLMs in Text-to-SQLRuilin Luo, Liyuan Wang, Binghuai Lin, Zicheng Lin 等EMNLP 2024 · 4 次引用
它引用的 Paper11
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan 等NeurIPS 2023 · 4,972 次引用
- Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 次引用
- DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-CorrectionMohammadreza Pourreza, Davood RafieiNeurIPS 2023 · 909 次引用
- CRITIC: Large Language Models Can Self-Correct with Tool-Interactive CritiquingZhibin Gou, Zhihong Shao, Yeyun Gong, Yelong Shen 等ICLR 2024 · 699 次引用
相关 Paper
- TS-SQL: Test-driven Self-refinement for Text-to-SQLWenbo Xu, Haifeng Zhu, Liang Yan, Chuanyi Liu 等EMNLP Findings 2025 · 2 次引用
- MARS-SQL: A Multi-Agent Reinforcement Learning Framework For Text-To-SQLHaolin Yang, Jipeng Zhang, Zhitao He, Alexander Zhou 等ICML 2026 · 12 次引用
- SQLFixAgent: Towards Semantic-Accurate Text-to-SQL Parsing via Consistency-Enhanced Multi-Agent CollaborationJipeng Cen, Jiaxin Liu, Zhixu Li, Jingjing WangAAAI 2025 · 18 次引用
- ErrorLLM: Modeling SQL Errors for Text-to-SQL RefinementZijin Hong, Hao Chen, Zheng Yuan, Qinggang Zhang 等KDD 2026 · 3 次引用
- DAC: Decomposed Automation Correction for Text-to-SQLDingzirui Wang, Longxu Dou, Xuanliang Zhang, Qingfu Zhu 等EMNLP Findings 2025 · 5 次引用
