mlsanityData to 7 Oct 2026

Using LLM to select the right SQL Query from candidates

arXiv 2401.02115 ↗First posted 4 Jan 2024cs.CLcited by 12

Not on the map. Why?

Abstract (arXiv)

Text-to-SQL models can generate a list of candidate SQL queries, and the best query is often in the candidate list, but not at the top of the list. An effective re-rank method can select the right SQL query from the candidate list and improve the model's performance. Previous studies on code generation automatically generate test cases and use them to re-rank candidate codes. However, automatic test case generation for text-to-SQL is an understudied field. We propose an automatic test case generation method that first generates a database and then uses LLMs to predict the ground truth, which is the expected execution results of the ground truth SQL query on this database. To reduce the difficulty for LLMs to predict, we conduct experiments to search for ways to generate easy databases for LLMs and design easy-to-understand prompts. Based on our test case generation method, we propose a re-rank method to select the right SQL query from the candidate list. Given a candidate list, our method can generate test cases and re-rank the candidate list according to their pass numbers on these test cases and their generation probabilities. The experiment results on the validation dataset of Spider show that the performance of some state-of-the-art models can get a 3.6% improvement after applying our re-rank method.

Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). Builds on 19 of its 22 references that are in the map. First posted on arXiv 4 Jan 2024.

Builds on

19 of 22 references.

References · 19

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  3. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
  4. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
  5. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
  6. 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 465
  7. 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 378
  8. 2022CodeT: Code Generation with Generated Testscited by 369
  9. 2020Semantic Evaluation for Text-to-SQL with Distilled Test Suitescited by 123
  10. 2023A comprehensive evaluation of ChatGPT's zero-shot Text-to-SQL capabilitycited by 118
  11. 2020SmBoP: Semi-autoregressive Bottom-up Semantic Parsingcited by 97
  12. 2022RASAT: Integrating Relational Structures into Pretrained Seq2Seq Model for Text-to-SQLcited by 85
7 more
  1. 2019Global Reasoning over Database Structures for Text-to-SQL Parsingcited by 43
  2. 2020Understanding Image Retrieval Re-Ranking: A Graph Neural Network Perspectivecited by 24
  3. 2022N-Best Hypotheses Reranking for Text-To-SQL Systemscited by 19
  4. 2021Dynamic Hybrid Relation Network for Cross-Domain Context-Dependent Semantic Parsingcited by 15
  5. 2020Bertrand-DR: Improving Text-to-SQL using a Discriminative Re-rankercited by 12
  6. 2019Explaining Wrong Queries Using Small Examplescited by 4
  7. 2019Re-Ranking Words to Improve Interpretability of Automatically Generated Topicscited by 3

Built on by

Cited by year (2026 to 7 Oct)

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

12 papers.