mlsanityData to 14 Oct 2026

Towards Optimizing SQL Generation via LLM Routing

arXiv 2411.04319 ↗First posted 6 Nov 2024cs.DB cs.AI cs.LGcited by 5

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

  1. 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,307
  2. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
  3. 2023FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performancecited by 853
  4. 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 688
  5. 2024RouteLLM: Learning to Route LLMs with Preference Datacited by 682
  6. 2023LLM-Blender: Ensembling Large Language Models with Pairwise Ranking and Generative Fusioncited by 564
  7. 2024Hybrid LLM: Cost-Efficient and Quality-Aware Query Routingcited by 372
  8. 2024Next-Generation Database Interfaces: A Survey of LLM-based Text-to-SQLcited by 120
  9. 2024The Dawn of Natural Language to SQL: Are We Fully Ready?cited by 79
  10. 2024The Death of Schema Linking? Text-to-SQL in the Age of Well-Reasoned Language Modelscited by 67
  11. 2024A Survey of Text-to-SQL in the Era of LLMs: Where are we, and where are we going?cited by 56
  12. 2023Natural Language Interfaces for Tabular Data Querying and Visualization: A Surveycited by 27
2 more
  1. 2022Natural Language Interfaces to Datacited by 14
  2. 2024End-to-end Text-to-SQL Generation within an Analytics Insight Enginecited by 7

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 1; 2025: 3; 2026: 1.

5 papers.