arXiv:2509.05899cs.LGcs.DB2025-09

X-SQL通过多模型协作提升文本转SQL的准确率,关键在理解数据库结构。

X-SQL: Expert Schema Linking and Understanding of Text-to-SQL with Multi-LLMs

  • 用LLM微调实现精准表字段链接,优于现有开源方法。
  • 在Spider数据集上达84.9%执行准确率,领先开源模型。
  • 适合需要高精度数据库查询生成的研究与工程场景。

随着大语言模型在代码生成任务中展现出的涌现能力,文本转SQL成为最热门的下游应用之一。尽管近期多项基于LLM的文本转SQL框架取得了优异成果,研究社区常忽视数据库模式信息对生成高质量SQL的关键作用。我们发现,模式信息在文本转SQL任务中起着显著甚至主导的作用。为此,我们提出一种新型数据库模式专家,包含两个组件:首先引入X-Linking,一种基于LLM监督微调的方法,在模式链接任务上表现优于现有开源方案;其次创新性地设计X-Admin组件,通过弥合抽象模式信息与用户自然语言问题之间的差距,实现更深入的模式理解。此外,我们针对系统中不同模块采用多大模型策略以进一步提升性能。将上述技术整合进端到端框架X-SQL后,我们在Spider-Dev数据集上达到84.9%的执行准确率,在Spider-Test数据集上达到82.5%,显著优于当前基于开源模型的主流框架,确立了其领先地位。

原文摘要 · Abstract (English)

With Large Language Models' (LLMs) emergent abilities on code generation tasks, Text-to-SQL has become one of the most popular downstream applications. Despite the strong results of multiple recent LLM-based Text-to-SQL frameworks, the research community often overlooks the importance of database schema information for generating high-quality SQL queries. We find that such schema information plays a significant or even dominant role in the Text-to-SQL task. To tackle this challenge, we propose a novel database schema expert with two components. We first introduce X-Linking, an LLM Supervised Finetuning (SFT)-based method that achieves superior Schema Linking results compared to existing open-source Text-to-SQL methods. In addition, we innovatively propose an X-Admin component that focuses on Schema Understanding by bridging the gap between abstract schema information and the user's natural language question. Aside from better learning with schema information, we experiment with Multi-LLMs for different components within the system to further boost its performance. By incorporating these techniques into our end-to-end framework, X-SQL, we have achieved Execution Accuracies of 84.9% on the Spider-Dev dataset and 82.5% on the Spider-Test dataset. This outstanding performance establishes X-SQL as the leading Text-to-SQL framework based on open-source models.

文本转SQL大模型数据库多模型协同

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。