Towards Optimizing SQL Generation via LLM Routing Article Swipe
YOU?
·
· 2024
· Open Access
·
· DOI: https://doi.org/10.48550/arxiv.2411.04319
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.
Related Topics
- Type
- preprint
- Language
- en
- Landing Page
- http://arxiv.org/abs/2411.04319
- https://arxiv.org/pdf/2411.04319
- OA Status
- green
- Cited By
- 1
- Related Works
- 10
- OpenAlex ID
- https://openalex.org/W4404404447
Raw OpenAlex JSON
- OpenAlex ID
-
https://openalex.org/W4404404447Canonical identifier for this work in OpenAlex
- DOI
-
https://doi.org/10.48550/arxiv.2411.04319Digital Object Identifier
- Title
-
Towards Optimizing SQL Generation via LLM RoutingWork title
- Type
-
preprintOpenAlex work type
- Language
-
enPrimary language
- Publication year
-
2024Year of publication
- Publication date
-
2024-11-06Full publication date if available
- Authors
-
Mohammadhossein Malekpour, Nicholas J. Shaheen, Foutse Khomh, Amine MhedhbiList of authors in order
- Landing page
-
https://arxiv.org/abs/2411.04319Publisher landing page
- PDF URL
-
https://arxiv.org/pdf/2411.04319Direct link to full text PDF
- Open access
-
YesWhether a free full text is available
- OA status
-
greenOpen access status per OpenAlex
- OA URL
-
https://arxiv.org/pdf/2411.04319Direct OA link when available
- Concepts
-
Computer science, SQL, Routing (electronic design automation), Database, Computer networkTop concepts (fields/topics) attached by OpenAlex
- Cited by
-
1Total citation count in OpenAlex
- Citations by year (recent)
-
2025: 1Per-year citation counts (last 5 years)
- Related works (count)
-
10Other works algorithmically related by OpenAlex
Full payload
| id | https://openalex.org/W4404404447 |
|---|---|
| doi | https://doi.org/10.48550/arxiv.2411.04319 |
| ids.doi | https://doi.org/10.48550/arxiv.2411.04319 |
| ids.openalex | https://openalex.org/W4404404447 |
| fwci | |
| type | preprint |
| title | Towards Optimizing SQL Generation via LLM Routing |
| biblio.issue | |
| biblio.volume | |
| biblio.last_page | |
| biblio.first_page | |
| topics[0].id | https://openalex.org/T10715 |
| topics[0].field.id | https://openalex.org/fields/17 |
| topics[0].field.display_name | Computer Science |
| topics[0].score | 0.9890999794006348 |
| topics[0].domain.id | https://openalex.org/domains/3 |
| topics[0].domain.display_name | Physical Sciences |
| topics[0].subfield.id | https://openalex.org/subfields/1705 |
| topics[0].subfield.display_name | Computer Networks and Communications |
| topics[0].display_name | Distributed and Parallel Computing Systems |
| topics[1].id | https://openalex.org/T10317 |
| topics[1].field.id | https://openalex.org/fields/17 |
| topics[1].field.display_name | Computer Science |
| topics[1].score | 0.9830999970436096 |
| topics[1].domain.id | https://openalex.org/domains/3 |
| topics[1].domain.display_name | Physical Sciences |
| topics[1].subfield.id | https://openalex.org/subfields/1705 |
| topics[1].subfield.display_name | Computer Networks and Communications |
| topics[1].display_name | Advanced Database Systems and Queries |
| topics[2].id | https://openalex.org/T10679 |
| topics[2].field.id | https://openalex.org/fields/17 |
| topics[2].field.display_name | Computer Science |
| topics[2].score | 0.9789000153541565 |
| topics[2].domain.id | https://openalex.org/domains/3 |
| topics[2].domain.display_name | Physical Sciences |
| topics[2].subfield.id | https://openalex.org/subfields/1710 |
| topics[2].subfield.display_name | Information Systems |
| topics[2].display_name | Service-Oriented Architecture and Web Services |
| is_xpac | False |
| apc_list | |
| apc_paid | |
| concepts[0].id | https://openalex.org/C41008148 |
| concepts[0].level | 0 |
| concepts[0].score | 0.590106725692749 |
| concepts[0].wikidata | https://www.wikidata.org/wiki/Q21198 |
| concepts[0].display_name | Computer science |
| concepts[1].id | https://openalex.org/C510870499 |
| concepts[1].level | 2 |
| concepts[1].score | 0.5330430865287781 |
| concepts[1].wikidata | https://www.wikidata.org/wiki/Q47607 |
| concepts[1].display_name | SQL |
| concepts[2].id | https://openalex.org/C74172769 |
| concepts[2].level | 2 |
| concepts[2].score | 0.4508325159549713 |
| concepts[2].wikidata | https://www.wikidata.org/wiki/Q1446839 |
| concepts[2].display_name | Routing (electronic design automation) |
| concepts[3].id | https://openalex.org/C77088390 |
| concepts[3].level | 1 |
| concepts[3].score | 0.3096718490123749 |
| concepts[3].wikidata | https://www.wikidata.org/wiki/Q8513 |
| concepts[3].display_name | Database |
| concepts[4].id | https://openalex.org/C31258907 |
| concepts[4].level | 1 |
| concepts[4].score | 0.27552229166030884 |
| concepts[4].wikidata | https://www.wikidata.org/wiki/Q1301371 |
| concepts[4].display_name | Computer network |
| keywords[0].id | https://openalex.org/keywords/computer-science |
| keywords[0].score | 0.590106725692749 |
| keywords[0].display_name | Computer science |
| keywords[1].id | https://openalex.org/keywords/sql |
| keywords[1].score | 0.5330430865287781 |
| keywords[1].display_name | SQL |
| keywords[2].id | https://openalex.org/keywords/routing |
| keywords[2].score | 0.4508325159549713 |
| keywords[2].display_name | Routing (electronic design automation) |
| keywords[3].id | https://openalex.org/keywords/database |
| keywords[3].score | 0.3096718490123749 |
| keywords[3].display_name | Database |
| keywords[4].id | https://openalex.org/keywords/computer-network |
| keywords[4].score | 0.27552229166030884 |
| keywords[4].display_name | Computer network |
| language | en |
| locations[0].id | pmh:oai:arXiv.org:2411.04319 |
| locations[0].is_oa | True |
| locations[0].source.id | https://openalex.org/S4306400194 |
| locations[0].source.issn | |
| locations[0].source.type | repository |
| locations[0].source.is_oa | True |
| locations[0].source.issn_l | |
| locations[0].source.is_core | False |
| locations[0].source.is_in_doaj | False |
| locations[0].source.display_name | arXiv (Cornell University) |
| locations[0].source.host_organization | https://openalex.org/I205783295 |
| locations[0].source.host_organization_name | Cornell University |
| locations[0].source.host_organization_lineage | https://openalex.org/I205783295 |
| locations[0].license | |
| locations[0].pdf_url | https://arxiv.org/pdf/2411.04319 |
| locations[0].version | submittedVersion |
| locations[0].raw_type | text |
| locations[0].license_id | |
| locations[0].is_accepted | False |
| locations[0].is_published | False |
| locations[0].raw_source_name | |
| locations[0].landing_page_url | http://arxiv.org/abs/2411.04319 |
| locations[1].id | doi:10.48550/arxiv.2411.04319 |
| locations[1].is_oa | True |
| locations[1].source.id | https://openalex.org/S4306400194 |
| locations[1].source.issn | |
| locations[1].source.type | repository |
| locations[1].source.is_oa | True |
| locations[1].source.issn_l | |
| locations[1].source.is_core | False |
| locations[1].source.is_in_doaj | False |
| locations[1].source.display_name | arXiv (Cornell University) |
| locations[1].source.host_organization | https://openalex.org/I205783295 |
| locations[1].source.host_organization_name | Cornell University |
| locations[1].source.host_organization_lineage | https://openalex.org/I205783295 |
| locations[1].license | |
| locations[1].pdf_url | |
| locations[1].version | |
| locations[1].raw_type | article |
| locations[1].license_id | |
| locations[1].is_accepted | False |
| locations[1].is_published | |
| locations[1].raw_source_name | |
| locations[1].landing_page_url | https://doi.org/10.48550/arxiv.2411.04319 |
| indexed_in | arxiv, datacite |
| authorships[0].author.id | https://openalex.org/A5114657975 |
| authorships[0].author.orcid | |
| authorships[0].author.display_name | Mohammadhossein Malekpour |
| authorships[0].author_position | first |
| authorships[0].raw_author_name | Malekpour, Mohammadhossein |
| authorships[0].is_corresponding | False |
| authorships[1].author.id | https://openalex.org/A5005139471 |
| authorships[1].author.orcid | https://orcid.org/0000-0001-6602-5647 |
| authorships[1].author.display_name | Nicholas J. Shaheen |
| authorships[1].author_position | middle |
| authorships[1].raw_author_name | Shaheen, Nour |
| authorships[1].is_corresponding | False |
| authorships[2].author.id | https://openalex.org/A5071052367 |
| authorships[2].author.orcid | https://orcid.org/0000-0002-5704-4173 |
| authorships[2].author.display_name | Foutse Khomh |
| authorships[2].author_position | middle |
| authorships[2].raw_author_name | Khomh, Foutse |
| authorships[2].is_corresponding | False |
| authorships[3].author.id | https://openalex.org/A5029853297 |
| authorships[3].author.orcid | |
| authorships[3].author.display_name | Amine Mhedhbi |
| authorships[3].author_position | last |
| authorships[3].raw_author_name | Mhedhbi, Amine |
| authorships[3].is_corresponding | False |
| has_content.pdf | False |
| has_content.grobid_xml | False |
| is_paratext | False |
| open_access.is_oa | True |
| open_access.oa_url | https://arxiv.org/pdf/2411.04319 |
| open_access.oa_status | green |
| open_access.any_repository_has_fulltext | False |
| created_date | 2025-10-10T00:00:00 |
| display_name | Towards Optimizing SQL Generation via LLM Routing |
| has_fulltext | False |
| is_retracted | False |
| updated_date | 2025-11-06T06:51:31.235846 |
| primary_topic.id | https://openalex.org/T10715 |
| primary_topic.field.id | https://openalex.org/fields/17 |
| primary_topic.field.display_name | Computer Science |
| primary_topic.score | 0.9890999794006348 |
| primary_topic.domain.id | https://openalex.org/domains/3 |
| primary_topic.domain.display_name | Physical Sciences |
| primary_topic.subfield.id | https://openalex.org/subfields/1705 |
| primary_topic.subfield.display_name | Computer Networks and Communications |
| primary_topic.display_name | Distributed and Parallel Computing Systems |
| related_works | https://openalex.org/W4391375266, https://openalex.org/W2899084033, https://openalex.org/W2748952813, https://openalex.org/W2390279801, https://openalex.org/W4391913857, https://openalex.org/W2358668433, https://openalex.org/W4396701345, https://openalex.org/W2376932109, https://openalex.org/W2001405890, https://openalex.org/W4320802139 |
| cited_by_count | 1 |
| counts_by_year[0].year | 2025 |
| counts_by_year[0].cited_by_count | 1 |
| locations_count | 2 |
| best_oa_location.id | pmh:oai:arXiv.org:2411.04319 |
| best_oa_location.is_oa | True |
| best_oa_location.source.id | https://openalex.org/S4306400194 |
| best_oa_location.source.issn | |
| best_oa_location.source.type | repository |
| best_oa_location.source.is_oa | True |
| best_oa_location.source.issn_l | |
| best_oa_location.source.is_core | False |
| best_oa_location.source.is_in_doaj | False |
| best_oa_location.source.display_name | arXiv (Cornell University) |
| best_oa_location.source.host_organization | https://openalex.org/I205783295 |
| best_oa_location.source.host_organization_name | Cornell University |
| best_oa_location.source.host_organization_lineage | https://openalex.org/I205783295 |
| best_oa_location.license | |
| best_oa_location.pdf_url | https://arxiv.org/pdf/2411.04319 |
| best_oa_location.version | submittedVersion |
| best_oa_location.raw_type | text |
| best_oa_location.license_id | |
| best_oa_location.is_accepted | False |
| best_oa_location.is_published | False |
| best_oa_location.raw_source_name | |
| best_oa_location.landing_page_url | http://arxiv.org/abs/2411.04319 |
| primary_location.id | pmh:oai:arXiv.org:2411.04319 |
| primary_location.is_oa | True |
| primary_location.source.id | https://openalex.org/S4306400194 |
| primary_location.source.issn | |
| primary_location.source.type | repository |
| primary_location.source.is_oa | True |
| primary_location.source.issn_l | |
| primary_location.source.is_core | False |
| primary_location.source.is_in_doaj | False |
| primary_location.source.display_name | arXiv (Cornell University) |
| primary_location.source.host_organization | https://openalex.org/I205783295 |
| primary_location.source.host_organization_name | Cornell University |
| primary_location.source.host_organization_lineage | https://openalex.org/I205783295 |
| primary_location.license | |
| primary_location.pdf_url | https://arxiv.org/pdf/2411.04319 |
| primary_location.version | submittedVersion |
| primary_location.raw_type | text |
| primary_location.license_id | |
| primary_location.is_accepted | False |
| primary_location.is_published | False |
| primary_location.raw_source_name | |
| primary_location.landing_page_url | http://arxiv.org/abs/2411.04319 |
| publication_date | 2024-11-06 |
| publication_year | 2024 |
| referenced_works_count | 0 |
| abstract_inverted_index.a | 101 |
| abstract_inverted_index.In | 38, 96 |
| abstract_inverted_index.We | 65, 85 |
| abstract_inverted_index.of | 58, 91 |
| abstract_inverted_index.on | 107 |
| abstract_inverted_index.to | 3, 12, 77 |
| abstract_inverted_index.we | 41, 99 |
| abstract_inverted_index.LLM | 45, 56, 81 |
| abstract_inverted_index.SQL | 61 |
| abstract_inverted_index.and | 32, 71, 93, 103 |
| abstract_inverted_index.for | 25, 35, 48, 62, 89 |
| abstract_inverted_index.our | 97 |
| abstract_inverted_index.the | 43, 53, 78, 87, 108 |
| abstract_inverted_index.two | 67 |
| abstract_inverted_index.BIRD | 109 |
| abstract_inverted_index.cost | 34 |
| abstract_inverted_index.each | 63 |
| abstract_inverted_index.ease | 90 |
| abstract_inverted_index.most | 54, 79 |
| abstract_inverted_index.that | 73 |
| abstract_inverted_index.they | 28 |
| abstract_inverted_index.this | 39 |
| abstract_inverted_index.with | 5 |
| abstract_inverted_index.data. | 14 |
| abstract_inverted_index.first | 44 |
| abstract_inverted_index.incur | 29 |
| abstract_inverted_index.large | 18 |
| abstract_inverted_index.ones. | 37 |
| abstract_inverted_index.users | 2 |
| abstract_inverted_index.which | 50 |
| abstract_inverted_index.while | 82 |
| abstract_inverted_index.(LLMs) | 21 |
| abstract_inverted_index.access | 11 |
| abstract_inverted_index.costs. | 84 |
| abstract_inverted_index.design | 86 |
| abstract_inverted_index.dollar | 33 |
| abstract_inverted_index.highly | 16 |
| abstract_inverted_index.models | 20 |
| abstract_inverted_index.paper, | 40 |
| abstract_inverted_index.query. | 64 |
| abstract_inverted_index.strong | 23 |
| abstract_inverted_index.(score- | 70 |
| abstract_inverted_index.achieve | 22, 74 |
| abstract_inverted_index.capable | 17, 57, 80 |
| abstract_inverted_index.complex | 26 |
| abstract_inverted_index.enables | 1 |
| abstract_inverted_index.latency | 31 |
| abstract_inverted_index.natural | 8 |
| abstract_inverted_index.present | 66 |
| abstract_inverted_index.routers | 88 |
| abstract_inverted_index.routing | 46, 68 |
| abstract_inverted_index.selects | 52 |
| abstract_inverted_index.simpler | 36 |
| abstract_inverted_index.through | 7 |
| abstract_inverted_index.Although | 15 |
| abstract_inverted_index.accuracy | 24, 75 |
| abstract_inverted_index.accurate | 60 |
| abstract_inverted_index.approach | 47 |
| abstract_inverted_index.dataset. | 110 |
| abstract_inverted_index.interact | 4 |
| abstract_inverted_index.language | 19 |
| abstract_inverted_index.queries, | 27 |
| abstract_inverted_index.reducing | 83 |
| abstract_inverted_index.training | 92 |
| abstract_inverted_index.databases | 6 |
| abstract_inverted_index.efficient | 94 |
| abstract_inverted_index.highlight | 100 |
| abstract_inverted_index.introduce | 42 |
| abstract_inverted_index.language, | 9 |
| abstract_inverted_index.practical | 102 |
| abstract_inverted_index.trade-off | 106 |
| abstract_inverted_index.comparable | 76 |
| abstract_inverted_index.generating | 59 |
| abstract_inverted_index.inference. | 95 |
| abstract_inverted_index.strategies | 69 |
| abstract_inverted_index.structured | 13 |
| abstract_inverted_index.Text-to-SQL | 0 |
| abstract_inverted_index.dynamically | 51 |
| abstract_inverted_index.explainable | 104 |
| abstract_inverted_index.simplifying | 10 |
| abstract_inverted_index.unnecessary | 30 |
| abstract_inverted_index.Text-to-SQL, | 49 |
| abstract_inverted_index.experiments, | 98 |
| abstract_inverted_index.accuracy-cost | 105 |
| abstract_inverted_index.cost-effective | 55 |
| abstract_inverted_index.classification-based) | 72 |
| cited_by_percentile_year | |
| countries_distinct_count | 0 |
| institutions_distinct_count | 4 |
| citation_normalized_percentile |