arXiv AI

Towards Optimizing SQL Generation via LLM Routing

The paper "Towards Optimizing SQL Generation via LLM Routing" proposes a routing approach for Text-to-SQL tasks that dynamically selects the most cost‑effective large language model (LLM) for each query. Two routing strategies—score‑based and classification‑based—are introduced, achieving accuracy comparable to the best LLM while reducing latency and monetary cost. The authors design the routers for easy training and efficient inference, and demonstrate a practical accuracy‑cost trade‑off on the BIRD dataset.

arXiv AI
Jun 17

Querying an astronomical database using large language models: the ALeRCE text-to-SQL system

arXiv:2606. 18108v1 Announce Type: cross Abstract: We develop a text-to-SQL (structured query language) system based on large language models (LLMs) using in-context learning and apply it to the Automatic Learning for the Rapid Classification of Events (ALeRCE) astronomical database.

By P. A. Estevez, J. Espejo-Moreira, S. Sanfeliu-Alvarez, F. Forster, A. M. Munoz Arancibia, G. Cabrera-Vives, F. E. Bauer, A. Bayo, M. Catelan, R. Dastidar, L. Hernandez-Garcia, J. A. Intriago, G. Pignata
arXiv AI
Sep 2

Replacing Training with Memory: Listwise Selection for Text-to-SQL

The paper proposes a fine‑tuning‑free listwise selector for Text‑to‑SQL systems that replaces traditional learning objectives with inference‑time strategies. It introduces reusable structured memories (MaP‑SQL) that encode mappings from natural language to schema elements, SQL operations, and expected outputs, and uses these memories to evaluate candidate queries. To reduce positional bias, the method aggregates rankings across multiple input permutations, optimizing inference cost through execution results and pointwise scoring. The approach achieves higher selection accuracy, fewer unnecessary comparisons, and outperforms the prior state‑of‑the‑art R^3‑SQL on the BIRD‑dev benchmark while using fewer tokens.

By Yeonseok Jeong, Soyoung Yoon, Seongjun Lee, Seung-won Hwang
arXiv Computation and Language
Aug 25

SPOC-SQL: Stage-wise Preference Optimization for Controllable Text-to-SQL

SPOC-SQL introduces a stage-wise approach to Text-to-SQL, breaking the task into four sequential subtasks aligned with standard SQL execution logic. It applies fine-grained preference optimization at key decision points and a structured decomposition strategy, enabling explicit intermediate representations for stage-wise intervention and correction. The method yields more controllable and reliable SQL generation, with experiments showing that incorporating stage-wise human knowledge consistently improves performance.

By Yingnan Chen, Chun Ding, Tianshi Xu, Xu Yang, Si Wu