Applied Sciences

MERC-SQL: Heterogeneous Execution Consensus with a Fixed Number of SQL Candidates

Yuanjie Wang, Jie Feng, Cuilin Wang, Kaiwen Tan, Zhenhan Wang

Key points

From the paper's conclusion
  • We propose MERC-SQL, a heterogeneous execution-consensus method with a fixed pool of five candidates.

Abstract

Large language models (LLMs) can improve text-to-structured query language (text-to-SQL) accuracy by generating several candidate queries and selecting an answer through agreement among their execution results. However, candidates from the same generator can share errors and reinforce the same incorrect result, leaving a correct candidate with insufficient support. We propose MERC-SQL, a heterogeneous execution-consensus method with a fixed pool of five candidates. The method constructs prompts from the question, provided evidence, and database schema; replaces one primary-generator candidate with an auxiliary-generator candidate; groups valid queries via normalized execution results; and selects a query using group support and a fixed candidate order. Using OmniSQL-7B and Qwen2.5-Coder-7B-Instruct, MERC-SQL achieves execution accuracies of 57.95% on 1534 BIRD development questions and 79.04% on 2147 Spider test questions under a unified single database-instance evaluation protocol. These results improve on five-candidate OmniSQL voting by 1.30 and 0.75 percentage points, respectively. On BIRD, correct candidate coverage increases from 67.01% to 70.14%. Under the evaluated five-candidate protocol, four OmniSQL candidates plus one Qwen candidate outperform the baseline of five OmniSQL candidates. Identical-pool comparisons and voting transition analyses characterize the selection behavior and changes in result-group support. The contributions of model replacement and decoding diversity have not been isolated; model heterogeneity is therefore a plausible contributing factor rather than an independently established cause of the improvement.

Read the paper

Discussion

Science Skim's AI key points, plus readers' public thoughts

Readers' thoughts

No reader thoughts yet.

Related papers

MERC-SQL: Heterogeneous Execution Consensus with a Fixed Number of SQL Candidates — Science Skim