Optimizing Small Language Models for NL2SQL via Chain-of-Thought Fine-Tuning
Anshul Solanki, Sanchit Latawa, Koushik Chakraborty, Navneet Kamboj

TL;DR
This paper shows that fine-tuning small language models with Chain-of-Thought reasoning significantly improves NL2SQL accuracy, offering a cost-effective alternative to large models for enterprise data access.
Contribution
It demonstrates that small models can achieve near-production NL2SQL performance through targeted fine-tuning and reasoning pattern transfer, reducing costs and inference latency.
Findings
Fine-tuning small models improves accuracy from 36% to 45%.
Enriching datasets with Chain-of-Thought reasoning boosts accuracy to 54.5%.
Large models show negligible gains from fine-tuning on standard datasets.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsCloud Computing and Resource Management · Big Data and Digital Economy · Stock Market Forecasting Methods
