Introduction: The Intent Gap in Text-to-SQL
Current Text-to-SQL systems often fail because natural language is inherently ambiguous. While Large Language Models (LLMs) have made massive strides in translating natural language into SQL, they still struggle with the "intent gap." A user’s query is often underspecified or context-dependent—for instance, a "new employee" could mean someone hired this week, this month, or this year.
The authors identify two main hurdles in existing systems. First, Semantic Ambiguity occurs when words like "top" or "recent" map to dozens of different SQL filters depending on the database schema. Second, Inefficient Interaction results when systems ask redundant or "dumb" questions that do not effectively narrow down the user's intent, leading to frustration.
Proposed Framework: Probabilistic Reasoning and EIG
This paper introduces an interactive framework that treats SQL generation as a probabilistic reasoning process. Instead of outputting a single guess, the system maintains a distribution of possible SQL candidates and uses Expected Information Gain (EIG) to identify the single most informative question to ask a user.
Key Methodology
- Candidate Generation: The system uses an LLM (such as GPT-4) to generate a set of plausible SQL interpretations and their associated probabilities.
- Branching Tree Representation: Decision points where candidate queries differ (e.g., using
>vs>=) are mapped onto a tree structure to visualize the divergence in logic. - Optimal Clarification via EIG: This is the core innovation. The system calculates the EIG for every potential clarification question and selects the one expected to reduce the entropy (uncertainty) of the SQL distribution the most.
- Computational Efficiency: To enable real-time interaction, the authors proved that they only need to evaluate variables along the path of the most probable candidate, reducing complexity from $O(NM)$ to $O(N)$.
Experimental Evaluation
The framework was evaluated across three major benchmarks: Spider (including a specialized ambiguous subset), AmbiQT (designed to test Column, Table, Join, and Aggregate ambiguities), and Spider 2.0.
Key Results
- Spider Ambiguous Subset: The EIG-based method achieved 76.6% execution accuracy, outperforming the best non-EIG baseline (73.4%) and random selection (70.1%).
- AmbiQT Performance: The system dominated across all categories. Notably, in Join Ambiguity, it reached 86.88% exact match accuracy, while standard GPT-4 achieved only 27.43%.
- Interaction Efficiency: The system reached high accuracy levels with significantly fewer user interactions than heuristic-based baselines by acting like a professional "20 Questions" player—eliminating the most "wrong" possibilities at once.
Conclusion and Future Work
By framing Text-to-SQL as an information-theoretic problem, this research demonstrates that "smart" interaction can bridge the gap between vague user intent and precise database queries. Future work will focus on improving the natural phrasing of clarification questions and making the system more robust to "noisy" or incorrect user feedback.
Summary updated