dorsal/arxiv
View SchemaReflective Reasoning for SQL Generation
| Authors | Isabelle Mohr, Joao Gandarela, John Dujany, Andre Freitas |
|---|---|
| Categories | |
| ArXiv ID | 2601.06678vv1 |
| URL | https://arxiv.org/abs/2601.06678 |
| License | http://creativecommons.org/licenses/by/4.0/ |
Abstract
Robust text-to-SQL over complex, real-world databases remains brittle even with modern LLMs: iterative refinement often introduces syntactic and semantic drift, corrections tend to be non-transferable across queries, and naive use of large context windows scales poorly. We propose a controlled text-to-SQL framework built around reflective refinement. Instead of repeatedly rewriting the current SQL instance, the system decomposes generation into typed stages and applies feedback as persistent updates to the stage-level generation mechanism. A Reflection-Refinement Loop localizes violations to the responsible stage maximize preservation of previously validated constraints and support monotonic improvement over a query set. The method operates without gold SQL by combining interpreter-based checks with LLM-based semantic coverage verification as epistemic judges. Experiments on Spider and BIRD demonstrate consistent gains over strong prompting baselines, robust convergence within a small refinement budget, and improved execution accuracy across both frontier and open-weight model families.
{
"annotation_id": "13b7fabb-bcec-4a81-b21b-f1cdd0539cfa",
"date_created": "2026-02-17T05:53:08.618000Z",
"date_modified": "2026-02-17T05:53:08.618000Z",
"file_hash": "e779db8dee4dfd76bba962d394de0d82d25fb51fcedd0933c6e1982ac8bb4a86",
"private": false,
"record": {
"abstract": "Robust text-to-SQL over complex, real-world databases remains brittle even with modern LLMs: iterative refinement often introduces syntactic and semantic drift, corrections tend to be non-transferable across queries, and naive use of large context windows scales poorly. We propose a controlled text-to-SQL framework built around reflective refinement. Instead of repeatedly rewriting the current SQL instance, the system decomposes generation into typed stages and applies feedback as persistent updates to the stage-level generation mechanism. A Reflection-Refinement Loop localizes violations to the responsible stage maximize preservation of previously validated constraints and support monotonic improvement over a query set. The method operates without gold SQL by combining interpreter-based checks with LLM-based semantic coverage verification as epistemic judges. Experiments on Spider and BIRD demonstrate consistent gains over strong prompting baselines, robust convergence within a small refinement budget, and improved execution accuracy across both frontier and open-weight model families.",
"arxiv_id": "2601.06678",
"authors": [
"Isabelle Mohr",
"Joao Gandarela",
"John Dujany",
"Andre Freitas"
],
"categories": [
"cs.DB"
],
"license": "http://creativecommons.org/licenses/by/4.0/",
"title": "Reflective Reasoning for SQL Generation",
"url": "https://arxiv.org/abs/2601.06678",
"version": "v1"
},
"schema_id": "dorsal/arxiv",
"source": {
"execution_id": "24469194-f4ea-4e32-8ef3-8fa8a6489feb",
"id": "arXiv Dataset",
"type": "Model",
"variant": "snapshot-2026-01-17",
"version": "0.1.0"
},
"user_id": 1000002
}