用多候选生成与元数据批评,让小模型高效准确完成自然语言转SQL。
MSc-SQL: Multi-Sample Critiquing Small Language Models For Text-To-SQL Translation
- 同时生成多个SQL并用元数据批量评估,提升生成质量。
- 在Spider和WikiSQL上超越其他开源模型,接近大模型表现。
- 适合追求低成本、高隐私的轻量级数据库交互应用。
自然语言转SQL使非专家能与数据库交互。当前方法依赖GPT-4等闭源大模型,存在访问难、隐私风险和延迟问题。为此,我们聚焦于开发小型、高效且开源的文本转SQL模型。通过采样多个候选SQL并利用关联元数据进行批处理批评,提出MSc-SQL方法。该模型可同时评估多个输出,在Spider和WikiSQL数据集上达到开源模型最优性能,同时显著低于大模型的计算成本。完整代码见https://github.com/layer6ai-labs/msc-sql。
原文摘要 · Abstract (English)
Text-to-SQL generation enables non-experts to interact with databases via natural language. Recent advances rely on large closed-source models like GPT-4 that present challenges in accessibility, privacy, and latency. To address these issues, we focus on developing small, efficient, and open-source text-to-SQL models. We demonstrate the benefits of sampling multiple candidate SQL generations and propose our method, MSc-SQL, to critique them using associated metadata. Our sample critiquing model evaluates multiple outputs simultaneously, achieving state-of-the-art performance compared to other open-source models while remaining competitive with larger models at a much lower cost. Full code can be found at https://github.com/layer6ai-labs/msc-sql.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。