About this paper
A counterfactual-database reward for reinforcement learning text-to-SQL agents reduces full payment to buggy queries and reward hacks, though training with its mean form did not improve in-domain accuracy in a controlled GRPO comparison.
Reinforcement learning (RL) for text-to-SQL agents pays a query when its result matches the reference on one database. However, a wrong query can match by luck when the data lack the rows that expose its bug. We study a counterfactual-database (CF) reward that also runs the final query on a few hidden, code-generated copies of the database and pays only if all results match (strict form) or by the share matched (mean form). On 1,302 synthetic audit questions, the strict form lowers the share of buggy queries paid in full from 29.5% to 16.8% and of reward hacks from 54.1% to 1.9%, rejecting 0 of 2,847 correct queries; copies from a family-blind generator do about as well. In a controlled…
reinforcement learningtext-to-SQL agentscounterfactual-database rewardstrict formmean formreward hacksGRPOrolloutsin-domain accuracyfamily-blind generator
- Upvotes
- 3
- Authors
- 3
- Published
- Nov 25, 2026
Summary and abstract excerpt via Hugging Face Papers ↗ · arXiv.
Trending history
Single-Database Rewards Are Hackable: Counterfactual Execution for Trustworthy Text-to-SQL RL was first seen on Hugging Face · Daily papers on Nov 26, 2026. Since then it has appeared in 24 checks on 3 different days. Its best position was #21 of 30, reached on Nov 27, 11:29 UTC. It is #24 right now, slipping from #22 to #24 over the last 6 checks.