TL;DR
Current Text-to-SQL models achieve high accuracy on benchmarks by relying on human-expert hints (evidence), but their performance collapses by over 10% in real-world scenarios where this assistance is unavailable. To bridge this gap, the authors introduce DIVER, a training-free, multi-agent framework that interactively explores databases to automatically generate high-quality schema and value-linking evidence. By acting as an automated expert, DIVER restores robustness to downstream Text-to-SQL models, boosting execution accuracy by up to 10.82%.
What Problem Does This Paper Address?
Text-to-SQL systems serve as natural language interfaces to databases, allowing non-technical users to query data using plain English. While state-of-the-art (SOTA) models perform exceptionally well on modern benchmarks, this paper uncovers a hidden dependency: their success heavily relies on pre-packaged, expert-written "evidence." These hints clarify ambiguous user queries and map natural language terms to exact database components (e.g., explaining that "state special school" maps to the abbreviation SSS in a specific column).
In real-world applications, users cannot provide this expert-level insight, and automated agents cannot rely on human intervention. When this expert evidence is removed, SOTA models experience a severe performance collapse. The authors identify value linking—comprehending large-scale, dynamic, and sometimes "dirty" database values—as the primary bottleneck that scaling up large language models (LLMs) alone cannot fix.
Methods
The authors propose DIVER (Dynamic Interactive Value-linking and Evidence Reasoning), a training-free, model-agnostic system that mimics how a human expert explores a database. It operates via a multi-agent collaborative framework consisting of three primary components:
- Break up Assistant: Decomposes complex, multi-intent natural language queries into distinct, manageable sub-clauses. This prevents the system from losing focus during deep exploration.
- Look up Assistant: The core engine of DIVER. It operates within a structured workspace called the Chain of Thoughts and Facts (CoTF). Instead of relying on ungrounded internal reasoning, the agent uses a toolbox of 8 atomic database-probing tools (e.g.,
uniq_valuefor exact matches,sim_value_infor fuzzy semantic searches, andsim_columns). It executes an iterative Thought-Verify-Refine loop, ensuring every hypothesis is strictly validated against actual database facts. - Evidence Assistant: Synthesizes the verified facts from the CoTF into natural language evidence. Crucially, it uses style-aligned generation to tailor the output to the downstream model's preference—producing either a verbose, context-rich summary (DIVER-long) or a direct, punchy hint (DIVER-concise).
Datasets
DIVER was evaluated across four distinct Text-to-SQL benchmarks:
- BIRD: A large-scale, real-world benchmark featuring massive databases (averaging 549K rows), dirty values, and complex SQL function requirements.
- Spider: A widely used, cross-domain benchmark that is relatively simple with clean schemas and small-scale data.
- Spider-DK and DR.Spider: Robustness-focused diagnostic datasets derived from Spider that introduce complex perturbations, such as column renaming and value substitutions, to simulate real-world data messiness.
Key Insights and Ideas
- The Illusion of Benchmark Performance: The authors reveal that expert-written benchmark evidence often suffers from "answer leakage," containing significant token overlap with the final golden SQL query. DIVER exposes this unfair training-to-testing gap.
- An "Embodied AI" Approach to Databases: Rather than treating database interaction as a static retrieval problem, DIVER treats the database as an environment. By using atomic tools to "observe" and "probe," the agent creates a reliable perception-action loop that eliminates LLM hallucinations.
- Value Distillation over Injection: Simply dumping unique database values into an LLM prompt introduces noise and violates context length limits. DIVER’s strength lies in distilling interactive probe results into concise, noise-free evidence.
Key Results
DIVER was tested against both closed-source giants (GPT-4o) and open-source SOTA models (CodeS and XiYanSQL series, ranging from 1B to 15B parameters).
- Accuracy Boosts: On the challenging BIRD benchmark, DIVER improved GPT-4o's Execution Accuracy (EX) by 10.82% and its Valid Efficiency Score (VES) by 16.09%.
- Robustness under Perturbation: On the DR.Spider benchmark, DIVER significantly mitigated performance drops caused by database modifications. For instance, it achieved an 11.5% accuracy improvement for CodeS-7B on content-equivalence perturbations.
- Model-Style Alignment: Prompt-based models (like GPT-4o) benefited more from the context-rich DIVER-long evidence, while smaller, fine-tuned models (like CodeS-1B) performed better with the highly formatted DIVER-concise style.
Limitations and Future Work
Despite narrowing the gap, a performance delta still remains between DIVER-generated evidence and perfect, human-crafted golden evidence. Error analysis showed that DIVER's remaining failures are concentrated in databases requiring deep, domain-specific logic (e.g., financial formulas, specialized medical data, or toxicology rules). Because these rules cannot be deduced solely by probing raw database values, future iterations of DIVER will need to incorporate advanced domain-knowledge reasoning mechanisms.
Summary updated