mlsanityData to 13 Oct 2026

Effectiveness of Prompt Optimization in NL2SQL Systems

arXiv 2505.20591 ↗First posted 26 May 2025cs.CL cs.DBcited by 0

Not on the map. Why?

Abstract (arXiv)

NL2SQL approaches have greatly benefited from the impressive capabilities of large language models (LLMs). In particular, bootstrapping an NL2SQL system for a specific domain can be as simple as instructing an LLM with sufficient contextual information, such as schema details and translation demonstrations. However, building an accurate system still requires the rigorous task of selecting the right context for each query-including identifying relevant schema elements, cell values, and suitable exemplars that help the LLM understand domain-specific nuances. Retrieval-based methods have become the go-to approach for identifying such context. While effective, these methods introduce additional inference-time costs due to the retrieval process. In this paper, we argue that production scenarios demand high-precision, high-performance NL2SQL systems, rather than simply high-quality SQL generation, which is the focus of most current NL2SQL approaches. In such scenarios, the careful selection of a static set of exemplars-capturing the intricacies of the query log, target database, SQL constructs, and execution latencies-plays a more crucial role than exemplar selection based solely on similarity. The key challenge, however, lies in identifying a representative set of exemplars for a given production setting. To this end, we propose a prompt optimization framework that not only addresses the high-precision requirement but also optimizes the performance of the generated SQL through multi-objective optimization. Preliminary empirical analysis demonstrates the effectiveness of the proposed framework.

Key facts. No citing papers in the map yet (data through 13 Oct 2026). Builds on 15 of its 26 references that are in the map. First posted on arXiv 26 May 2025.

Builds on

15 of 26 references.

References · 15

  1. 2020Language Models are Few-Shot Learnerscited by 32,320
  2. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,412
  3. 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 680
  4. 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 472
  5. 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 383
  6. 2023Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discoverycited by 335
  7. 2024Long-context LLMs Struggle with Long In-context Learningcited by 286
  8. 2024Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programscited by 274
  9. 2024Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflowscited by 229
  10. 2023C3: Zero-shot Text-to-SQL with ChatGPTcited by 163
  11. 2024The Death of Schema Linking? Text-to-SQL in the Age of Well-Reasoned Language Modelscited by 67
  12. 2024A Preview of XiYan-SQL: A Multi-Generator Ensemble Framework for Text-to-SQLcited by 46
3 more
  1. 2024A Declarative System for Optimizing AI Workloadscited by 35
  2. 2024E-SQL: Direct Schema Linking via Question Enrichment in Text-to-SQLcited by 35
  3. 2025Is Long Context All You Need? Leveraging LLM's Extended Context for NL2SQLcited by 30

Built on by

Not cited yet.