arXiv:2511.04710cs.CL2025-11被引 3

基于Gemma小模型的轻量级文本转SQL系统,高效准确且可部署于低配硬件。

GEMMA-SQL: A Novel Text-to-SQL Model Based on Large Language Models

  • 在Gemma 2B基础上迭代微调,结合少样本提示提升生成效果。
  • 在SPIDER测试集上达到66.8%测试套件准确率,超越多个主流模型。
  • 适合需要低成本、高可扩展性的文本转SQL应用开发者使用。

文本转SQL系统使用户能用自然语言与结构化数据库交互,无需编程知识。本文提出GEMMA-SQL,一个基于开源Gemma 2B架构的轻量高效文本转SQL模型。不同于多数大模型,GEMMA-SQL采用资源高效的迭代微调方式,可在低成本硬件上部署。利用SPIDER基准进行训练与评估,结合多种提示策略(如少样本学习),显著提升SQL生成准确率。指令微调版本GEMMA-SQL Instruct在测试套件准确率达66.8%,精确集合匹配准确率为63.3%,优于IRNet、RYANSQL和CodeXDavinci等先进基线模型。结果表明,有效提示设计与定向指令微调可大幅提升性能,同时保持高可扩展性与适应性。GEMMA-SQL为构建稳健、开放、易用的文本转SQL系统提供了实用方案。

原文摘要 · Abstract (English)

Text-to-SQL systems enable users to interact with structured databases using natural language, eliminating the need for specialized programming knowledge. In this work, we introduce GEMMA-SQL, a lightweight and efficient text-to-SQL model built upon the open-source Gemma 2B architecture. Unlike many large language models (LLMs), GEMMA-SQL is fine-tuned in a resource-efficient, iterative manner and can be deployed on low-cost hardware. Leveraging the SPIDER benchmark for training and evaluation, GEMMA-SQL combines multiple prompting strategies, including few-shot learning, to enhance SQL query generation accuracy. The instruction-tuned variant, GEMMA-SQL Instruct, achieves 66.8% Test-Suite accuracy and 63.3% Exact Set Match accuracy, outperforming several state-of-the-art baselines such as IRNet, RYANSQL, and CodeXDavinci. The proposed approach demonstrates that effective prompt design and targeted instruction tuning can significantly boost performance while maintaining high scalability and adaptability. These results position GEMMA-SQL as a practical, open-source alternative for robust and accessible text-to-SQL systems.

文本转SQL轻量模型Gemma自然语言查询

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