Abstract
Handling ambiguity and underspecification is an important challenge in natural language interfaces, particularly for tasks like text-to-SQL semantic parsing. We propose a modular approach that resolves ambiguity using natural language interpretations before mapping these to logical forms (e.g., SQL queries). Although LLMs excel at parsing unambiguous utterances, they show strong biases for ambiguous ones, typically predicting only preferred interpretations. We constructively exploit this bias to generate an initial set of preferred disambiguations and then apply a specialized infilling model to identify and generate missing interpretations. To train the infilling model, we introduce an annotation method that uses SQL execution to validate different meanings. Our approach improves interpretation coverage and generalizes across datasets with different annotation styles, database structures, and ambiguity types.
Introduction
Natural language interfaces, particularly text-to-SQL systems, face a significant hurdle: ambiguity. A user's request can often be interpreted in multiple valid ways depending on the underlying database schema and linguistic nuances. Current Large Language Models (LLMs), while proficient at parsing unambiguous queries, exhibit a "preference bias," typically generating only the most statistically likely interpretation and ignoring others. This research introduces a modular framework designed to resolve such ambiguities by generating explicit natural language interpretations before mapping them to logical forms.
The Challenge of Ambiguity in Semantic Parsing
Ambiguity can be lexical (word-level) or structural (join-level). For instance, consider the question: "return the rating of each hotel." As shown in Figure 4, this could refer to the stars column, the guest_score column, or both.
Standard LLMs often fail to capture this breadth, leading to incomplete results. This research advocates for an "overton response" strategy, where the system identifies and presents all valid interpretations to the user, ensuring the system captures the full range of user intent.
Methodology: A Modular Pipeline
The proposed "disambiguate first, parse later" framework consists of three distinct stages:
- Default Interpretation Generation: The system leverages the inherent bias of an LLM to produce an initial set of preferred interpretations in natural language.
- Interpretation Infilling: To overcome the LLM's tendency to miss alternative meanings, a specialized infilling model (a fine-tuned Llama-3.1 8B) is employed. This model analyzes the original question alongside existing interpretations to identify and generate missing ones.
- Text-to-SQL Parsing: Finally, a high-performing parser (Qwen2.5-Coder 32B) converts each unique natural language interpretation into its corresponding SQL query.
To train the infilling model efficiently, the authors utilized an automated annotation method that validates interpretations by executing the resulting SQL and comparing outputs against reference queries to identify missed meanings.
Evaluation and Key Insights
The framework was evaluated on two benchmarks: AmbiQT (lexical and structural ambiguity) and Ambrosia (human-written questions with complex ambiguities).
Key Results
- Superior Coverage: On AmbiQT, the modular approach achieved 53.2% full interpretation coverage, a dramatic improvement over the 12.3% achieved by standard zero-shot prompting.
- Robust Generalization: The system demonstrated strong zero-shot performance. When trained on one type of ambiguity and tested on another (e.g., from AmbiQT to Ambrosia), it significantly outperformed end-to-end fine-tuned models.
- Execution-Based Validation: The study underscores the importance of using SQL execution results rather than just text similarity to distinguish between truly different interpretations and simple paraphrases.
Conclusion
By decoupling disambiguation from parsing, this research provides a robust method for handling the inherent uncertainty of natural language. Exploiting LLM bias as a starting point for a specialized infilling process allows for much higher recall of user intent, ultimately building more reliable and trustworthy natural language interfaces.
Summary updated