Query and Conquer: Execution-Guided SQL Generation

📅 2025-03-31
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
In text-to-SQL tasks, lightweight models suffer from low accuracy on complex queries and high inference overhead. This paper proposes an execution-result-guided multi-candidate SQL filtering framework, introducing the first execution-feedback-driven candidate reranking paradigm. Leveraging a lightweight semantic consistency scoring mechanism, it reranks sampled SQL queries based on actual database execution validation—requiring no fine-tuning and enabling plug-and-play adaptation to any SQL generation model. Our method significantly improves semantic correctness and execution accuracy of small models on complex queries. It outperforms large reasoning models—including o1, o3-mini, and DeepSeek R1—across multiple standard benchmarks, while reducing inference cost by up to 30×. To our knowledge, this is the first approach to achieve simultaneous superiority in both accuracy and efficiency for lightweight models in text-to-SQL.

Technology Category

Natural Language Processing: Sentence-level Semantics, Textual Inference, etc.Data Mining & Knowledge Management: Intelligent Query ProcessingSearch and Optimization: Learning to Search

Application Category

Search and Retrieval-Augmented AI: Web search models and rankingSemantics and Knowledge: Methods to enhance, augment, integrate or synergize semantic models such as knowledge graphs and LLMsUser Modeling, Personalization and Recommendation: Fairness-aware retrieval and ranking
📝 Abstract
We propose a novel approach for generating complex outputs that significantly improves accuracy in text-to-SQL tasks. Our method leverages execution results to select the most semantically consistent query from multiple candidates, enabling smaller, cost-effective models to surpass computationally intensive reasoning methods such as o1, o3-mini, and DeepSeek R1 while reducing inference cost by as much as 30 times. It integrates effortlessly with existing models, offering a practical and scalable pathway to state-of-the-art SQL generation.
Problem

Research questions and friction points this paper is trying to address.

Improving accuracy in text-to-SQL tasks
Using execution results to select best query
Reducing inference cost by 30 times
Innovation

Methods, ideas, or system contributions that make the work stand out.

Execution-guided SQL query selection
Cost-effective models outperform intensive methods
Seamless integration with existing models
🔎 Similar Papers