Disambiguate First, Parse Later: Generating Interpretations for Ambiguity Resolution in Semantic Parsing
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 approach1 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 utterances are often ambiguous, vague, or underspecified, giving rise to multiple valid interpretations. Figure 1 shows an ambiguous request (“return the rating of each hotel”) in the context of natural language interfaces. In the example, “rating” could refer to the number of stars hotels receive as an indication of their quality (e.g., 4 stars) or guest reviews on booking websites (e.g., 8.5 out of 10), or both. Ignoring such ambiguity can lead to incomplete or incorrect results, undermining user trust and limiting the practical usefulness of any conversational system. While state-of-the-art large language models (LLMs) demonstrate remarkable performance on tasks like question answering, text-to-SQL parsing, and natural language inference, recent studies (Liu et al., 2023; Floratou et al., 2024) have shown they are not adept at handling ambiguity. They display systematic biases in their choice of interpretation (Kamath et al., 2024; Stengel-Eskin et al., 2024; Saparina and Lapata, 2024a), typically defaulting to a single interpretation when multiple ones exist. What are the response strategies LLMs should adopt to address ambiguity? An approach might be to respond with a clarification question, which directly engages users and ensures accurate resolution of the ambiguity but introduces additional interaction turns. Alternatively, presenting multiple possible interpretations (an “overton response”) would allow users to select the most relevant answer themselves. This approach minimizes interruptions, caters to users with different levels of expertise, and provides interpretability by making the system’s reasoning explicit. For tasks like semantic parsing (see Figure 1), a hypothetical response should not only include interpretations in their final form (e.g., SQL queries) but also their different readings in natural language. From a modeling perspective, interpretations serve as explanations (of the system’s output) and as intermediate representations, providing a way to decompose complex semantic parsing problems into simpler steps. In this work, we focus on text-to-SQL parsing of ambiguous questions, and propose a two-stage approach that first disambiguates by generating all possible meanings in natural language, and then parses each unambiguous interpretation. Separating the disambiguation and parsing tasks allows us to use existing semantic parsers that perform generally well on unambiguous inputs. We obtain interpretations, by prompting an LLM to generate all possible meanings for an utterance. These initial interpretations are often incomplete due to inherent biases stemming from statistical patterns found in LLM training data, lack of intrinsic knowledge, and different alignment preferences. Rather than attempting to correct these biases, we introduce an infilling model that reviews the ambiguous question and initial interpretations, and then generates any missing ones. The infilling model is trained on pairs of default interpretations and missing readings. Problematically, existing datasets provide (multiple) SQL parses for ambiguous questions without explicitly verbalising the interpretations they correspond to. We create synthetic reference interpretations for AmbiQT (Bhaskar et al., 2023), a recently proposed benchmark for parsing ambiguous questions into SQL. We exploit the fact that generated interpretations can be converted to SQL queries which we execute to verify whether they are correct and to establish which interpretations are missing, i.e., whether there exist gold SQL parses for which no interpretation was found. We evaluate our approach on Ambrosia (Saparina and Lapata, 2024a), a dataset different from AmbiQT in terms of database content and the types of ambiguity it represents. Our contributions are summarized as follows:
• We propose a modular approach that uses natural language to spell out ambiguity before mapping individual interpretations to logical forms (e.g., SQL queries).
• We use LLMs to generate an initial set of preferred disambiguations and then apply a specialized infilling model to identify and generate missing interpretations.
• Experiments show that our “disambiguate first parse later” strategy improves the coverage of interpretations for ambiguous questions and generalizes across annotation styles, database structures, and ambiguity types.
Related work. Ambiguity Resolution in NLP Numerous studies have focused on ambiguity in natural language tasks using strategies like generating multiple answers (Min et al., 2020), asking clarification questions (Lee et al., 2023; Zhang et al., 2024), and estimating uncertainty (Cole et al., 2023). Similar to our work, Sun et al. (2023) use iterative prompting to refine and generate alternative interpretations in the context of question answering, while Kim et al. (2024) first detect ambiguous questions and then resolve them through clarification requests.
Ambiguity in Semantic Parsing Ambiguity has been studied across semantic parsing tasks, from code generation (Li et al., 2023; Mu et al., 2024) to λ-calculus translation (Rasmussen and Schuler, 2020), and logical form prediction (Stengel-Eskin et al., 2024). In the domain of text-to-SQL parsing, recent work has emphasized the fact that benchmarks often overlook ambiguity by providing single interpretations (Floratou et al., 2024; Pourreza and Rafiei, 2023). Existing approaches focus on detecting column ambiguity through counterfactual examples (Wang et al., 2023), special-purpose decoding (Bhaskar et al., 2023), and resolving ambiguity through clarification questions (Dong et al., 2024). Our work uses explicit disambiguation before parsing and thus extends to different types of ambiguities, question styles, and database formats.
Intermediate Representations in Text-to-SQL Intermediate representations are commonly used to bridge the gap between natural language and database queries. Several approaches decompose complex questions into a sequence of simpler operations expressed in natural language (Wolfson et al., 2022; Saparina and Osokin, 2021), modular execution plans (Eyal et al., 2023), or simplify the parsing task by augmenting questions with SQL keywords that mention necessary computation steps (Liu and Tan, 2024; Caferoglu and Ulusoy, 2024). Building on this work, we also use intermediate representations to make implicit information explicit but focus on resolving ambiguity.
Learning to Correct LLM Outputs More recently, various approaches have been proposed to correct systematic biases in LLM outputs. For example, Ji et al. (2024) propose a model-agnostic module that learns correctional residuals between preferred and dispreferred outputs. Welleck et al. (2023) use a corrector model to iteratively review imperfect generations from a base model. Similarly, critique generators can be developed using reinforcement learning (Wadhwa et al., 2024a) or through fine-grained feedback (Wadhwa et al., 2024b). Such correction approaches are most effective when guided by external tools (Kamoi et al., 2024).
Method. Semantic parsing is the task of mapping a natural language utterance u to formal expression e in grammar G, where e captures the intended meaning of u. The expression e can be then executed in an environment E to produce a denotation JeK. In the unambiguous case, there is a single valid expression e that corresponds to the user’s intent. However, when u is ambiguous, there are multiple valid expressions {e1, ..., en} where JeiK ̸= JejK for some i, j, with each ei representing a valid interpretation of the user’s intent. In our text-to-SQL task, grammar G defines valid SQL queries for a given database schema S. The database schema and table descriptions provide context C that can help disambiguate some queries. We focus on questions that remain ambiguous even when C is known, i.e., there exist multiple valid SQL queries {e1, ..., en} that respect S and produce different result sets JeiK when executed on the database. In the example in Figure 1, the question u = “return the rating of each hotel” remains ambiguous for a given schema S (see top table), as “rating” could refer to star ratings and guest reviews even when the database content is known.
We propose to resolve ambiguity prior to generating SQL expressions with natural language interpretations. More formally, for ambiguous utterance u, we first produce a set of unambiguous natural language interpretations {ˆu1, ..., ˆun}, where each ˆui captures one meaning of u. We then map each ˆui to formal expression ei. For example, given u = “return the rating of each hotel”, our goal is to produce ˆu1 = “How many stars were assigned to each hotel?”, ˆu2 = “How did the customers review each hotel?” and ˆu3 = “Show me the guest scores and star rating of each hotel” and map them to corresponding SQL queries e1, e2 and e3 (see Figure 1). This approach has several advantages:
• Unambiguous interpretations ˆui are easier to translate into formal expressions, as they can be handled by standard semantic parsers (e.g., existing text-to-SQL models); • Natural language interpretations provide transparency, making the system’s internal working explicit to users; • The modular design allows us to optimize the disambiguation and formal expression mapping components independently.
Building on this modular approach, we propose to further decompose explicit disambiguation into two steps: initial interpretation generation followed by infilling of missing interpretations. Our core idea is based on the observation that modern LLMs, like humans, resolve ambiguous questions by gravitating toward preferred, default interpretations (Kamath et al., 2024; Stengel-Eskin et al., 2024; Saparina and Lapata, 2024b). We leverage this tendency by using LLMs to generate preferred interpretations. We then train a specialized model that, given an ambiguous question and its default interpretations, identifies and generates missing readings to ensure all valid meanings are covered. Figure 2 illustrates our approach: generating default interpretations (using LLMs), infilling missing ones, and text-to-SQL parsing.
LLMs exhibit strong biases in interpretation generation, consistently favouring certain types while missing others. We take advantage of these biases by using LLMs to generate an initial set of interpretations for ambiguous utterances. The first component of our approach is a prompt-based interpretation generator that produces candidate interpretations given utterance u and database context C. We prompt an LLM to identify and list all semantically different interpretations of u. In practice, LLMs generate only a subset of possible interpretations, typically the most straightforward ones. We refer to them as preferred or default interpretations. The prompt is designed to handle both ambiguous and unambiguous cases, allowing the model to return a single interpretation when appropriate. As we rely on the LLM’s ability to disambiguate to its default interpretations, no additional training is required. The output of this module is a set of natural language interpretations {ˆu1, ..., ˆuk}, which are mapped to formal expressions {e1, ..., ek} using a standard semantic parser.
Discussion. It is better to disambiguate first and parse later both in in-domain and out-of-domain settings. Table 1 presents our main experimental results on AmbiQT and Ambrosia. We compare our approach with both prompt-based and fine-tuning baselines. Note that for methods requiring fine-tuning, AmbiQT represents in-domain evaluation, whereas evaluation on Ambrosia is out of domain. All methods use the same model, instruction-tuned Llama- 3.1 8B, and those that require training are finetuned using a LoRA adapter on the same AmbiQT subset, augmented with interpretations. Table 1 is split into two sections. The first one presents end-to-end approaches, which attempt to directly predict multiple SQL queries for ambiguous questions. We report results for zero-shot prompting, few-shot prompting, and end-to-end fine-tuning (SFT). For prompting, we follow Saparina and Lapata (2024a) and explicitly instruct the model to generate multiple SQL queries if the question is ambiguous. For few-shot prompting, we on both datasets. While it does not achieve the highest full coverage on AmbiQA, it substantially improves over end-to-end prompting reaching 53%, while delivering the best single interpretation coverage of 92%. It effectively generalises to new domains and ambiguity types, showing the best results on Ambrosia among all methods across three out of four evaluation metrics. However, the full coverage on Ambrosia is still relatively low (at 19%). Ambrosia is a challenging benchmark on its own but it is also possible that some interpretations are missed due to annotation differences between the two datasets. The results in Table 1 show that recall closely mirrors full coverage, offering little additional insight. Precision, on the other hand, can be misleadingly inflated when systems rarely predict all valid interpretations at once. For this reason, in subsequent experiments, we only report full and single interpretation coverage as the most informative metrics. See Appendix G for additional results.
Infilling boosts performance across interpretation generation models. We next analyze key components of our approach through ablation studies. Table 2 focuses on the first stage of our method, namely disambiguation. We compare default interpretations from three different instruction-tuned models of similar size: Qwen-2.5 7B (Yang et al., 2024), Llama-3.1 8B, and Gemma-2 9B (Riviere et al., 2024). We observe that Llama-3.1 8B provides the best default interpretations and our infilling model improves upon all interpretations, irrespective of the generation model.
Text-to-SQL parsing is hard even with gold interpretations! To provide an upper bound for our approach, we use gold interpretations from Ambrosia and evaluate how well the text-to-SQL parser performs when all interpretations are correct. The results are, as expected, significantly higher, indicating room for improvement in interpretation generation. However, since the full coverage reaches only 49%, a substantial number of errors may come from the unambiguous text-to-SQL parsing alone. Table 3 compares our text-to-SQL model, the instruction-tuned Qwen-2.5 Coder 32B, with its smaller 7B variant. Results decrease substantially when the weaker text-to-SQL model is used. As our approach is modular, we anticipate our results would improve with a better text-to-SQL parser.
Generalisation to new ambiguity types remains an open challenge. To better understand our system’s limitations, we performed a manual error analysis on 50 randomly sampled examples with errors (30 from AmbiQT and 20 from Ambrosia). Table 4 summarizes the distribution of these errors. Redundant interpretations refer to near-paraphrases that differ slightly in structure.
Conclusion. In this work, we present a novel approach for handling ambiguity in text-to-SQL semantic parsing. We first disambiguate questions by explicitly verbalising their interpretations and then leverage LLM capabilities to predict all valid SQL queries. A generator (LLM) provides an initial set of default interpretations, which are then augmented with a specialized infilling model. We propose a method for training this model based on automatic annotations obtained by comparing SQL query execution results rather than natural language interpretations. Our experimental results on AmbiQT and Ambrosia demonstrate the effectiveness of our approach. Our method achieves the highest single interpretation coverage on both datasets and maintains consistent full interpretation coverage in both in-domain and out-of-domain evaluation. However, generating all valid interpretations remains challenging. Future work could explore ways to improve ambiguity handling through better processing of database structure or using query execution as a signal for both training and test-time search.
Limitations. Our approach relies on reference interpretations and SQL queries for training the infilling model. While we show how to generate synthetic interpretations, scaling to new domains might be challenging. The sequential pipeline can propagate errors, with mistakes in disambiguation affecting text-to- SQL parsing and parser errors leading to incorrect SQL predictions. Duplicates in generated interpretations can help capture valid meanings through different wording but at the cost of longer output. The generator can produce incorrect interpretations that are currently not filtered. The infilling model can also miss valid interpretations that are underrepresented in the training data. Additionally, generating and parsing multiple interpretations requires more computation than single-stage approaches. Although our approach handles both ambiguous and unambiguous questions, it occasionally provides multiple interpretations for unambiguous requests. Future work should focus on improving precision through better filtering and interpretation validation.
Lines of inquiry this paper opens 24
Research framings built by reading the notes related to this paper — the questions it feeds into.
Why do language models systematically fail at ambiguity recognition?- How do users respond when given multiple query interpretations versus clarifying questions?
- What specific parsing errors dominate when input interpretations are correct?
- How do schema complexity and query structure affect parsing under gold interpretations?
- Why do NLP benchmarks systematically exclude ambiguous test cases from evaluation?
- Why do NLP benchmarks exclude ambiguous instances from evaluation?
- Is interpretive multiplicity a bug in language or a feature?
- Can LLMs infer situational context the way humans do pragmatically?
- Why do LLMs achieve only 24 percent accuracy on implicit discourse relations?
- How do readers selectively hold frame-related words in mind?
- What makes ambiguity recognition fundamentally important for poetry analysis?
- What measurement artifacts emerge when annotators interpret the same question differently?
- What other semantic relations benefit from explicit surface markers in text?
- How do politeness strategies depend on semantic ambiguity between literal and intended meaning?
- What percentage of natural language relies on plausible deniability through ambiguous phrasing?
- How does semantic ambiguity differ from structural ambiguity in language?