DB-Explore:面向Text-to-SQL的自动化数据库探索与指令合成
DB-Explore: Automated Database Exploration and Instruction Synthesis for Text-to-SQL
AI总结:
针对现有text-to-SQL系统缺乏全面数据库理解的问题,提出DB-Explore框架,通过数据库图构建、知识挖掘与指令合成实现LLM与数据库知识对齐,在SPIDER、BIRD基准上取得优异表现,基于Qwen2.5-Coder-7B的开源实现以低成本达SOTA。
摘要:
近年来,由大语言模型(LLM)驱动的text-to-SQL系统在将自然语言查询转化为SQL方面展现出了出色的性能。然而,这类系统通常难以应对复杂数据库结构和特定领域的查询,因为它们主要侧重于提升逻辑推理能力和SQL语法水平,却忽略了全面理解数据库这一关键需求。为解决这一局限,我们提出了DB-Explore,这是一种新型框架,通过自动化探索与指令合成实现大语言模型与数据库知识的系统性对齐。DB-Explore构建数据库图以捕获复杂的关系模式,利用GPT-4系统挖掘结构模式与语义知识,并合成指令以提炼这些知识,用于大语言模型的高效微调。我们的框架通过多样化的采样策略和自动化指令生成实现全面的数据库理解,弥合了数据库结构与语言模型之间的鸿沟。在SPIDER和BIRD基准上开展的实验验证了DB-Explore的有效性,其在BIRD上的执行准确率达到67.0%,在SPIDER上达到87.8%。值得注意的是,我们基于Qwen2.5-Coder-7B的开源实现以极低的计算成本取得了当前最优结果,性能超越了多个由GPT-4驱动的Text-to-SQL系统。
英文摘要:
Recent text-to-SQL systems powered by large language models (LLMs) have demonstrated remarkable performance in translating natural language queries into SQL. However, these systems often struggle with complex database structures and domain-specific queries, as they primarily focus on enhancing logical reasoning and SQL syntax while overlooking the critical need for comprehensive database understanding. To address this limitation, we propose DB-Explore, a novel framework that systematically aligns LLMs with database knowledge through automated exploration and instruction synthesis. DB-Explore constructs database graphs to capture complex relational schemas, leverages GPT-4 to systematically mine structural patterns and semantic knowledge, and synthesizes instructions to distill this knowledge for efficient fine-tuning of LLMs. Our framework enables comprehensive database understanding through diverse sampling strategies and automated instruction generation, bridging the gap between database structures and language models. Experiments conducted on the SPIDER and BIRD benchmarks validate the effectiveness of DB-Explore, achieving an execution accuracy of 67.0% on BIRD and 87.8% on SPIDER. Notably, our open-source implementation based on Qwen2.5-Coder-7B achieves state-of-the-art results at minimal computational cost, outperforming several GPT-4-driven Text-to-SQL systems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。