Semantic-aware Decoding for Diverse Text-to-SQL under Schema Ambiguity
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
Semantic-aware Decoding for Diverse Text-to-SQL under Schema Ambiguity Yuxuan Jiang1, 2 , Anna Mitsopoulou1 , Apostolos Koukouvinis1 , Yannis Velegrakis2 , Georgia Koutrika1∗ 1
arXiv:2611.30873v1 [cs.CL] 23 Nov 2026
ATHENA Research Center, Greece 2 Utrecht University, Netherlands yjiangei@athenarc.gr, georgia@athenarc.gr
Abstract Real-world text-to-SQL systems often face schema ambiguity, where a question can map to multiple plausible schema elements. To support downstream disambiguation, SQL generation systems should include diverse interpretations among their top-k predictions. However, large language models (LLMs) typically favor a single interpretation, producing highly skewed outputs. We propose Semantic-aware Logit Adjustment (SLA), a training-free decoding method that promotes diverse SQL generation by adjusting token logits based on semantic similarity between schema elements. Unlike prior approaches that rely on reasoning-intensive prompting or taskspecific fine-tuning, SLA is efficient, model-agnostic, and easy to deploy. Experiments show that SLA consistently improves interpretation coverage over standard decoding and remains competitive with existing diversity-oriented methods at substantially lower inference cost.
1
Introduction
Large language models have shown remarkable performance in many tasks. Among them, text-to-SQL plays an important role in transforming user natural language questions into executable SQL queries. Over recent years, many works have made significant progress on benchmarks such as SPIDER(Yu et al. 2018) and BIRD(Li et al. 2023), indicating the potential of LLMs as an assistant for SQL writing. In practice, however, the questions people actually ask are rarely so well posed. A user question can be ambiguous, and several different but equally valid SQL queries could answer it(Floratou et al. 2024), whereas most existing benchmarks sidestep this by assuming that each question is clear and corresponds to a single ground truth. The source of ambiguity can roughly be classified into three types: database schema, database value and natural language. Among them, schema ambiguity (Bhaskar et al. 2023; Wang et al. 2023; Floratou et al. 2024) refers to the scenario where an entity in the user question can refer to different database schema elements (tables or columns). It is a major source of failure in real-world applications(Wang et al. 2023), because the database can contain similar concepts, users are unfamiliar with the database, and natural language expressions often omit crucial expressions. For example in Fig. 1, it is unclear whether the user wants the name or the ISBN of the ∗
Corresponding author.
books, and whether the books should be filtered by German writers or by German publishers. Since the system cannot resolve the ambiguity in such a question on the user’s behalf, the practical requirement is that every plausible reading survives: all valid interpretations should appear among the top-k predictions, so that they can be presented to the user or passed to a disambiguation module. We refer to this property as interpretation coverage. The most natural way to obtain such a set is diverse decoding, such as beam search and random sampling, which is efficient and requires no additional training. Previous work has shown, however, that these methods are ineffective at generating semantically different SQL queries, mainly due to highly skewed logit distributions(Bhaskar et al. 2023): at the very step where the interpretations diverge, a single token dominates the distribution and the alternative is buried far below. Existing works resort to alternative paradigms, like reasoning-intensive prompting(Ding, Lin, and Zeng 2025; Zhang et al. 2025) or task-specific fine-tuning(Saparina and Lapata 2025a,b). While effective, they have two main limitations: (1) they introduce high computational cost due to test-time scaling or the training procedure; (2) they have weak applicability to a broader range of base models, as they assume reasoning-capable or task-adapted LLMs. We therefore ask whether the skewed distribution can instead be repaired during decoding, which would retain the efficiency, the training-free nature and the broad applicability that made diverse decoding attractive in the first place: can we facilitate interpretation coverage by improving the decoding itself? Our answer starts from a simple observation: schema ambiguity typically arises among schema elements that describe closely related concepts, such as the author and the publisher, which both contribute to the release of a book. Such conceptual relatedness can be quantified by semantic similarity between schema element embeddings. As shown in Fig. 2, schema elements that induce ambiguity show higher semantic similarities than random schema pairs on average. Therefore, semantic similarity provides an effective prior for identifying alternative schema interpretations. We exploit it directly at decoding time: whenever the model is about to write a schema element, we raise the scores of the elements that are semantically closest to the one it currently favors, so that plausible alternatives rise out of the tail of the distribution and survive in the output set.
Figure 1: An illustration example of our framework. Given a user question over a database, we first precompute the prefix tree and pairwise semantic similarities of all schema elements, and then adjust the output distribution based on the pointer and similarity. As a result, our method facilitates the model to explore more potential schema interpretations.
Figure 2: Similarity distribution. We randomly sample 80 examples from AmbiQT and Ambrosia, and compute the cosine similarity of embeddings between random schema element pairs and schema element pairs that induce ambiguity. We evaluate our method on two benchmarks that contain schema ambiguity, across base models of different families and sizes. Our method significantly improves the interpretation coverage over conventional decoding methods and achieves performance comparable to methods that rely on fine-tuning or test-time scaling, while adding only about 10% latency over vanilla beam search.
2
Related work
Existing work handles ambiguous questions by generating a set of SQL queries, which are either presented to users directly(Vaidya et al. 2025; Saparina and Lapata 2025a) or used for downstream disambiguation(Chan, Sevastjanova, and ElAssady 2026; Qiu et al. 2025; Zhang et al. 2025). Both
settings rely on interpretation coverage. For general ambiguity, DFPL(Saparina and Lapata 2025a) prompts LLMs to produce multiple natural language interpretations, augments them with a fine-tuned model and maps each to a SQL query, IntentRL(Saparina and Lapata 2025b) formulates interpretation generation as a reinforcement learning problem to explicitly encourage diversity, and CLEAR(Zhang et al. 2025) exploits the reasoning ability of models with few-shot examples to map entities in the question to schema elements; none of them focuses on schema ambiguity specifically. Targeting schema ambiguity specifically, LogicalBeam(Bhaskar et al. 2023) trains two models to first generate SQL templates and then fill them with schema elements, and ODIN(Vaidya et al. 2025) masks the schema elements used in previous predictions to enforce the exploration of alternatives. All of these methods intervene on the input or on the model weights and leave the decoding algorithm itself unchanged, paying for diversity with extra prompts, extra generation passes or extra training. In contrast, we directly adjust the token distribution during decoding, which yields diverse SQL queries within a single parallel decoding pass.
3
Problem definition
Schema ambiguity We first provide a definition of schema ambiguity in the context of text-to-SQL. Following previous work(Floratou et al. 2024), a question is ambiguous if multiple non-equivalent and acceptable SQL queries can answer it. When the natural language itself is clear, schema ambiguity occurs when there is more than one way to map the question to database schema.
Problem formulation Given a database schema D, consisting of N schema elements C = [c1 , c2 , ..., cN ], and a user question Q with schema ambiguity, there exist multiple non-equivalent but valid queries {yi } that answer it. Our aim is to utilize a text-to-SQL model Pθ (usually an LLM) to generate a set of outputs {ŷi }, formally ŷi ∼ Pθ (y|Q, D) such that the prediction set captures all possible interpretations, i.e., {yi } ⊆ {ŷi }.
4 4.1
Method
Method overview
Consider a database with tables book, author and publisher, and the question "Show German books" (Fig. 1). Two interpretations are valid: books written by German authors, and books released by German publishers. The model has to choose between them at one decoding step, the step that generates the table name after JOIN. At that step, the logit distribution is highly skewed: one token dominates the probability distribution, while the other one is ranked much below. The second interpretation is lost because this skewed distribution hides it, so beam search or sampling will never reach this interpretation. Our key observation is that alternative interpretations of an ambiguous query come from schema elements that describe closely related concepts. Author and publisher both relate to the production of a book; name and ISBN both identify a book. We quantify this by embedding each schema element with an embedding model and calculating their pairwise cosine similarities. Schema elements that cause ambiguity have high similarity, while unrelated pairs usually have low similarity (Fig. 2). Although semantic similarity alone does not imply ambiguity, ambiguous schema elements almost always exhibit substantial semantic overlap. This leads to our method. Whenever the model is generating a schema element, we add to the logit of each candidate token a boost that depends on the schema similarities. For example, after generating book, the top-1 prediction for the next token is .name. We boost .IS because it leads to book.ISBN, which is semantically similar to book.name, while unrelated tokens receive little or no boost. In the following sections, we first describe how we decide whether to modify the logits at the current step (Section 4.2), and then present our algorithm for computing the boost (Section 4.3).
4.2
SQL generation tracking
We first need to decide two things: when to modify the logits, and for which tokens. A SQL query consists of keywords, database values and schema elements. We intervene only while a schema element is being generated and only on tokens that are valid continuations of the schema element generated so far. Two problems make this non-trivial. First, the model generates tokens one by one, and nothing in the token itself tells us whether it belongs to a schema element. Second, a schema element often consists of several tokens, for example ISBN may be split into IS and BN, so that for a prefix token we do not know which schema element the model is
generating. What we need is therefore a mechanism that, at every step, tells us whether the model is inside a schema element and, if so, which tokens may follow. To achieve that we create a prefix tree(Sharma et al. 2025) with all the schema elements. More specifically, in an offline stage, we tokenize all schema elements, i.e., table.column for the columns, and insert them into a token-level prefix tree, in which every path from the root to a leaf corresponds to a schema element. Then, during decoding, maintain a pointer over the tree, which records the schema element generation point at each decoding step. The pointer has two possible states: (1) None, when the model is not generating any schema element or the model starts to generate a new clause (2) prefix tree node, while a schema element is being generated. In each step we update the pointer as follows: if the pointer is None, we check if the next top-1 token matches a child of the root node of a prefix tree and we set the pointer to root if this is the case. If the pointer is at root or at an inner node of the prefix tree, we advance the pointer to the child matching the last generated token. When the pointer has reached a leaf node, we set the pointer to None, if the next-token is not a child of the root, otherwise it is set to root. In the example, the pointer is None while the model generates SELECT, so the logits are unchanged. When the model generates book, the pointer advances to the internal node reached by root-book, indicating that the model is inside a schema element. Only the node’s children, such as .name and .IS, are valid continuations; .title is treated as hallucinated and suppressed by logit adjustment. Once the element is complete, the pointer reaches a leaf, returns to None, and decoding continues normally. Logits are adjusted only when the pointer is at the root node or at an inner node state and the tokens to be adjusted become only the children of the pointed node. Finally, we enable the mechanism only where schema alternatives are meaningful: table names in SELECT, FROM, and JOIN, and column names in SELECT, WHERE, GROUP BY, HAVING, and ORDER BY. We exclude columns inside COUNT to avoid unnecessary randomness, and the ON clause because its columns are fixed by primary–foreign key relationships; alternatives would invalidate the join condition. Fig. 3 illustrates these positions.
Figure 3: Example SQL query template. The ORDER BY clause can be replaced by other clauses such as WHERE, GROUP BY. Positions where the logits are modified are highlighted in green.
4.3
Semantic-aware logit adjustment (SLA)
We proceed in four steps, pointing to the lines of Algorithm 1. Step 1: Similarity between schema elements. Each schema element is represented by a short text, the table name for a table and table.column for a column. We
Algorithm 1: SLA at one decoding step
element in Cq , and average over these pairs:
1: Precomputed once per database: prefix tree T , simi-
larity matrix S 2: Input: tokens generated so far o, logits z, pointer P , strength α 3: Output: adjusted logits z 4: P ← UpdatePointer(P , o, z, T ) ▷ how far we are into a schema element 5: if not InTargetClause(o) or P is None or P is a leaf then 6: return z ▷ keyword, value, finished element, or skipped clause 7: end if 8: A ← Children(P ) ▷ allowed next tokens 9: z[d] ← −∞ for all d ∈ /A 10: q ← arg maxd∈A z[d] ▷ the model’s own preference 11: Cq ← Elements(q) ▷ schema elements below node q 12: λ ← α(zq − zq′ ) ▷ keeps arg max unchanged 13: for d ∈ A, d ̸= q do 14: Cd ← Elements(d) 15: z[d] ← z[d] + λ · sim(Cq , Cd ) 16: end for 17: return z
encode it with an off-the-shelf sentence embedding model, and store all pairwise cosine similarities in S ∈ RN ×N . This happens once per database, before decoding (line 1). Raw cosine values are not comparable across embedding models: one may place most schema pairs in [0.6, 0.9], another in [0.0, 0.4]. Since our boost is proportional to them, a fixed hyper-parameter would act differently for each model. Only the relative order of the pairs matters to us, so we apply histogram equalization and replace each similarity by the fraction of pairs scoring below it. This spreads the values of any model uniformly over [0, 1], so one setting of the strength parameter transfers across models. Step 2: From element similarity to token similarity. S relates elements, but decoding boosts tokens, and a token is usually only a prefix: .IS is not an element but the start of book.ISBN, and the node reached by author starts author.name, author.country and author.id. The prefix tree links the two. Every candidate token d is a child of the pointer, and the leaves of its subtree are exactly the elements still reachable through d; we write Cd for that set and Cq for the set below the node q the model currently prefers (lines 11 and 14). Node similarity is therefore a similarity between two sets of elements. A plain average over all pairs in Cq × Cd does not work. Even when two nodes stand for related concepts, only a few pairs of elements really match. All the other pairs are unrelated, and they drag the average down. The more elements the two nodes cover, the more such pairs there are, so a table with many columns would look dissimilar to everything, simply because it has many columns. What we really ask is whether every element reachable through d has a close match under q. We therefore pair each element of Cd with its most similar
sim(Cq , Cd ) =
1 X max S[i, j] i∈Cq |Cd |
(1)
j∈Cd
The same match-then-average pattern appears in BERTScore (Zhang et al. 2019) and in the late interaction of ColBERT (Khattab and Zaharia 2020). We compare both choices in our ablation study. Step 3: Where the boost is added. The model produces logits z ∈ RV with p = softmax(z). Editing p is tempting, but the softmax hides what we need: in a skewed distribution every token below the top has probability close to zero, and a plausible alternative becomes indistinguishable from an impossible one, although their logits still differ clearly. We therefore adjust the logits, z ′ = z + b. In general b depends on the whole distribution, b(S, z); we simplify it to b(S, q) by scoring every candidate against the token q the model itself ranks first (line 10). This is safe because the element ranked first is almost always in one of the valid queries or close to one, and it reduces the cost from |A|2 to |A| similarities, where A is the set of allowed tokens. We also never operate over the full vocabulary of the model: the children of the pointer are the only possible continuations, so A is exactly that set of children and everything outside it is masked to −∞ (lines 8–9). Step 4: How strong the boost is. For a candidate d we set bq (d) = λ · sim(Cq , Cd ) (line 15), where λ scales the similarity, which lies in [0, 1], up to the scale of the logits. λ should grow when the model is overconfident, since that is when the alternative is hidden, but deriving it from the entropy is unstable: a large λ may overturn the top-1 and change the query the model was about to write. Instead, we impose arg max(z ′ ) = arg max(z), so that SLA re-ranks alternatives but never overrules the first choice. Writing q for the allowed token with the largest logit and q ′ for the runnerup, we set λ = α (zq − zq′ ) with 0 < α < 1, a fraction of the gap between the two (line 12). As sim ≤ 1, the largest possible boost is α times that gap, strictly below the gap itself, so no candidate can overtake q.
4.4
SchemaBeam
Because our algorithm operates by modifying logits, it is compatible with both deterministic and stochastic decoding methods, such as beam search and random sampling. In practice, beam search provides better interpretation coverage, so we introduce SchemaBeam, which integrates SLA into standard beam search. Vanilla beam search, however, often produces unhelpful token-level diversity, including formatting variants (e.g., trailing semicolons or code fences) and logically equivalent queries that differ only in join order or other syntactic details. SchemaBeam reduces this redundancy by masking related tokens during decoding and deduplicating outputs syntactically using their ASTs.
5 5.1
Experiments
Setup
Datasets We select two benchmarks that contain one or more ambiguity categories related to schema ambiguity: • AmbiQT(Bhaskar et al. 2023) This dataset is modified from Spider (Yu et al. 2018) and contains fine-grained schema ambiguity types. For each question, the authors modify the database schema and create two alternative interpretations. We evaluate on Column, Join and Table ambiguity, with 2948 examples in total. • Ambrosia (Saparina and Lapata 2024). Ambrosia is an LLM-generated benchmark with three ambiguity types: scope, attachment, and vagueness. Scope and attachment arise from the natural-language question, whereas vagueness corresponds to schema ambiguity and is most comparable to AmbiQT. We evaluate on the 373 vagueness examples. Some examples include a third interpretation formed by combining the two alternatives, e.g., SELECT a, b in addition to SELECT a and SELECT b. We remove this combined interpretation because it is not independent of the first two and to keep the evaluation consistent with AmbiQT. Evaluation metric For both benchmarks, we measure how well the prediction set covers the possible interpretations. Following AmbiQT, we use EitherInTopK and BothInTopK, which report the percentage of examples for which at least one or both interpretations appear among the top-K predictions. When a method produces more than K predictions, we evaluate only the first K. Following (Bhaskar et al. 2023), we set K=5 by default. We also report inference latency, which is measured by comparing each method to vanilla beam search with the same base model. Baselines and comparison methods We list a series of model-agnostic baselines and comparison methods. Apart from methods that aim to generate multiple interpretations under ambiguity, we also look into state-of-the-art text-toSQL systems that generate diverse SQL queries. All experiments are conducted on two NVIDIA RTX A6000 GPUs in a Linux environment. We categorize all methods into three classes based on the key techniques they adopt: • Decoding methods: Following previous work(Bhaskar et al. 2023), we adopt beam search and random sampling as two baselines. A beam width of 10 and a temperature of 1.0 are used. We also evaluate model ensemble which is widely adopted in many systems(Liu et al. 2026; Wang et al. 2025). We combine predictions from models with beam search in a round-robin manner after deduplication. • Fine-tuning-based methods: These methods rely on task-specific fine-tuned models, including LogicalBeam(Bhaskar et al. 2023) and DFPL(Saparina and Lapata 2025a). • Prompt-based methods: Some methods manipulate the model input to generate different interpretations, usually dependent on carefully designed prompts and exploiting the reasoning ability of LLMs, including ODIN(Vaidya et al. 2025), CLEAR(Zhang et al. 2025). Moreover, we
adopt the prompt strategy used in Ambrosia that acknowledges the existence of ambiguity, denoted as Prompt. Some systems also incorporate generators with different reasoning strategies(Pourreza et al. 2024). We evaluate Deepeye-SQL(Li et al. 2026) which adopts skeletonbased, ICL, and divide-and-conquer as three strategies. For each strategy, we sample K times and select candidates in the same way in model ensemble. Our methods We consider two variants of our method. The first is Constrained beam search, which applies SLA to vanilla beam search with α = 0, thereby reducing decoding to schema-element constraints without similarity-based logit adjustment. The second is SchemaBeam (Section 4.4), which uses all-MiniLM-L6-v2 from Hugging Face to compute similarities between schema elements.
5.2
Performance with different models
We evaluate decoding methods on three base models: Llama3.1-8B, Qwen2.5-Coder-14B, and Qwen3.6-27B. We use α = 0.7 for Qwen2.5-Coder-14B and α = 0.8 for the others. Table 1 reports the results; where SchemaBeam improves BothInTopK in every setting; sampling is averaged over three runs. By constraining models to adhere to database schema elements, both metrics are improved in most cases, especially for BothInTopK. This is because we prevent hallucinated tokens, and simultaneously reduce the search space. SchemaBeam further enhances the performance even for EitherInTopK, which is partly due to cases where the top-1 prediction is wrong but semantically similar to one of the ground truth schema elements. The increased probability of the correct schema elements contributes to the improvement. Other factors such as deduplication, unhelpful token-masking are analyzed in the ablation study. However, for stronger base models which are more likely to generate the correct schema element and less likely to hallucinate, the additional diversity in schema element generation does not necessarily boost EitherInTopK. Another reason is that for the remaining incorrect predictions, the errors usually arise from incorrect SQL structures, such as redundant or missing subqueries and clauses, rather than incorrect schema elements. This also explains why the 14B and 27B models with SchemaBeam show similar results. But the interpretation coverage is consistently improved, demonstrating the applicability of our method to different base models, and the advantage over conventional decoding methods.
5.3
Comparison with other methods
We further compare SchemaBeam with existing methods for improving interpretation coverage. Prior work lacks a fair, comprehensive comparison because methods often use different base models, metrics, and dataset splits. To control for these factors, we reimplement all open-source methods with Qwen2.5-Coder-14B, which balances effectiveness and efficiency, and evaluate them under the same pipeline. Methods requiring task-specific fine-tuning are evaluated with their released fine-tuned models. For ODIN, whose code is unavailable, we report results with Claude 3 Haiku. Table 2
Column
Join
Table
Vague
Model
Method
Either
Both
Either
Both
Either
Both
Either
Both
Llama-8B
Sampling Beam Constrained SchemaBeam
59.17 57.29 61.48 62.45
11.84 10.56 17.89 38.36
76.89 77.59 75.52 78.28
23.45 16.55 31.38 54.83
66.22 65.49 70.43 70.22
17.15 17.15 24.77 39.03
64.99 57.91 58.97 67.72
8.81 8.86 8.97 23.63
QwenCoder-14B
Sampling Beam Constrained SchemaBeam
63.58 62.93 67.45 68.57
14.37 16.36 21.19 44.48
90.57 87.93 87.59 90.69
23.33 40.34 41.72 76.55
74.70 73.18 74.24 77.21
23.79 23.8 30.20 54.48
64.29 60.98 62.15 67.13
6.76 6.32 6.08 19.22
Qwen-27B
Sampling Beam Constrained SchemaBeam
68.30 70.59 69.46 71.23
20.71 32.39 34.97 47.38
90.45 90.00 90.00 92.76
21.60 58.62 61.03 81.72
76.23 77.63 77.06 75.37
22.35 29.50 33.17 53.07
67.76 66.85 66.67 69.04
8.83 13.81 15.80 25.75
Table 1: Top-5 results of different decoding methods. presents the results; our main findings are as follows: Prompt-based methods usually incur high latency, which is mainly caused by the increased context length, especially instructions and few-shot examples, and extra reasoning content they generate during the decoding process. However, they do not necessarily achieve superior performance. One important observation is that ensembling generators with different reasoning strategies fails to handle potential schema ambiguity. Moreover, these methods are highly dependent on the model capability, as we find a large performance drop of CLEAR when switching from GPT-4o which is used in the original paper to other weaker base models. Fine-tuning-based methods fall short in the generalization ability. Logicalbeam which is fine-tuned on SPIDER, fails to generalize to the Ambrosia dataset due to database domain shift and the limitations of the base model. Although DFPL performs well in several datasets, it is incapable of capturing JOIN ambiguity. Decoding methods are generally more efficient, and show stable performance across diverse datasets. We notice that combining predictions from Llama and QwenCoder yields better results. The improved diversity could be attributed to different training corpora, optimizing objectives, etc.
5.4
Ablation study
We conduct an ablation study on Column (C) and Table (T) ambiguity with Llama to examine the impact of SchemaBeam’s hyperparameters and components. Similar trends are observed across other datasets and base models. Influence of hyper-parameters We vary the number of final outputs among 3,5,7 for SchemaBeam and vanilla beam search to analyze where correct predictions are ranked. As shown in Fig. 4(left), the interpretation coverage grows as K increases. But for SchemaBeam, the curve exhibits a steeper slope at the beginning, which indicates the correct interpretations are more likely to be ranked at higher positions. We also report the results with α ∈ [0, 1] in Fig. 4(right), where we observe a steady growth initially, peaking around α = 0.8, and then starts to drop. The main reason is that a large α dis-
torts the original distribution, which reflects how well each schema element fits the current context.
Figure 4: Interpretation coverage vs K and α. Effects of each component Next we analyze each component in SchemaBeam, including the choice of embedding models (all-mpnet-base-v2, Qwen3-Embedding-0.6B), similarity aggregation strategies. We also gradually remove (1) syntactic deduplication, (2) unhelpful token masking and (3) SLA, with the final variant reducing to vanilla beam search. Results in Table 3 show that our method is not sensitive to the choice of embedding models, as our method relies on the coarse-grained similarity structure rather than exact similarity values, while different embedding models typically introduce only small shifts in similarity scores after normalization. We witness a performance drop in table ambiguity when replacing our similarity aggregation strategy with average pooling, since it weakens the similarity estimation between tables. Finally, all additional designs in SchemaBeam contribute to performance improvements, with SLA providing the largest gain.
5.5
Case study
Fig. 5 shows two representative examples: Case 1, where vanilla beam search fails and SchemaBeam succeeds, and Case 2, where SchemaBeam fails while beam search succeeds. In Case 1, the base model hallucinates columns and selects an incorrect column, whereas SchemaBeam covers
Column
Join
Table
Vague
Category
Method
latency Either
Both
Either
Both
Either
Both
Prompt-based
Prompt Reasoning ensemble CLEAR ODIN
1.59× 10.9× 6.36× -
23.77 15.95 32.39 43.69
74.88 82.41 86.55 87.85
33.45 19.66 38.62 58.33
71.91 76.99 70.15 73.96
58.36 53.95 13.08 21.74 63.61 6.01 36.34 51.2 11.11 59.99 -
Fine-tuning-based
DFPL LogicalBeam
2.54× 64.40 38.84 75.61 6.10 71.92 36.66 60.12 19.64 3.96× 65.56 27.42 87.15 63.19 77.19 49.75 18.31 2.97
Decoding-based
Beam Model ensemble SchemaBeam
1× 62.93 16.36 87.93 40.34 73.18 23.8 60.98 6.32 - 64.06 14.99 86.90 48.28 75.72 28.23 68.30 9.48 1.1× 68.57 44.48 90.69 76.55 77.21 54.48 67.13 19.22
59.87 65.75 62.85 67.44
Either
Both
Table 2: Performance comparison across different methods.
Method
Emb.
SchemaBeam Qwen SchemaBeam mpnet SchemaBeam MiniLM w/ avg w/o deduplication w/o masking w/o SLA(=beam)
Column
Table
Either Both
Either Both
62.13 62.05 62.45 62.37 61.89 61.80 57.29
70.36 69.87 70.22 70.92 68.67 68.31 65.49
38.11 39.00 38.36 38.28 36.18 35.78 10.56
38.11 38.53 39.03 33.87 35.64 34.56 17.15
Table 3: Component Analysis.
both valid interpretations. In Case 2, the correct query requires COUNT(*), but SchemaBeam ranks it lower because increasing schema-level diversity also introduces randomness in other schema choices. As a result, SchemaBeam detects the ambiguous columns but fails to rank the correct interpretations sufficiently high.
5.6
Key takeaways
SchemaBeam consistently improves interpretation coverage. Across three base models and both benchmarks, it improves BothInTopK over vanilla beam search in every setting, often by large margins, and improves EitherInTopK in most cases. The gains are largest for weaker models but remain visible for stronger ones, showing that skewed decoding distributions, rather than model capability alone, limit coverage. SchemaBeam also provides a strong accuracy–efficiency trade-off. Prompt-based methods are 1.59–10.9× slower than beam search and still underperform, while reasoning ensembles do not directly address schema ambiguity. Fine-tuning methods are competitive but brittle: LogicalBeam does not transfer to Ambrosia, and DFPL collapses on JOIN ambiguity. SchemaBeam matches or outperforms these methods at only 1.1× beam-search latency, requires no training, and remains robust across datasets. Overall, SchemaBeam shows that lightweight decodingtime intervention can substantially improve ambiguity coverage in text-to-SQL without training, prompting overhead, or dataset-specific failure modes.
Figure 5: Two examples with vanilla beam search and SchemaBeam. We highlight hallucinated (red) and correct (green) schema elements.
6
Conclusion
This paper proposes an efficient, training-free decoding method that encourages the exploration of alternative schema interpretations. By leveraging semantic similarities between schema elements through logit adjustment, our method substantially improves interpretation coverage over conventional decoding methods. It achieves performance comparable to fine-tuning and reasoning-based approaches while incurring much lower latency, demonstrating that decoding-time intervention is an effective and practical solution for diverse SQL query generation.
References Bhaskar, A.; Tomar, T.; Sathe, A.; and Sarawagi, S. 2023. Benchmarking and improving text-to-sql generation under ambiguity. arXiv preprint arXiv:2310.13659. Chan, R. S. M.; Sevastjanova, R.; and El-Assady, M. 2026.
PleaSQLarify: Visual Pragmatic Repair for Natural Language Database Querying. arXiv preprint arXiv:2603.01795. Ding, Z.; Lin, Y.; and Zeng, T. 2025. AmbiSQL: Interactive Ambiguity Detection and Resolution for Text-to-SQL. arXiv preprint arXiv:2508.15276. Floratou, A.; Psallidas, F.; Zhao, F.; Deep, S.; Hagleither, G.; Tan, W.; Cahoon, J.; Alotaibi, R.; Henkel, J.; Singla, A.; et al. 2024. Nl2sql is a solved problem... not! In CIDR. Khattab, O.; and Zaharia, M. 2020. Colbert: Efficient and effective passage search via contextualized late interaction over bert. In Proceedings of the 43rd International ACM SIGIR conference on research and development in Information Retrieval, 39–48. Li, B.; Chen, C.; Xue, Z.; Mei, Y.; and Luo, Y. 2026. DeepEye-SQL: A Software-Engineering-Inspired Text-toSQL Framework. Proc. ACM Manag. Data, 4(3). Li, J.; Hui, B.; Qu, G.; Yang, J.; Li, B.; Li, B.; Wang, B.; Qin, B.; Geng, R.; Huo, N.; et al. 2023. Can llm already serve as a database interface? a big bench for large-scale database grounded text-to-sqls. Advances in Neural Information Processing Systems, 36: 42330–42357. Liu, Y.; Zhu, Y.; Gao, Y.; Luo, Z.; Li, X.; Shi, X.; Hong, Y.; Gao, J.; Li, Y.; Ding, B.; and Zhou, J. 2026. XiYan-SQL: A Novel Multi-Generator Framework for Text-to-SQL. IEEE Transactions on Knowledge and Data Engineering, 1–14. Pourreza, M.; Li, H.; Sun, R.; Chung, Y.; Talaei, S.; Kakkar, G. T.; Gan, Y.; Saberi, A.; Ozcan, F.; and Arik, S. O. 2024. Chase-sql: Multi-path reasoning and preference optimized candidate selection in text-to-sql. arXiv preprint arXiv:2410.01943. Qiu, L.; Li, J.; Su, C.; and Chen, L. 2025. Interactive Textto-SQL via Expected Information Gain for Disambiguation. arXiv preprint arXiv:2507.06467. Saparina, I.; and Lapata, M. 2024. Ambrosia: A benchmark for parsing ambiguous questions into database queries. Advances in Neural Information Processing Systems, 37: 90600–90628. Saparina, I.; and Lapata, M. 2025a. Disambiguate first, parse later: Generating interpretations for ambiguity resolution in semantic parsing. In Findings of the Association for Computational Linguistics: ACL 2025, 16825–16839. Saparina, I.; and Lapata, M. 2025b. Reasoning About Intent for Ambiguous Requests. arXiv preprint arXiv:2511.10453. Sharma, C.; Narayanam, R.; Pal, S.; Yeturu, K.; Saini, S. K.; and Mukherjee, K. 2025. TTD-SQL: Tree-Guided Token Decoding for Efficient and Schema-Aware SQL Generation. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing: Industry Track, 1287–1298. Vaidya, K.; Sankararaman, A.; Ding, J.; Lei, C.; Qin, X.; Narayanaswamy, B.; and Kraska, T. 2025. ODIN: A NL2SQL Recommender to Handle Schema Ambiguity. arXiv preprint arXiv:2505.19302. Wang, B.; Gao, Y.; Li, Z.; and Lou, J.-G. 2023. Know what I don’t know: Handling ambiguous and unknown questions for text-to-SQL. In Findings of the Association for Computational Linguistics: ACL 2023, 5701–5714.
Wang, P.; Sun, B.; Dong, X.; Dai, Y.; Yuan, H.; Chu, M.; Gao, Y.; Qi, X.; Zhang, P.; and Yan, Y. 2025. AgentarScale-SQL: Advancing Text-to-SQL through Orchestrated Test-Time Scaling. arXiv:2509.24403. Yu, T.; Zhang, R.; Yang, K.; Yasunaga, M.; Wang, D.; Li, Z.; Ma, J.; Li, I.; Yao, Q.; Roman, S.; et al. 2018. Spider: A largescale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task. In Proceedings of the 2018 conference on empirical methods in natural language processing, 3911–3921. Zhang, M.; Ma, K.; Xu, L.; Zhang, K.; Peng, Y.; and Jin, R. 2025. CLEAR: A Parser-Independent Disambiguation Framework for NL2SQL. In 2025 IEEE 41st International Conference on Data Engineering (ICDE), 1–14. IEEE. Zhang, T.; Kishore, V.; Wu, F.; Weinberger, K. Q.; and Artzi, Y. 2019. Bertscore: Evaluating text generation with bert. arXiv preprint arXiv:1904.09675.
Related documents
- Disentangling Structure and Semantics: How Schema Representation Affects LLM-Based SQL Generation#658937
- Disentangling Structure and Semantics: How Schema Representation Affects LLM-Based SQL Generation#656801
- Knapsack Optimization-based Schema Linking for LLM-based Text-to-SQL Generation#158668
- TACO: A Benchmark for Open-Domain Text-to-SQL with Ambiguous and Cross-Database Queries#271943
- VCoT-SQL: Enhancing Text-to-SQL Generation through Dual Chain-of-Thought Validation Training#1536635
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive