MAGIC:为上下文文本到SQL生成自纠正指南
MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQL
AI总结:
提出多智能体方法MAGIC,通过manager、correction和feedback三个智能体协作,自动生成并完善针对LLM错误的自纠正指南,无需人工参与且优于人类专家制定的指南,同时增强了纠正的可解释性。
摘要:
文本到SQL中的自纠正是指提示大型语言模型(LLM)修改其之前错误生成的SQL的过程,通常依赖于人类专家手动制定的自纠正指南,这不仅制作过程耗费大量人力,还受限于人类识别LLM响应中所有潜在错误模式的能力。我们提出了MAGIC,一种新颖的多智能体方法,可自动创建自纠正指南。MAGIC使用三个专门的智能体:manager、correction和feedback智能体。这些智能体基于LLM方法在训练集上的失败案例进行协作,迭代地生成并完善针对LLM错误量身定制的自纠正指南,这模拟了人类的流程但无需人类参与。我们的大量实验表明,MAGIC生成的指南优于人类专家创建的指南。我们实证发现,MAGIC生成的指南增强了所做纠正的可解释性,为分析LLM在自纠正中失败和成功背后的原因提供了见解。所有智能体交互均已在 https://huggingface.co/datasets/microsoft/MAGIC 公开。
英文摘要:
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 self-correction. All agent interactions are publicly available at https://huggingface.co/datasets/microsoft/MAGIC.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。