NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQL

Mohammadreza Pourreza, Hailong Li, Ruoxi Sun, Yeounoh Chung, Shayan Talaei, Gaurav Tarlok Kakkar, Yu Gan, Amin Saberi, Fatma Ozcan, Sercan O Arik

TL;DR

CHASE-SQL is a multi-agent framework that achieves state-of-the-art results in Text-to-SQL by shifting the focus from simple query generation to "test-time compute." By generating diverse candidates through three distinct reasoning paths and using a fine-tuned selection agent to pick the winner via pairwise comparisons, it reached a record-breaking 73.0% accuracy on the BIRD benchmark.

The Challenge of Text-to-SQL Selection

Converting natural language into SQL (Text-to-SQL) is notoriously difficult when dealing with complex database schemas and multi-step reasoning. While Large Language Models (LLMs) are adept at generating SQL, they often stumble on "reasoning-heavy" queries.

The authors identify a specific bottleneck: Selection. Current systems often use "self-consistency" (sampling multiple times and picking the most frequent answer). However, the authors found a significant performance gap between self-consistency and the theoretical "upper bound" (the accuracy achieved if the model could always pick the correct query from its generated candidate pool). In other words, the model often generates the right answer, but it doesn't know how to pick it. CHASE-SQL aims to bridge this gap.

The CHASE-SQL Framework

CHASE-SQL employs a multi-agent architecture divided into two main phases: Candidate Generation and Preference-Optimized Selection.

CHASE-SQL Architecture

1. Multi-Path Candidate Generation

Instead of just asking an LLM for a query multiple times, CHASE-SQL uses three specialized strategies to ensure a diverse pool of candidates:

  • Divide and Conquer (DC) CoT: Decomposes a complex question into smaller sub-problems, solves them with "pseudo-SQL," and then assembles the final query.
  • Query Plan (QP) CoT: Inspired by how database engines work, this method generates a human-readable execution plan (e.g., "Scan table A, join with B on ID, filter by date") before writing the SQL.
  • Online Synthetic (OS) Example Generation: For every new question, the system generates tailored, synthetic "many-shot" examples on the fly to help the model understand the specific schema and logic required.

2. The Selection Agent

This is the framework's core innovation. Rather than relying on majority voting, the authors fine-tuned a model (Gemini 1.5 Flash) to act as a judge.

  • Pairwise Comparison: The agent takes two candidate queries and the database schema, then decides which one is better.
  • Tournament Ranking: By comparing all candidates in pairs, the system builds a comparison matrix and selects the query with the highest cumulative score.

3. The Query Fixer

An iterative loop takes queries that result in execution errors or empty sets and attempts to "self-correct" them based on the error feedback.

Key Insights

  • Diversity Over Consistency: The most frequent answer is not always the right one. By forcing the LLM to take different "paths" (Divide and Conquer vs. Query Plan), the system is more likely to find the correct logic for edge cases.
  • The Power of "Test-Time Compute": Spending more compute at inference time—generating more candidates and carefully judging them—yields massive gains without needing a larger base model.
  • Pairwise Judging is Robust: Fine-tuning a model to compare just two options is significantly more accurate (71.01% binary accuracy) than asking a model to rank a long list of candidates.
  • Synthetic "Many-Shot" Works: Generating relevant synthetic examples for the specific query at hand outperforms picking a few "similar" examples from a static training set.

State-of-the-Art Results

The framework was evaluated on the two most prominent Text-to-SQL benchmarks: BIRD (Big Bench for Intelligent REasoning in Databases) and Spider.

Benchmark Results on BIRD and Spider
  • BIRD Benchmark: Achieved 73.0% Execution Accuracy (EX) on the test set, taking the #1 spot on the leaderboard at the time of submission.
  • Spider Benchmark: Achieved 87.6% EX, placing second among all methods, despite not being specifically optimized for Spider’s distribution.
  • Ablation Gains: The selection agent alone provided a ~6% improvement over standard majority voting (self-consistency).
  • Open-Source Success: Even using open-source models (Mistral Large as generator and Qwen-2.5-Coder as selector), the framework achieved 70.33% on the BIRD dev set, outperforming many proprietary-model-based systems.

Limitations and Future Work

While highly effective, CHASE-SQL has limitations. Current benchmarks assume every question is answerable, but real-world queries are often ambiguous or impossible to answer given the data; CHASE-SQL lacks a robust mechanism to flag these. Additionally, generating many candidates and performing pairwise comparisons increases latency and computational cost. Future iterations may move beyond simple candidate selection toward more complex search algorithms, such as Monte Carlo Tree Search, for SQL generation.

Summary updated

BibTeX
@inproceedings{pourreza2025chase,
  author = {Mohammadreza Pourreza and Hailong Li and Ruoxi Sun and Yeounoh Chung and Shayan Talaei and Gaurav Tarlok Kakkar and Yu Gan and Amin Saberi and Fatma Ozcan and Sercan O Arik},
  title = {{CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQL}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=CvGqMD5OtX},
}
Figure