提升开源模型的文本转SQL能力,通过多任务协作实现更准确的查询生成。
ROUTE: Robust Multitask Tuning and Collaboration for Text-to-SQL
- 引入多任务微调,涵盖模式链接、噪声修正等新任务增强语法理解。
- 在5个基准上超越最新方法,8个开源模型均取得领先性能。
- 适合希望用开源模型落地复杂SQL生成任务的研究者与开发者。
尽管大语言模型推动了文本转SQL(Text2SQL)的显著进展,但当前最先进方法仍依赖闭源模型(如GPT-4)的上下文学习,限制了其在开放场景的应用。为此,我们提出一种鲁棒的多任务微调与协作方法(ROUTE),以提升开源大模型在Text2SQL中的综合能力,提供更具实用性的解决方案。该方法基于多种与SQL生成相关的合成数据进行多任务监督微调(SFT),创新性地加入模式链接、噪声修正和续写写作等额外任务,增强模型对SQL语法的理解与高质量查询生成能力。此外,受大型语言模型代理协作机制启发,引入多任务协作提示策略(MCP),通过多个相关任务间的协同降低生成过程中的幻觉现象,充分释放显式多任务能力对性能的提升潜力。在8个开源大模型和5个主流基准上的大量实验与深入分析表明,所提方法显著优于现有Text2SQL技术,达到领先水平。
原文摘要 · Abstract (English)
Despite the significant advancements in Text-to-SQL (Text2SQL) facilitated by large language models (LLMs), the latest state-of-the-art techniques are still trapped in the in-context learning of closed-source LLMs (e.g., GPT-4), which limits their applicability in open scenarios. To address this challenge, we propose a novel RObust mUltitask Tuning and collaboration mEthod (ROUTE) to improve the comprehensive capabilities of open-source LLMs for Text2SQL, thereby providing a more practical solution. Our approach begins with multi-task supervised fine-tuning (SFT) using various synthetic training data related to SQL generation. Unlike existing SFT-based Text2SQL methods, we introduced several additional SFT tasks, including schema linking, noise correction, and continuation writing. Engaging in a variety of SQL generation tasks enhances the model's understanding of SQL syntax and improves its ability to generate high-quality SQL queries. Additionally, inspired by the collaborative modes of LLM agents, we introduce a Multitask Collaboration Prompting (MCP) strategy. This strategy leverages collaboration across several SQL-related tasks to reduce hallucinations during SQL generation, thereby maximizing the potential of enhancing Text2SQL performance through explicit multitask capabilities. Extensive experiments and in-depth analyses have been performed on eight open-source LLMs and five widely-used benchmarks. The results demonstrate that our proposal outperforms the latest Text2SQL methods and yields leading performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。