EXPO-SQL uses clause-level RL rewards to boost text-to-SQL accuracy
New method pinpoints SQL errors by rewarding individual clauses, not whole queries.
Current RL-based text-to-SQL models treat every clause in a generated query equally—if the query returns a wrong answer, all clauses get the same negative signal, even if some are correct. This coarse feedback limits learning efficiency. EXPO-SQL fixes this by breaking rewards down to the clause level. It identifies erroneous clauses by parsing database error messages and performing clause-wise incremental execution—testing how results change as each clause is added or removed. This pinpoints exactly where the model went wrong.
Tested on widely-used Text-to-SQL benchmarks, EXPO-SQL consistently beats supervised fine-tuning, prompt-based methods, and prior RL approaches. The paper is accepted at ACL 2026 Findings, and the code is available on GitHub. For developers, this means more reliable natural-language database queries with less training data and higher accuracy on complex multi-clause SQL.
- Uses execution feedback (error messages and incremental execution) to identify erroneous clauses in SQL queries
- Assigns fine-grained clause-level rewards instead of uniform query-level rewards
- Outperforms supervised fine-tuning, prompting, and existing RL methods on standard text-to-SQL benchmarks
Why It Matters
More precise SQL generation from natural language, reducing errors in complex queries and expanding database access to non-experts.