How AI Labs Are Finally Beating Humans at SQL by Cleaning Up Training Data
A new approach to training AI on database queries has cracked a stubborn problem: AI models have lagged behind humans at translating natural language into SQL (Structured Query Language) commands, the backbone of how businesses query databases. Researchers at Thinking Machines Lab achieved 92.96% accuracy on text-to-SQL tasks, matching human performance, by using reinforcement learning with verifiable rewards (RLVR) on carefully cleaned training data. The breakthrough cuts costs to $0.56 per task, roughly 12 to 15 times cheaper than frontier models like GPT-5.6 Sol Ultra and Claude Fable 5.
Why Has AI Struggled With SQL Translation?
SQL powers most enterprise databases, and while humans excel at writing custom queries, AI has consistently underperformed. Frontier models score in the mid-80s on the BIRD benchmark, a realistic test of translating business questions into SQL queries, but that still lags 11 points behind human professionals who score 92.96%. The challenge isn't a lack of training data; SQL appears widely across the internet. Instead, the real problem lies in navigating ambiguous questions and complex database schemas that contain millions of columns in real-world systems.
Most AI labs have tried to solve this by building scaffolding, a technique where a single model makes multiple calls to break the task into stages. A schema-linking stage narrows down candidate columns, a generation stage samples queries, a self-correction stage repairs errors, and a selection stage votes among survivors. Yet even the best scaffolded systems still fall short of human accuracy.
What Changed With the New Approach?
The Thinking Machines Lab team realized that humans acquire SQL skills through repeated experience, not by following a list of instructions. They applied the same logic to AI: instead of adding more prompts and stages, they fine-tuned a model using reinforcement learning on a foundation of clean, verified training data. The resulting model, ReViSQL-K2.6, exceeds human performance without any scaffolding when selecting from 16 samples.
The critical insight was that RLVR is extremely sensitive to mislabeled data. In reinforcement learning, the reward signal is the entire learning signal for each training step. When a label is wrong, it reverses the signal and degrades learning significantly. Algorithmic tweaks cannot compensate for this problem; the data itself must be clean.
How Bad Was the Data Problem?
The researchers audited 2,500 instances from BIRD Train, a widely used training dataset for text-to-SQL, and found errors in every component. Their analysis revealed that more than half of the "golden" SQL queries used to evaluate model answers were incorrect, and the natural language questions themselves contained flaws. The team created a multi-stage correction process involving both AI auditors and human experts.
The cleanup process worked like this:
- Initial Review: OpenAI's o3 model and a human expert reviewed each instance and flagged errors, with the LLM catching 90.6% of annotation mistakes but only identifying 24.5% of errors that humans found.
- Verification Stage: A different expert reviewed the flagged errors and proposed fixes, ensuring accuracy across the dataset.
- Conflict Resolution: When verifiers disagreed with initial auditors, samples were sent back for additional review loops to reach consensus.
- Evaluation Cleanup: The team discovered that the evaluation dataset, BIRD Mini-Dev, contained errors in 52.8% of instances, which they corrected and released as Arcwise-Plat-SQL.
The cleaned training set was released to the community as BIRD-Platinum, providing a resource for future research.
How to Apply RLVR Effectively to Domain-Specific Tasks?
The Thinking Machines Lab findings offer practical guidance for teams working with reinforcement learning on specialized problems:
- Prioritize Data Quality Over Scale: Invest in expert-verified training data before scaling up model training. Mislabeled instances poison the learning signal, and no amount of algorithmic tuning can fix corrupted data.
- Use Hybrid Auditing: Combine AI auditors with human experts to catch different types of errors. AI excels at precision but misses context; humans catch nuanced mistakes that algorithms overlook.
- Verify Evaluation Sets Separately: Benchmark datasets often contain the same types of errors as training data. Clean your evaluation set independently to ensure fair performance measurement.
- Reward Verifiable Tasks: RLVR works best when the correct answer can be objectively verified, like SQL query execution. Avoid tasks where ground truth is ambiguous or subjective.
What Do the Results Actually Show?
ReViSQL-K2.6, trained on BIRD-Platinum, achieved 88.55% accuracy on the expert-verified Arcwise-Plat-SQL benchmark, outperforming GPT-5.6 Sol Ultra at 86.75% and Claude Fable 5 at 84.94%. When using self-consistency selection with 16 samples, the model exceeded the 92.96% human baseline for the first time.
The cost advantage is substantial. ReViSQL-K2.6 costs $0.56 per task, compared to prohibitive costs for frontier models that are too expensive for high-volume applications. This makes the approach practical for enterprises that need to translate thousands of natural language questions into SQL queries daily.
What About Autonomous Exploration in AI Training?
A parallel development from Induction Labs demonstrates another angle on training AI systems without human-designed reward signals. On August 27, 2026, the lab published research on intrinsic discovery, an approach where reinforcement learning rewards models for finding novel states in an environment, then trains a world model on the collected rollouts.
Unlike task-specific RLVR, which relies on human-verified rewards like test passing or answer matching, intrinsic discovery lets the model autonomously explore and generate its own training experience. The lab's Terminal-35B-A3B model, trained on this approach, scored 84.1 on AgentWorldBench-Terminal-V2, edging GPT-5.6 Sol at 83.5.
The key difference is philosophical: in traditional RLVR, humans decide what is worth learning through task suites and curated datasets. In intrinsic discovery, the model chases novel terminal states, and the rollouts from exploration become the training data for a world model that predicts what the environment will return. Induction Labs reported that intrinsic discovery finds 5 times more diverse states than a fixed-policy baseline.
The research is currently limited to terminal sandbox environments, but the lab frames richer virtual environments and physical-world applications as future work. For builders evaluating agent training approaches today, intrinsic discovery represents a research-first pattern rather than a production-ready system.
Why Does This Matter for AI Development?
Both approaches, RLVR with verified rewards and intrinsic discovery, challenge the assumption that AI systems need massive amounts of internet-scale data or expensive human feedback to improve. Instead, they show that careful data curation, expert verification, and thoughtful reward design can unlock performance gains that rival or exceed frontier models at a fraction of the cost.
For enterprises relying on SQL queries, the immediate impact is clear: domain-specific fine-tuning with clean data can deliver human-level accuracy without the expense of frontier model APIs. For the broader AI research community, the lesson is that data quality and reward signal design matter as much as model scale. As AI systems move from general-purpose chat to specialized domain tasks, this approach may become the standard playbook for achieving reliable, cost-effective performance.