Text-to-SQL systems let users without programming expertise query relational databases in natural language. Reinforcement learning has become the dominant way to train such systems, yet progress is still judged by a single number, execution accuracy, which counts correct queries but says nothing about which kinds of semantic error survive training. This paper develops a theoretical framework that examines text-to-SQL from the perspective of reward design. We introduce Reward Error Sensitivity, a measure of how strongly a reward function separates queries that contain a given error type from queries that do not, and prove a Reward Blindness theorem: when this sensitivity is zero, policy-gradient training carries no systematic signal for removing that error. Using fourteen published finegrained error signals for four text-to-SQL systems on the BIRD benchmark, we build error profiles and estimate sensitivities for common reward designs. Predicate and result-level errors are the most frequent, firing on up to 27 percent of queries, while structurally deep errors such as suboptimal joins persist at 5 to 12 percent. Each reward family has a distinct and predictable set of blind spots, and inexpensive database-level checks that need no language model calls detect 45 to 60 percent of semantic errors. Controlled training simulations confirm that executiononly reward leaves output-preserving errors untouched, whereas a signal-grounded reward removes them even when the detectors are noisy.
Figures & tables
Fig. 1: RES framework. Error types present in a generated query influence learning only through the reward; RES measures how much of each error type survives this filtering.
Reward design
ejoin
epred
eschema
eevid
estruct
Execution-only [ 2 ]
M
M
M
M
0/L
+ N-gram similarity
M
M+
M
L
0/L
+ Schema linking
M
M
M+
L
0/L
+ LLM-as-judge
M+
M+
M+
M+
L
Composite [ 3 ]
M+
M+
M+
M
L
Graph matching [ 4 ]
H
L
M
0
M
TABLE I: Theoretical RES Profiles. H = High, M = Medium, L = Low, 0 = Provably Blind on the Output-Preserving Subset
System
Pipeline
Acc.
# Incorrect
# Semantic
Vanilla
Zero-shot
59.07%
684
589
DIN-SQL [ 8 ]
Decomposed prompting
39.49%
989
835
MAC-SQL
Multi-agent
60.04%
631
601
CHESS
Context-harnessed
67.91%
497
490
TABLE II: Systems Analysed (Statistics From SQLENS [ 1 ] , Table 8)
Error signal
Type
Van.
DIN
MAC
CHE
Join errors
Suboptimal Join Tree
DB
11.9
11.5
6.4
5.1
Incorrect Join Pred.
DB
0.7
0.1
0.9
0.1
Predicate errors
Empty Predicate
DB
5.3
26.5
4.0
4.2
Value Ambiguity
DB
5.1
4.8
3.5
4.7
TABLE III: Error Signal Frequency (%) on BIRD-dev. Bold: Highest per Row; “–”: No Detections
Reward design
ejoin
epred
esch
eevid
estr
Execution-only
0.31
0.52
0.35
0.28
0.08
Composite partial
0.34
0.55
0.48
0.32
0.10
DB-signal (ours)
0.87
0.81
0.73
–
0.87
Full signal (ours)
0.87
0.81
0.81
0.87
0.87
DB-signal omits the LLM-based evidence signals (“–”).
TABLE IV: Estimated RES on BIRD-dev Using ( 7 ). Higher Means Stronger Differentiation
Error signal
RES
DIN → CHESS
Reduction
Empty Predicate
0.52
26.5% → 4.2%
84.2%
Abnormal Result
0.50
20.2% → 4.3%
78.7%
Suboptimal Join
0.31
11.5% → 5.1%
55.7%
Value Ambiguity
0.31
4.8% → 4.7%
2.1%
Incorrect GROUP BY
0.08
4.2% → 0.1%
97.6%
Spearman ρ=0.95 without GROUP BY ( n=4 , exact permutation p=0.083 ); ρ=−0.05 with all five. Descriptive only.
TABLE V: Signal-Level RES Versus Error Reduction From DIN-SQL to CHESS
Fig. 2: Share of category-level signal firings per system, computed from Table III (LLM reasoning signals excluded). From DIN-SQL to CHESS the join and schema shares rise while the evidence and structural shares fall.
Reward
corr( A,epred )
corr( A,ejoin )
Silent-join gap
Execution-only
−0.77
−0.17
+0.00
Signal-grounded
−0.78
−0.37
−0.79
Signal-grounded, noisy
−0.72
−0.30
−0.53
Silent-join gap: mean advantage of output-preserving join errors minus that of error-free queries.
TABLE VI: GRPO Advantage Analysis (Mean Over 20 Seeds; All Standard Deviations ≤ 0.03)
Fig. 3: Join error rate under GRPO training (mean of 10 seeds). Execution reward cannot reduce output-preserving join errors and reduces partly visible ones slowly; signal-grounded reward reduces them quickly even with noisy detectors.
Signal family
Signals
Cost/query
LLM calls
Coverage
DB-only
9
∼ 30 ms
0
45.5–59.6%
LLM-only
5
∼ 500 ms
1
19.2–29.6%
Combined
14
∼ 530 ms
1
64.7–89.2%
TABLE VII: Cost–Coverage Trade-Off of Signal Families