ACTS-SQL: Agentic and Critic-Oriented Tree-Structured SQL Correctness with Large Language Models
Organizations: Renmin University of China · ByteDance Inc.
Abstract
Large Language Models (LLMs) have been increasingly adopted in Text-to-SQL systems, yet SQL errors remain a major obstacle in real-world Text-to-SQL inference pipelines. Existing SQL correction approaches either rely on large-scale, high-quality training data with substantial overhead, or adopt single-path agentic workflows that are brittle to early mistakes and prone to error propagation. To develop a practical SQL correctness system for industrial scenarios, we present a training-free framework that formulates SQL correction as a plan-guided, tree-structured debugging process. By maintaining multiple correction strategies and enabling backtracking, the framework mitigates error accumulation during iterative refinement. We further integrate execution-based verification and clause-level diagnostic tools to support strategy pruning and precise error localization. We evaluate the system on the BIRD-Critic benchmark and observe consistent accuracy gains over strong LLM backbones and representative agent-based baselines, achieving a 9.42% improvement over the previous state-of-the-art method. The framework is also deployed in the Torch Log Service (TLS) of Volcano Engine to support an online Text-to-TLS API. In production, it improves execution accuracy from 36.77% to 53.61% on real user queries with a representative strong LLM backbone (GPT-5). These results demonstrate the effectiveness and stability of our approach in real-world deployments.
Figures & tables
| Methods | Bird-critic Open | Bird-critic PG | ||||
|---|---|---|---|---|---|---|
| PostgreSQL | MySQL | SQLServer | Oracle | |||
| Raw model | Deepseek-R1 ( Guo et al., 2025a ) | 36.96% | 38.78% | 32.65% | 19.39% | 39.62% |
| GPT-o3 ( OpenAI, 2025 ) | 41.30% | 26.53% | 32.65% | 18.37% | 38.87% | |
| GPT-5 ( , 2025 ) | 39.13% | 28.57% | 29.59% | 23.71% | 35.85% | |
| grok-4 ( , 2025 ) | 39.49% | 35.71% | 33.67% | 15.31% | 39.06% | |
| Agents | SQLFixAgent ( Cen et al., 2025 ) | 21.38% | 22.79% | 33.12% | 17.68% | 40.56% |
| Variants | Bird-critic Open | Bird-critic PG | ||||
|---|---|---|---|---|---|---|
| PostgreSQL | MySQL | SQLServer | Oracle | |||
| Full Method | ACTS-SQL (Full) | 58.70% | 64.29% | 53.06% | 33.67% | 45.85% |
| Plan Structure | w/ Linear Plan | 45.81% | 36.93% | 38.88% | 20.47% | 36.56% |
| Tools | w/o Execution Tool | 39.84% | 32.66% | 29.85% | 21.48% | 37.92% |
| w/o Ambiguity Detection | 43.89% | 27.37% | 31.28% | 25.67% | 38.45% | |
| Base Model | Critic Strategy | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| No Critic | LLM Critic | DAC ( Wang et al., 2024a ) | MapleRepair ( Shen et al., 2025 ) | ACTS-SQL | ||||||
| Acc. | Lat. | Acc. | Lat. | Acc. | Lat. | Acc. | Lat. | Acc. | Lat. | |
| GPT-5 ( , 2025 ) | 36.77% | 6.31 | 47.42% | 26.52 | 37.74% | 72.51 | 46.83% | 15.51 | 53.61% | 218.91 |
| GPT-o3 ( OpenAI, 2025 ) | 40.55% | 18.17 | 51.89% | 35.40 | 40.55% | 139.25 | 50.41% | 17.49 | 56.36% | 277.41 |
| DeepSeek-R1 ( Guo et al., 2025a ) | 22.68% | 6.04 | 22.96% | 13.24 | 22.68% | 96.04 | 22.68% | 14.55 | 23.85% | 38.65 |
| Xiyan ( Liu et al., 2026 ) | 13.40% | 7.01 | 13.40% | 15.67 | 13.40% | 76.54 | 13.40% | 18.90 | 13.75% | 42.56 |
Text-to-SQL
Text-to-SQL translates natural-language questions into executable database queries, linking user intent to schemas, values, and SQL logic.
See all 173 papers