NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

GBV-SQL: Guided Generation and SQL2Text Back-Translation Validation for Multi-Agent Text2SQL

Daojun Chen, Xi Wang, Shenyuan Ren, Qingzhi Ma, Pengpeng Zhao, An Liu

TL;DR

GBV-SQL is a new multi-agent framework that tackles the "semantic gap" in Text2SQL—where a model generates syntactically correct SQL that doesn't actually match what the user asked for. By using a specialized agent to "back-translate" SQL into natural language for validation and identifying a massive amount of "Gold Errors" (flaws in the benchmarks themselves), the researchers achieved state-of-the-art results, including a near-perfect 97.6% accuracy on a cleaned version of the Spider benchmark.

What Problem Does This Paper Address?

The goal of Text2SQL is simple: let non-technical users query databases using natural language. While Large Language Models (LLMs) have made huge strides here, they often suffer from a "semantic gap." An LLM might produce a query that runs perfectly but answers the wrong question—for example, performing an unnecessary group-by aggregation when the user just wanted a single record.

Current evaluation methods often miss these logic errors. Furthermore, the authors argue that the research community is hitting a ceiling not because of model limitations, but because the benchmarks we use (like Spider and BIRD) are riddled with incorrect ground-truth labels, which the authors call "Gold Errors."

Methods

The authors propose GBV-SQL, a framework orchestrated by four specialized agents:

  1. The Planner: Prunes the database schema to remove irrelevant tables and breaks the complex user question into simpler sub-questions.
  2. The SQLGenerator: Uses a "Human-like Chain-of-Thought" (CoT) to draft SQL for each sub-question and then merges them. It focuses on intent analysis and schema mapping before writing a single line of code.
  3. The SQL2TextValidator (The Core Innovation): This agent acts as a skeptical verifier. It takes the generated SQL and translates it back into a detailed natural language explanation. It then compares this explanation against the original user question. If they don't align, it triggers a correction loop.
  4. The SQLChecker: Performs final formatting and runs the query against a local SQLite engine. If it hits a null value or an error, it initiates an iterative repair cycle (up to 3 attempts) using database values as context.

Datasets

The framework was evaluated on two industry-standard benchmarks:

  • BIRD: A challenging benchmark requiring external knowledge and complex reasoning.
  • Spider: A widely used cross-domain Text2SQL dataset.
  • "Cleaned" Spider: A subset of Spider where the authors manually identified and corrected "Gold Errors" to reveal the model's true potential.

Key Insights and Ideas

  • Back-Translation as a Logic Check: Most Text2SQL systems are "one-way." By forcing the model to explain its code in plain English, GBV-SQL catches subtle logic mismatches that syntax checkers would ignore.
  • The "Gold Error" Typology: The authors didn't just complain about bad data; they categorized it into three types:
  • Type A (SQL-Side): The ground-truth SQL is just wrong or inefficient.
  • Type B (NLQ-Side): The user's question is ambiguous or unanswerable.
  • Type C (Database-Side): The database schema is broken or contains "dirty" data (like extra spaces in text fields).
  • Benchmarks are the Bottleneck: The discovery that over 30% of a sample from the BIRD dataset contained "Gold Errors" suggests that the field may be over-optimizing for flawed metrics.

Key Results

  • BIRD Benchmark: GBV-SQL achieved 63.23% execution accuracy, a 5.8% absolute improvement over previous state-of-the-art methods like MAC-SQL.
  • Spider Benchmark: On the standard version, it reached 82.8% accuracy. However, once the "Gold Errors" were removed, the accuracy skyrocketed to 96.5% (dev) and 97.6% (test).
  • Ablation Study: Removing the SQLChecker caused the biggest performance drop, proving that iterative repair and proper formatting are essential for high execution scores.

Limitations and Future Work

While GBV-SQL performs exceptionally well, the authors note a few areas for growth:

  • Enterprise Complexity: The current framework hasn't been fully adapted for "Spider 2.0" scenarios, which involve massive, real-world enterprise workflows and multi-tool usage.
  • Computational Overhead: Using four separate agents and multiple loops (back-translation and repair) increases token usage and latency compared to single-shot generation.
  • Dataset Curation: The authors call for the community to move away from treating benchmarks as "static, infallible standards" and instead treat them as dynamic entities that require constant versioning and cleaning.

Summary updated

BibTeX
@inproceedings{chen2026gbv,
  author = {Daojun Chen and Xi Wang and Shenyuan Ren and Qingzhi Ma and Pengpeng Zhao and An Liu},
  title = {{GBV-SQL: Guided Generation and SQL2Text Back-Translation Validation for Multi-Agent Text2SQL}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.837},
}
Figure