arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.13408cs.CL
收藏

SQLFixAgent:通过一致性增强的多智能体协作实现语义准确的Text-to-SQL解析

SQLFixAgent: Towards Semantic-Accurate Text-to-SQL Parsing via Consistency-Enhanced Multi-Agent Collaboration

School of Computer Science & Technology, Soochow University(苏州大学计算机科学与技术学院);School of Information, Renmin University of China(中国人民大学信息学院);International College (Suzhou Research Institute), Renmin University of China(中国人民大学国际学院(苏州研究院));iFLYTEK Research (Suzhou)(科大讯飞研究院(苏州))

Jipeng Cen, Jiaxin Liu, Zhixu Li, Jingjing Wang

AI总结:

针对Text-to-SQL解析中LLM生成SQL语义准确率不足的问题,提出含三类智能体的SQLFixAgent协作框架,通过错误检测、候选生成与优选修复提升性能,在多基准上有效增效且token效率更优。

摘要:

尽管经过微调的大语言模型(LLM)在Text-to-SQL解析中擅长生成语法有效的SQL,但它们往往难以保证查询的语义准确性,进而导致用户困惑、系统可用性下降。为解决这一问题,我们提出SQLFixAgent——一种新型一致性增强多智能体协作框架,用于检测并修复错误SQL。该框架包含一个核心智能体SQLRefiner,以及两个辅助智能体SQLReviewer和QueryCrafter。SQLReviewer智能体采用橡皮鸭调试法,识别SQL与用户查询之间潜在的语义不匹配问题。若检测到错误,QueryCrafter智能体会借助经过微调的SQLTool生成多条SQL作为候选修复方案。随后,SQLRefiner智能体利用相似修复检索与失败记忆反思机制,从候选方案中选出最合适的SQL语句作为最终修复结果。我们在5个Text-to-SQL基准上对所提框架进行了评估。实验结果表明,该方法能持续提升基线模型的性能,在Bird基准上的执行准确率提升超过3%。与其他先进方法相比,本框架的token效率更高,竞争力更强。

英文摘要:

While fine-tuned large language models (LLMs) excel in generating grammatically valid SQL in Text-to-SQL parsing, they often struggle to ensure semantic accuracy in queries, leading to user confusion and diminished system usability. To tackle this challenge, we introduce SQLFixAgent, a new consistency-enhanced multi-agent collaborative framework designed for detecting and repairing erroneous SQL. Our framework comprises a core agent, SQLRefiner, alongside two auxiliary agents: SQLReviewer and QueryCrafter. The SQLReviewer agent employs the rubber duck debugging method to identify potential semantic mismatches between SQL and user query. If the error is detected, the QueryCrafter agent generates multiple SQL as candidate repairs using a fine-tuned SQLTool. Subsequently, leveraging similar repair retrieval and failure memory reflection, the SQLRefiner agent selects the most fitting SQL statement from the candidates as the final repair. We evaluated our proposed framework on five Text-to-SQL benchmarks. The experimental results show that our method consistently enhances the performance of the baseline model, specifically achieving an execution accuracy improvement of over 3% on the Bird benchmark. Our framework also has a higher token efficiency compared to other advanced methods, making it more competitive.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑