mlsanityData to 14 Oct 2026

GradeSQL: Test-Time Inference with Outcome Reward Models for Text-to-SQL Generation from Large Language Models

arXiv 2509.01308 ↗First posted 1 Sep 2025cs.AI cs.CL cs.DBcited by 0

On the map: LLM reasoning → Knowledge- and tool-augmented reasoning

also in 1 more
Abstract (arXiv)

Text-to-SQL, the task of translating natural language questions into SQL queries, has significantly advanced with the introduction of Large Language Models (LLMs), broadening database accessibility for a wide range of users. Despite substantial progress in generating valid SQL, current LLMs still struggle with complex queries. To address this limitation, test-time strategies such as Best-of-N (BoN) and Majority Voting (Maj) are often employed, based on the assumption that LLMs can produce correct answers after multiple attempts. However, these methods rely on surface-level heuristics, selecting the syntactically correct query through execution-based BoN (ex-BoN) or the most frequently generated one through Majority Voting. Recently, Outcome Reward Models (ORMs), which assign utility scores to generated outputs based on semantic correctness, have emerged as a promising reinforcement learning approach for improving model alignment. We argue that ORMs could serve as an effective new test-time heuristic, although their application in this context remains largely underexplored. In this work, we propose a unified framework for training ORMs tailored to the Text-to-SQL task and assess their effectiveness as a test-time heuristic within the BoN strategy. We benchmark ORMs against ex-BoN and Maj across the BIRD and Spider datasets, fine-tuning diverse open-source LLMs from the Qwen2, Granite3, and Llama3 families. Results show that ORMs outperform ex-BoN and Maj, achieving execution accuracy gains of +4.33% (BIRD) and +2.10% (Spider) over ex-BoN, and +2.91% (BIRD) and +0.93% (Spider) over Maj. We further demonstrate that finetuning models already aligned with SQL generation, such as OmniSQL, yields superior ORM performance. Additionally, we observe that ORMs achieve competitive results on simple queries and benefit more from an increased number of candidates compared to ex-BoN and Maj.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Knowledge- and tool-augmented reasoning, one of 17 directions in LLM reasoning. Builds on 56 of its 77 references that are in the map. First posted on arXiv 1 Sep 2025.

Builds on

56 of 77 references.

Closest ancestors · 3

Same direction, newest first

  1. 2025CSC-SQL: Corrective Self-Consistency in Text-to-SQL via Reinforcement Learning19 May
  2. 2025STaR-SQL: Self-Taught Reasoner for Text-to-SQL19 Feb
  3. 2025Rationalization Models for Text-to-SQL10 Feb

Other references · 53

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  2. 2023GPT-4 Technical Reportcited by 18,396
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  4. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  5. 2021Training Verifiers to Solve Math Word Problemscited by 10,109
  6. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  7. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
  8. 2019The Curious Case of Neural Text Degenerationcited by 2,916
  9. 2022Solving Quantitative Reasoning Problems with Language Modelscited by 1,392
  10. 2018Hierarchical Neural Story Generationcited by 1,193
  11. 2023PaLM 2 Technical Reportcited by 1,162
  12. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
38 more
  1. 2024Large Language Monkeys: Scaling Inference Compute with Repeated Samplingcited by 991
  2. 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 688
  3. 2022Contrastive Decoding: Open-ended Text Generation as Optimizationcited by 609
  4. 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 477
  5. 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 424
  6. 2025The Lessons of Developing Process Reward Models in Mathematical Reasoningcited by 415
  7. 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 385
  8. 2022CodeT: Code Generation with Generated Testscited by 384
  9. 2023RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLcited by 195
  10. 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 187
  11. 2023MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQLcited by 164
  12. 2024Teaching Large Language Models to Reason with Reinforcement Learningcited by 160
  13. 2024Next-Generation Database Interfaces: A Survey of LLM-based Text-to-SQLcited by 120
  14. 2023A comprehensive evaluation of ChatGPT's zero-shot Text-to-SQL capabilitycited by 119
  15. 2025Process Reward Models That Thinkcited by 118
  16. 2022Locally Typical Samplingcited by 111
  17. 2023Graphix-T5: Mixing Pre-Trained Transformers with Graph-Aware Layers for Text-to-SQL Parsingcited by 93
  18. 2025OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scalecited by 91
  19. 2022On Decoding Strategies for Neural Text Generatorscited by 90
  20. 2024The Dawn of Natural Language to SQL: Are We Fully Ready?cited by 79
  21. 2020Grounded Adaptation for Zero-shot Executable Semantic Parsingcited by 76
  22. 2019Representing Schema Structure with Graph Neural Networks for Text-to-SQL Parsingcited by 74
  23. 2024A Survey of Text-to-SQL in the Era of LLMs: Where are we, and where are we going?cited by 56
  24. 2024Synthesizing Text-to-SQL Data from Weak and Strong LLMscited by 54
  25. 2023ScienceBenchmark: A Complex Real-World Benchmark for Evaluating Natural Language to SQL Systemscited by 45
  26. 2024Think Twice Before Trusting: Self-Detection for Large Language Models through Comprehensive Answer Reflectioncited by 41
  27. 2024FinSQL: Model-Agnostic LLMs-based Text-to-SQL Framework for Financial Analysiscited by 36
  28. 2024Knowledge-to-SQL: Enhancing SQL Generation with Data Expert LLMcited by 35
  29. 2024MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQLcited by 35
  30. 2018Question Generation from SQL Queries Improves Neural Semantic Parsingcited by 29
  31. 2024Mirror-Consistency: Harnessing Inconsistency in Majority Votingcited by 17
  32. 2023Mind's Mirror: Distilling Self-Evaluation Capability and Comprehensive Thinking from Large Language Modelscited by 13
  33. 2024ROUTE: Robust Multitask Tuning and Collaboration for Text-to-SQLcited by 13
  34. 2025Extractive Schema Linking for Text-to-SQLcited by 13
  35. 2024You Only Read Once (YORO): Learning to Internalize Database Knowledge for Text-to-SQLcited by 11
  36. 2025Learning to Reason from Feedback at Test-Timecited by 10
  37. 2025Knowledge Base Construction for Knowledge-Augmented Text-to-SQLcited by 9
  38. 2025From Outcomes to Processes: Guiding PRM Learning from ORM for Inference-Time Alignmentcited by 9

50 most cited of 53 All 53 (JSON)

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Test-Time Verification for Text-to-SQL via Outcome Reward Models
  2. 2025Arctic-Text2SQL-R1: Simple Rewards, Strong Reasoning in Text-to-SQL
  3. 2025SLM-SQL: An Exploration of Small Language Models for Text-to-SQL
  4. 2025PaVeRL-SQL: Text-to-SQL via Partial-Match Rewards and Verbal Reinforcement Learning
  5. 2025Reasoning-SQL: Reinforcement Learning with SQL Tailored Partial Rewards for Reasoning-Enhanced Text-to-SQL
  6. 2025JudgeSQL: Reasoning over SQL Candidates with Weighted Consensus Tournament
  7. 2025CogniSQL-R1-Zero: Lightweight Reinforced Reasoning for Efficient SQL Generation
  8. 2025Beyond Query-Level Comparison: Fine-Grained Reinforcement Learning for Text-to-SQL with Automated Interpretable Critiques