Towards Optimizing SQL Generation via LLM Routing
Not on the map. Why?
Abstract (arXiv)
Text-to-SQL enables users to interact with databases through natural language, simplifying access to structured data. Although highly capable large language models (LLMs) achieve strong accuracy for complex queries, they incur unnecessary latency and dollar cost for simpler ones. In this paper, we introduce the first LLM routing approach for Text-to-SQL, which dynamically selects the most cost-effective LLM capable of generating accurate SQL for each query. We present two routing strategies (score- and classification-based) that achieve accuracy comparable to the most capable LLM while reducing costs. We design the routers for ease of training and efficient inference. In our experiments, we highlight a practical and explainable accuracy-cost trade-off on the BIRD dataset.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 14 of its 15 references that are in the map. First posted on arXiv 6 Nov 2024.
Builds on
14 of 15 references.
References · 14
- 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,307
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
- 2023FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performancecited by 853
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 688
- 2024RouteLLM: Learning to Route LLMs with Preference Datacited by 682
- 2023LLM-Blender: Ensembling Large Language Models with Pairwise Ranking and Generative Fusioncited by 564
- 2024Hybrid LLM: Cost-Efficient and Quality-Aware Query Routingcited by 372
- 2024Next-Generation Database Interfaces: A Survey of LLM-based Text-to-SQLcited by 120
- 2024The Dawn of Natural Language to SQL: Are We Fully Ready?cited by 79
- 2024The Death of Schema Linking? Text-to-SQL in the Age of Well-Reasoned Language Modelscited by 67
- 2024A Survey of Text-to-SQL in the Era of LLMs: Where are we, and where are we going?cited by 56
- 2023Natural Language Interfaces for Tabular Data Querying and Visualization: A Surveycited by 27
2 more
- 2022Natural Language Interfaces to Datacited by 14
- 2024End-to-end Text-to-SQL Generation within an Analytics Insight Enginecited by 7
Built on by
Citing papers per year: 2024: 1; 2025: 3; 2026: 1.
5 papers.
- 2025Doing More with Less: A Survey on Routing Strategies for Resource Optimisation in Large Language Model-Based Systemscited by 20
- 2025EllieSQL: Cost-Efficient Text-to-SQL with Complexity-Aware Routingcited by 13
- 2024LLM4DS: Evaluating Large Language Models for Data Science Code Generationcited by 7
- 2025Cost Trade-offs of Reasoning and Non-Reasoning Large Language Models in Text-to-SQLcited by 2
- 2026SQLMorph: Query Mutation and Fine-Grained Metrics for Text-to-SQL Evaluationcited by 1
- 2026SQLMorph: Query Mutation and Fine-Grained Metrics for Text-to-SQL Evaluation8 Sep 2026
- 2025Cost Trade-offs of Reasoning and Non-Reasoning Large Language Models in Text-to-SQL26 Dec 2025
- 2025EllieSQL: Cost-Efficient Text-to-SQL with Complexity-Aware Routing28 Mar 2025
- 2025Doing More with Less: A Survey on Routing Strategies for Resource Optimisation in Large Language Model-Based Systems1 Feb 2025
- 2024LLM4DS: Evaluating Large Language Models for Data Science Code Generation16 Nov 2024