arXiv:2608.22651cs.CLAug 2026

Manuscript Offprint

arXiv:2608.22651

Iteration Without Elaboration: A Simple ReAct Architecture Suffices for Text-to-SQL Generation

Jian Lu, Haiwei Yu, Raymond M Xiong, Anru Zhang, Danyang Zhuo

Abstract

Modern text-to-SQL systems have become increasingly elaborate, relying on schema-linking modules, retrieval-augmented prompting, candidate generation, and multi-stage refinement pipelines. While effective, these additions introduce substantial latency and engineering overhead. To this end, we present ReAct-SQL, a simple yet effective zero-shot ReAct-style framework built solely on iterative reasoning and a constrained action space defined by a typed Domain-Specific Language (DSL) of 15 relational operations, rather than free-form SQL generation. The model incrementally issues DSL calls, observes compiled-SQL execution feedback, and revises its reasoning through interaction. On corrected BIRD mini-dev and EHR-SQL, ReAct-SQL achieves 84.5% and 73.9% accuracy, respectively, matching substantially more elaborate baselines while running up to 8× faster. Incremental ablations further show that iteration primarily improves grounding, while the DSL improves compositional reliability.

1 Introduction

Text-to-SQL—translating natural-language questions into executable queries against a relational database—is a long-standing problem that large language models (LLMs) have recently achieved substantial performance improvements on popular benchmarks(Li et al., 2023; Yu et al., 2018). Yet unlike most code-generation tasks, SQL is not a free-standing programming language: its correctness is inseparable from the database it targets. The same question against two schemas can require completely different queries, and a single wrong column name, misaligned join, or format mismatch on a join key silently invalidates the answer. In this sense, text-to-SQL is less a code-generation problem than a schema-conditioned reasoning problem.

Recent work spans one-shot prompting, fixed multi-stage pipelines, feedback-driven agentic loops, and retrieval-augmented in-context learning ( §2§2)—each adding components for incremental accuracy gains, but underweighting their resulting cost-latency profile. Latency in particular is a hard constraint that money cannot buy its way out of: a pipeline with high latency is unusable in an interactive setting regardless of its budget. A second deployment friction comes from in-context retrieval: pipelines that rely on retrieved question–SQL pairs cannot be applied to private or enterprise databases without first labeling a corpus.

Empirically, we find that text-to-SQL failures fall into two largely orthogonal categories. The first arises when the target query is long or deeply nested: the model hallucinates non-existent tables or columns, or emits syntactically invalid SQL. The second arises when schema and table names are opaque (e.g. chartevents, d_icd_diagnoses): the model cannot reliably identify which table or column the question refers to. We refer to these as the composition problem (producing well-formed, executable SQL) and the grounding problem (mapping the question to the correct tables and columns), respectively.

These two failure modes call for two distinct solution mechanisms. Composition fits naturally into a typed action space: rather than re-emitting raw SQL at every step, the model operates over a small, closed vocabulary of relational operations whose validity is checked at compile time, eliminating the per-turn SQL-parsing burden and catching column-name errors before execution. Grounding fits naturally into iteration: by interacting with the database over multiple rounds—probing value distributions, verifying join keys, sampling rows—the model can disambiguate concepts before committing to a final query. As a secondary benefit, each operation in a typed action space forms a named intermediate, yielding a step-decomposed trace whose reasoning is open to inspection.

To this end, we propose ReAct-SQL, a zero-shot agentic framework in which the LLM never generates SQL directly. Given only the database schema and the natural-language question—with no schema-linking module, no candidate prefilling, and no retrieved demonstrations—the model constructs the query through a typed domain-specific language (DSL) over an immutable Relation abstraction in a ReAct-style loop (Yao et al., 2023). The DSL targets composition; the loop targets grounding; the resulting trace doubles as a step-decomposed record of the model's reasoning. To evaluate this design comprehensively, we look beyond the end-task accuracy that most prior work emphasizes and additionally measure cost and latency under matched models and identical settings, reporting per-query cost and median latency. Our contributions are threefold:

• A vanilla ReAct loop suffices for competitive text-to-SQL. We show that a plain think→act→observe loop—without schema linking, retrieval, candidate sampling, or dedicated verifiers—reaches competitive accuracy at substantially lower cost and latency than more elaborate pipelines.

• A typed DSL as the LLM’s constrained action space. Targeting the composition problem, we replace free-form SQL generation with a typed DSL: the model is exposed only to 15 schema-validated relational operations (12 Relation-building plus 3 read-only probing) over an immutable Relation abstraction, with column references checked at compile time rather than at execution.

• A comprehensive accuracy–efficiency analysis. Where prior work focuses primarily on accuracy, we benchmark text-to-SQL pipelines end-to-end under identical conditions and find that recent systems cluster tightly in accuracy yet diverge dramatically in cost and latency, suggesting that future evaluation of deployable text-to-SQL should treat both as first-class metrics alongside accuracy.