arXiv AI

Reflect-SQL: A Self-Reflection Based Framework for Text-to-SQL

Reflect‑SQL is a new framework for converting natural language into SQL queries. It tackles challenges such as large, obscure database schemas, poor table and column retrieval, and syntactically or logically flawed SQL by using a multi‑stage self‑reflection approach. The system iteratively refines queries and SQL through feedback loops driven by an LLM‑as‑a‑judge, achieving 72.03% execution accuracy on the BIRD benchmark, outperforming existing baselines.

arXiv Computation and Language
Aug 25

SPOC-SQL: Stage-wise Preference Optimization for Controllable Text-to-SQL

SPOC-SQL introduces a stage-wise approach to Text-to-SQL, breaking the task into four sequential subtasks aligned with standard SQL execution logic. It applies fine-grained preference optimization at key decision points and a structured decomposition strategy, enabling explicit intermediate representations for stage-wise intervention and correction. The method yields more controllable and reliable SQL generation, with experiments showing that incorporating stage-wise human knowledge consistently improves performance.

By Yingnan Chen, Chun Ding, Tianshi Xu, Xu Yang, Si Wu
Hugging Face Trending Papers
Jul 14

Finding the Right Tables and Columns: A Benchmark and Corpus-Adaptive Embeddings for SQL Schema Retrieval

Retrieval in the SQL setting has largely been studied as the task of finding, within a large collection of SQL statements, the statement that answers a natural-language question. At scale, however, a more fundamental retrieval problem precedes generation: schema retrieval, identifying the tables and columns a question requires in a database that may contain thousands of them, far more than fit in a model's context.

arXiv Machine Learning
1d ago

Dial: A Knowledge-Grounded Dialect-Specific NL2SQL System

The paper introduces Dial, a knowledge‑grounded framework for generating SQL queries that respect the specific dialect of heterogeneous database systems. Dial comprises a Dialect‑Aware Logical Query Planning module, a hierarchical intent‑aware knowledge base (HINT‑KB) containing canonical syntax, function, and constraint repositories, and an execution‑driven debugging loop that separates syntactic recovery from logic auditing. The authors also present DS‑NL2SQL, a benchmark of 2,218 dialect‑specific test cases across six major database systems, and report that Dial improves translation accuracy by 10.25% and dialect feature coverage by 15.77% over existing baselines.

By Xiang Zhang, Hongming Xu, Le Zhou, Wei Zhou, Xuanhe Zhou, Guoliang Li, Yuyu Luo, Changdong Liu, Guorun Chen, Jiang Liao, Fan Wu