Reliable Text-to-SQL in Resource-Constrained Settings with Small LLMs via Iterative Retry Workflows
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have recently improved Text-to-SQL generation, but their computational cost can hinder deployment in resource-constrained settings. This paper evaluates the Text-to-SQL capabilities of small and medium open-source LLMs (1B-8B parameters) under a controlled inference budget, focusing on how model specialization and prompt formulation affect performance. Using the Spider benchmark, we compare multiple prompt representations and assess the accuracy of generated queries. Our results show that SQL-specialized models are consistently more reliable than general-purpose and chat-oriented models at small scales, and that performance can vary substantially depending on the prompt used. To reduce this variability without resorting to larger models, we introduce three lightweight inference workflows that automatically retry with alternative prompts and/or models when failures occur, including an optional syntax-correction step. These workflows significantly improve end-to-end success rates, with a trade-off in additional inference calls. These results demonstrate a practical path to stronger Text-to-SQL performance with small LLMs, by trading modest additional inference cost for higher reliability.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 28 of its 33 references that are in the map. First posted on arXiv 12 Oct 2026.
Builds on
28 of 33 references.
References · 28
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2021On the Opportunities and Risks of Foundation Modelscited by 4,033
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2023Mistral 7Bcited by 3,164
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
16 more
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
- 2023BloombergGPT: A Large Language Model for Financecited by 939
- 2024DeepSeek LLM: Scaling Open-Source Language Models with Longtermismcited by 642
- 2024TinyLlama: An Open-Source Small Language Modelcited by 618
- 2022BioGPT: Generative Pre-trained Transformer for Biomedical Text Generation and Miningcited by 538
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 477
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 385
- 2019Q8BERT: Quantized 8Bit BERTcited by 300
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 187
- 2023A comprehensive evaluation of ChatGPT's zero-shot Text-to-SQL capabilitycited by 119
- 2023How to Prompt LLMs for Text-to-SQL: A Study in Zero-shot, Single-domain, and Cross-domain Settingscited by 58
- 2023Enhancing Few-shot Text-to-SQL Capabilities of Large Language Models: A Study on Prompt Design Strategiescited by 45
Built on by
Not cited yet.