arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.22942cs.AI
收藏

通过链式思维微调优化小型语言模型用于自然语言到SQL转换

Optimizing Small Language Models for NL2SQL via Chain-of-Thought Fine-Tuning

Anshul Solanki, Sanchit Latawa, Koushik Chakraborty, Navneet Kamboj

AI总结:

本文通过链式思维微调优化小型语言模型,发现小型模型在NL2SQL任务中表现优于大型模型,显著提升准确率并降低成本。

摘要:

将自然语言转换为SQL(NL2SQL)仍然是企业数据民主化的关键瓶颈。尽管像Gemini 2.5等大型语言模型展示了出色的零样本能力,但其高推理成本限制了大规模部署。本文探讨了在NL2SQL任务上微调大型和小型语言模型的有效性。研究发现了一种反直觉的扩展现象。在标准数据集上微调大型模型(Gemini 2.5 Flash/Lite)效果有限,常导致在复杂查询上过拟合。相反,小型模型(Qwen)表现出显著提升。微调使小型模型基线从36%提升到45%,进一步丰富数据集并加入显式链式思维(CoT)推理,将准确率提升至54.5%(图2)。虽然这仍低于Gemini 2.5等大型模型的准确率,但能实现显著的成本降低、推理时间减少以及满足业务关键性能准确率阈值。本文证明了将推理模式转移使计算高效的较小模型能够接近生产级性能。

英文摘要:

Translating Natural Language to SQL (NL2SQL) remains a critical bottleneck for democratization of data in enterprises. Although Large Language Models (LLMs) like Gemini 2.5 and other LLMs have demonstrated impressive zero-shot capabilities, their high inference costs limit deployment at scale. This paper explores the efficacy of fine-tuning both large and small language models on NL2SQL tasks. Our research reveals a counter-intuitive scaling phenomenon. Fine-tuning large models (Gemini 2.5 Flash/Lite) on standard datasets yields negligible returns, often leading to overfitting on complex queries. Conversely, small models (Qwen) show significant gains. Fine-tuning improved the small model baseline from 36% to 45%, and further enriching the dataset with explicit Chain-of-Thought (CoT) reasoning surged accuracy to 54.5%(Fig 2). While this is still lower than the accuracy of large models like Gemini 2.5 , it does serve the business goal of significant cost reduction, latency in inference time and also meeting the business critical performance accuracy threshold.This paper demonstrates that transferring reasoning patterns enables compute-efficient smaller models to approach production-grade performance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑