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 hidd
Single-Database Rewards Are Hackable: Counterfactual Execution for Trustworthy Text-to-SQL RL
A counterfactual-database (CF) reward that also runs a text-to-SQL agent's final query on a few hidden databases closes a reward-hacking gap in reinforcement learning for text-to-SQL, according to the research. The single-database reward used in standard RL pays a query when its result matches the reference on one database, but a wrong query can match by luck when the data lack the rows that expose its bug.
When training or evaluating text-to-SQL agents, run the final query against several counterfactual databases so lucky matches on a single database don't reward buggy queries.
more in playbook: Evals and testing for LLM appsRun your AI side-project on zahid.host
EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.