通过多生成器集成提升文本转SQL准确率,最高达89.65%
A Preview of XiYan-SQL: A Multi-Generator Ensemble Framework for Text-to-SQL
- 采用多生成器集成策略,结合上下文学习与微调控制生成多样性
- 在Spider数据集上达到89.65%执行准确率,优于现有方法
- 适合需要高精度文本转SQL的数据库应用开发者
为应对大模型在自然语言转SQL任务中的性能挑战,我们提出XiYan-SQL,一种基于多生成器集成框架。引入M-Schema半结构化模式表示法,增强对数据库结构的理解。通过结合上下文学习(ICL)与监督微调,提升候选SQL查询的质量与多样性。设计一系列训练策略以生成具有多样偏好且高质量的候选语句;采用基于命名实体识别的示例选择方法,避免过度强调实体。使用精炼器修正每条候选语句的逻辑或语法错误。针对最优候选选择难题,微调选择模型以区分候选间的细微差异。在多个方言数据集上的实验表明,该框架具备强鲁棒性。整体上,XiYan-SQL在Bird基准上实现75.63%的执行准确率,Spider测试集上达89.65%,SQL-Eval为69.86%,NL2GQL为41.20%,显著优于先前方法。
原文摘要 · Abstract (English)
To tackle the challenges of large language model performance in natural language to SQL tasks, we introduce XiYan-SQL, an innovative framework that employs a multi-generator ensemble strategy to improve candidate generation. We introduce M-Schema, a semi-structured schema representation method designed to enhance the understanding of database structures. To enhance the quality and diversity of generated candidate SQL queries, XiYan-SQL integrates the significant potential of in-context learning (ICL) with the precise control of supervised fine-tuning. On one hand, we propose a series of training strategies to fine-tune models to generate high-quality candidates with diverse preferences. On the other hand, we implement the ICL approach with an example selection method based on named entity recognition to prevent overemphasis on entities. The refiner optimizes each candidate by correcting logical or syntactical errors. To address the challenge of identifying the best candidate, we fine-tune a selection model to distinguish nuances of candidate SQL queries. The experimental results on multiple dialect datasets demonstrate the robustness of XiYan-SQL in addressing challenges across different scenarios. Overall, our proposed XiYan-SQL achieves the state-of-the-art execution accuracy of 75.63% on Bird benchmark, 89.65% on the Spider test set, 69.86% on SQL-Eval, 41.20% on NL2GQL. The proposed framework not only enhances the quality and diversity of SQL queries but also outperforms previous methods.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。