SQLoom: Set-Contrastive Learning of Syntactic, Semantic, and Logical Dependencies for Text-to-SQL
Not on the map. Why?
Abstract (arXiv)
Text-to-SQL translates natural language questions into SQL queries, enabling database access without writing SQL. Fine-tuning open-weight large language models (LLMs) is cost-effective, but existing methods treat SQL as ordinary text and optimize token-level likelihood without explicitly modeling its syntactic, semantic, and logical requirements. Thus, a single incorrect alias or comparison operator can invalidate a query while contributing little to training loss. We propose SQLoom, a constraint-aware fine-tuning framework with supervision at three levels: syntactic validity under SQL grammar and database schema, semantic alignment between query decisions and the question, and logical consistency across dependent clause decisions. SQLoom extends supervised fine-tuning with a unified set-contrastive objective favoring sets of correct outputs over minimally different incorrect ones at each level. LLM agents propose this supervision, which a SQL parser and execution on counterexample databases verify. We also release Spider-Refined, a training dataset correcting 378 flawed Spider annotations and enriching database schemas. Experiments on Spider, BIRD, and three perturbed Spider variants show that SQLoom improves execution accuracy for Qwen3-1.7B from 62.9% zero-shot to 88.7% on Spider development, reaching 89.2% on Spider test and 73.4% on BIRD development. It outperforms fine-tuning, reinforcement learning, and agent-based baselines with up to 70 billion parameters. On question perturbations, SQLoom loses at most 0.6 accuracy points versus up to 12.1 for agent-based methods. It generates SQL in a single pass at 0.42s per query, 23× faster than a GPT-4-based agent method. These results demonstrate the effectiveness of set-contrastive supervision over token-level training.
Key facts. No citing papers in the map yet (data through 26 Nov 2026). Builds on 31 of its 46 references that are in the map. Submitted 2 Nov 2026.
Builds on
31 of 46 references.
References · 31
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,494
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,205
- 2021Robust fine-tuning of zero-shot modelscited by 850
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 747
- 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 714
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 503
- 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 446
- 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 432
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 407
- 2023RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLcited by 204
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 196
- 2023MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQLcited by 184
19 more
- 2020Semantic Evaluation for Text-to-SQL with Distilled Test Suitescited by 137
- 2024Next-Generation Database Interfaces: A Survey of LLM-based Text-to-SQLcited by 132
- 2020Structure-Grounded Pretraining for Text-to-SQLcited by 131
- 2021Towards Robustness of Text-to-SQL Models against Synonym Substitutioncited by 117
- 2021Exploring Underexplored Limitations of Cross-Domain Text-to-SQL Generalizationcited by 97
- 2023Graphix-T5: Mixing Pre-Trained Transformers with Graph-Aware Layers for Text-to-SQL Parsingcited by 95
- 2025SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learningcited by 78
- 2025Reasoning-SQL: Reinforcement Learning with SQL Tailored Partial Rewards for Reasoning-Enhanced Text-to-SQLcited by 67
- 2024Before Generation, Align it! A Novel and Effective Strategy for Mitigating Hallucinations in Text-to-SQL Generationcited by 57
- 2025Arctic-Text2SQL-R1: Simple Rewards, Strong Reasoning in Text-to-SQLcited by 47
- 2023SQL-PaLM: Improved Large Language Model Adaptation for Text-to-SQL (extended)cited by 44
- 2024MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQLcited by 36
- 2024Decomposition for Enhancing Attention: Improving LLM-based Text-to-SQL through Workflow Paradigmcited by 32
- 2025Automatic Metadata Extraction for Text-to-SQLcited by 31
- 2025ExCoT: Optimizing Reasoning for Text-to-SQL with Execution Feedbackcited by 29
- 2024SQLFixAgent: Towards Semantic-Accurate Text-to-SQL Parsing via Consistency-Enhanced Multi-Agent Collaborationcited by 14
- 2025Uncovering the Impact of Chain-of-Thought Reasoning for Direct Preference Optimization: Lessons from Text-to-SQLcited by 10
- 2025JOLT-SQL: Joint Loss Tuning of Text-to-SQL with Confusion-aware Noisy Schema Samplingcited by 5
- 2026EXPO-SQL: Execution-based Clause-level Policy Optimization for Text-to-SQLcited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024Open-SQL Framework: Enhancing Text-to-SQL on Open-source Large Language Models
- 2025SLM-SQL: An Exploration of Small Language Models for Text-to-SQL
- 2026Integrating Reasoning and Generalization in Text-to-SQL via Self-Enhanced Fine-Tuning
- 2024SelECT-SQL: Self-correcting ensemble Chain-of-Thought for Text-to-SQL
- 2025SQLForge: Synthesizing Reliable and Diverse Data to Enhance Text-to-SQL Reasoning in LLMs
- 2024ROUTE: Robust Multitask Tuning and Collaboration for Text-to-SQL
- 2025Text2SQL-Flow: A Robust SQL-Aware Data Augmentation Framework for Text-to-SQL
- 2026Human-Level Text-to-SQL via Reinforcement Learning on Verified Data, Without Pipeline Engineering