XiYan-SQL 预览:一种面向文本到 SQL 的多生成器集成框架
A Preview of XiYan-SQL: A Multi-Generator Ensemble Framework for Text-to-SQL
AI总结:
本文提出 XiYan-SQL 框架,通过多生成器集成、M-Schema 模式表示、上下文学习与监督微调相结合及候选精炼与选择模型,在多个文本到 SQL 基准上取得领先执行准确率。
摘要:
为应对大语言模型在自然语言到 SQL 任务中的性能挑战,我们提出 XiYan-SQL,这是一个采用多生成器集成策略来改进候选生成的创新框架。我们引入 M-Schema,一种半结构化模式表示方法,旨在增强对数据库结构的理解。为提升所生成候选 SQL 查询的质量和多样性,XiYan-SQL 将上下文学习(ICL)的巨大潜力与监督微调的精确控制相结合。一方面,我们提出一系列训练策略来微调模型,以生成具有多样化偏好的高质量候选。另一方面,我们采用基于命名实体识别的示例选择方法来实现 ICL 方法,以防止对实体的过度强调。精炼器通过纠正逻辑或语法错误来优化每个候选。为应对识别最佳候选的挑战,我们微调了一个选择模型,以区分候选 SQL 查询之间的细微差异。在多个方言数据集上的实验结果表明,XiYan-SQL 在应对不同场景挑战方面具有鲁棒性。总体而言,我们提出的 XiYan-SQL 在 Bird 基准上达到了 75.63% 的最先进执行准确率,在 Spider 测试集上达到 89.65%,在 SQL-Eval 上达到 69.86%,在 NL2GQL 上达到 41.20%。所提出的框架不仅提升了 SQL 查询的质量和多样性,而且优于先前的方法。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。