arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2511.01008cs.CL
收藏

MARS-SQL: 一种用于文本到SQL的多智能体强化学习框架

MARS-SQL: A multi-agent reinforcement learning framework for Text-to-SQL

Hong Kong University of Science and Technology(香港理工大学);Hong Kong Polytechnic University(香港理工大学)

Haolin Yang, Jipeng Zhang, Zhitao He, Alexander Zhou, Yi R. Fung

AI总结:

MARS-SQL通过多智能体框架解决文本到SQL任务中的逻辑与模式对齐问题,采用生成代理与验证机制提升交互学习效果,实现77.84%和89.75%的准确率。

摘要:

大型语言模型(LLMs)在处理复杂文本到SQL任务时常常面临精确逻辑和模式对齐的挑战。尽管现有方法依赖静态提示,但缺乏通过环境交互动态适应和自我纠正的能力。为此,我们提出了MARS-SQL,一种可训练的多智能体框架。该框架通过将问题分解为三个专业化角色:模式定位、查询生成和解决方案验证,使工作流可训练。核心方法是通过多轮强化学习策略训练生成代理,在ReAct风格循环中迭代推理、执行中间SQL操作并根据执行反馈优化策略。为进一步提高鲁棒性,我们引入了验证机制,将解决方案选择视为生成建模任务,通过下一个token预测概率识别最佳交互轨迹。实证评估表明,结合交互学习与轨迹排名的方法有效。MARS-SQL在BIRD开发数据集上达到77.84%的执行准确率,在Spider测试数据集上达到89.75%的准确率,并在领域外基准测试中表现出色。代码可在https://github.com/YangHaolin0526/MARS-SQL获取。

英文摘要:

Large Language Models (LLMs) often struggle with the precise logic and schema alignment required for complex Text-to-SQL tasks. While current methods rely heavily on static prompting, they lack the ability to dynamically adapt and self-correct through environmental interaction. To bridge this gap, we propose MARS-SQL, a trainable multi-agent framework for Text-to-SQL. Rather than introducing a new standalone SQL primitive, MARS-SQL makes an agentic workflow trainable by decomposing the problem into three specialized roles: schema grounding, query generation, and solution validation. Central to our approach is a generation agent trained via a multi-turn RL policy within a ReAct-style loop. The agent learns to iteratively reason, execute intermediate SQL actions on a live database, and refine its strategy based on execution feedback. To improve robustness, we further introduce a validation mechanism that treats solution selection as a generative modeling task, identifying the optimal interaction trajectory through next-token prediction probabilities. Empirical evaluations demonstrate the effectiveness of coupling interactive learning with trajectory ranking. MARS-SQL achieves state-of-the-art performance, recording an execution accuracy of 77.84% on the BIRD development dataset and 89.75% on the Spider test dataset, while also transferring strongly to out-of-domain benchmarks. Code is available at https://github.com/YangHaolin0526/MARS-SQL.

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

↑