Skip to content
conftrace_
2026 EMNLP EMNLP 2026

JudgeSQL: Reasoning over SQL Candidates with Weighted Consensus Tournament

AbstractText-to-SQL is a pivotal task that bridges natural language understanding and structured data access. Recent advances in large language models, through prompting, fine-tuning, and reinforcement learning, have greatly increased the likelihood of generating correct SQL queries. However, selecting the correct SQL from multiple candidates remains challenging. Existing approaches, such as self-consistency, Best-of-N decoding, and learned scalar ranking models, rely on shallow heuristics or lack explicit reasoning, making them prone to unstable judgments and unable to capture fine-grained semantic differences between similar queries. We propose JudgeSQL, a framework that combines reasoning-based SQL evaluation with a weighted consensus tournament. JudgeSQL develops a reasoning-based SQL judge model that distills reasoning traces with reinforcement learning guided by verifiable rewards, enabling accurate and interpretable judgments. Building on this, a weighted consensus tournament integrates explicit reasoning preferences with the generator’s execution-consistency confidence, improving both reliability and efficiency. Experiments on the BIRD benchmark demonstrate that JudgeSQL consistently outperforms prior methods, with strong generalization and robustness across model scales. The code is available at https://github.com/Jiayuan-Bai/JudgeSQL.

More from EMNLP 2026

All EMNLP 2026 papers →