AskWise: Execution-Guided Clarification of Intent and Data in Text-to-SQL
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.
AskWise: Execution-Guided Clarification of Intent and Data in Text-to-SQL Yuru Liang1,2 * Guangyinan Mei1,2 * Miles Fan1† 1 2 Renmin University of China DigitForce yuru@ruc.edu.cn
mgyn1.art@gmail.com
arXiv:2611.27474v1 [cs.DB] 20 Nov 2026
Abstract
Input
DataBase
Table: Orders order_id … status amount O-101 … Completed $ 60 O-102 … Completed $10 O-103 … Pending NULL (?) O-102 … Completed $30
Data Uncertainty
Data Clarification: What is the amount of the pending order?
Agent
The pending amount of O-103 is $50
The pending amount of O-103 is $0
SQL SELECT SUM(amount) FROM Orders
SQL SELECT SUM(amount) FROM Orders
SELECT SUM(amount) FROM Orders Where status=‘Completed’
Results $150
≠ $100
Intent Clarification: Should pending orders be included in revenue?
Agent
SELECT SUM(amount) FROM Orders Where status=‘Completed’
Results $100
= $100
No Need for Intent Clarification Your total revenue is $100
Figure 1: Clarifying the amount for pending order O-103. At $50, including it raises revenue from $100 to $150 (left). At $0, both queries return $100 (right).
The user in Figure 1 asks for total revenue. Three completed orders are worth $60, $10, and $30. A pending order has no amount on record. SQL’s SUM skips the missing value, so summing all orders and summing only completed orders both give $100. If the pending amount is $50, the two totals become $150 and $100. The assistant now needs to know whether pending orders count. If the amount is zero, either reading gives $100. If the user chooses completed orders first, the total is $100 regardless of the missing amount. One approach merges queries with identical observed answers (Yin et al., 2026). Here that would conceal their disagreement after a $50 repair. Asking about every missing value would make users investigate orders they mean to exclude. In our audit of AmbiQT (Bhaskar et al., 2023), we swapped two values in one column and reran both reference queries. Of 1,206 eligible pairs, 424 agreed before the swap and differed afterward. A SK W ISE uses SQL executions to test which choices matter (Figure 2). Each hypothesis pairs a query interpretation with a repaired database. Two surviving hypotheses that differ only in one choice and return different answers give a relevance certificate for asking about that choice. Once every
Motivation And Contributions
A database assistant can ask what a user means or whether a record is correct. Interactive semantic parsers ask users to resolve competing query interpretations (Gur et al., 2018; Yao et al., 2019; Elgohary et al., 2020; Tian et al., 2023). A user’s name for an entity may also differ from its stored value (Pham et al., 2026). Query-driven cleaning identifies records worth checking for a given query (Mo et al., 2013; Altwaijry et al., 2013). When both the query and the data are uncertain, how can an assistant tell what it still needs to ask? * Co-first authors. Work done as DigitForce interns. †
What is our total revenue? Intent Uncertainty: I1: All orders I2: only Completed orders
Two interpretations of a database question can agree on the observed records and diverge after a correction. A single record can therefore determine whether the user needs to clarify their intent. A SK W ISE executes candidate queries across possible repairs. It asks about a choice only when two executions differ in that choice alone and give different answers. Once all surviving combinations give the same known answer, it returns that answer. For Boolean answers on a uniform binary cube, we derive an exact bound on the difference in EC2 gain between two questions from partial execution results. Across 120 sales tasks spanning three query types, the bound reduces mean executions per episode from 14.88 to 13.80 relative to a partition relaxation. Asking at the first sign that a choice matters uses 13.18 executions and 0.025 more questions per episode. On AmbiQT, a controlled value swap separates the reference queries in 424 of 1,206 eligible cases. On 155 sampled questions, pruning the same model candidates across both database states raises recall of reference answer signatures by 8.71 percentage points for Doubao Lite and 10.00 for GPT Sol.
1
fmh4us@gmail.com
Corresponding author.
1
Execution and Clarification Loop What is our total revenue?
Intent Uncertainty 𝓘 𝐼! : All orders 𝐼" : Only completed orders
1 Joint Hypotheses Joint Hypothesis Space 𝓗 ℋ= ℐ× ℛ
3 Certification & Question Selection Relevance 𝑪𝒓
Selection-Optimal 𝑪𝒐
Execute SQL
Revenue: 100 Revenue: Revenue:100 100
𝑢 150
≠
𝑞! 𝑞"
Update known answers 𝒦
Data Uncertainty 𝓡 𝑟# : amount (O-103) = 0 𝑟$# : amount (O-103) = 50
𝐶& holds?
User Clarification
𝐴 𝐼, 𝑟 = 𝐸𝑥𝑒𝑐(𝑄% , 𝑟 𝐷 )
Q: Should revenue include pending orders?
𝑣 100
User Clarification
Yes
Return Answer Select a Clarification Question
No
Immediate Policy
2 Evidence Acquisition SQL Execution
4 Action & Update
Common Answer 𝑪𝒂
T1 EC2 Comparison Bound Compare question gains using partial counts in four response cells
Filter version space 𝑉'
Certified Policy
T2 Two-State Pruning Only merge queries whose answers agree on both database states
Update State 𝒦: ℎ! :100 ℎ! :100 … 𝑉' : { ℎ! , ℎ" , ℎ( , ℎ) }
Figure 2: One round of A SK W ISE. T1 compares question gains from partial executions. T2 merges queries only if their answers agree on both database states.
surviving hypothesis has produced the same result, the assistant has an answer certificate and can stop while some choices are still unresolved. Several questions may have a relevance witness. Equivalence class edge cutting (EC2) ranks them by the expected weight of edges they eliminate between hypotheses with different answers (Golovin et al., 2010). Two runs can show that intent matters while leaving open whether asking about the record has greater gain. Each further execution supplies one missing answer. For Boolean answers on a uniform binary cube, two coordinate questions divide the worlds into four cells. The observed positives and the number of unexecuted worlds bound the final positive count in each cell. From these counts we bound the gain difference and can certify a maximizer before all worlds are executed. One policy waits for this action certificate. The other asks at the first witness. We make three contributions.
ing and inspect 100 executable queries that match neither reference (Section 5).1
2
Related Work
Interactive Parsing. NaLIR resolves query ambiguity through dialogue (Li and Jagadish, 2014). DialSQL asks users to validate parts of a SQL query (Gur et al., 2018), and MISP selects when and where to ask (Yao et al., 2019). Users can also revise a parse through natural-language corrections (Elgohary et al., 2020) or by editing a stepwise explanation (Tian et al., 2023). SParC studies followup questions, and CoSQL includes clarification and unanswerable requests (Yu et al., 2019b,a). A SK W ISE asks whether a missing value makes an intent question necessary. Clarification Questions. AmbigQA pairs alternative answers with question rewrites (Min et al., 2020). AmbiQT pairs competing SQL queries (Bhaskar et al., 2023), and AMBROSIA tests scope, attachment, and vagueness (Saparina and Lapata, 2024). Saparina and Lapata (2025) generate missing interpretations before parsing. PRACTIQ studies dialogues about ambiguous and unanswerable requests (Dong et al., 2025). CLAQUA and CAmbigNQ evaluate when to ask, what to ask, and how to use replies (Xu et al., 2019; Lee et al., 2023). CLAMBER tests whether models recognize and clarify ambiguity (Zhang et al., 2024). Wang et al. (2023) locate ambiguity in SQL requests. CLARITY tests how parsers handle partial replies (Sarwar et al., 2026).
• We formulate clarification over a finite set of interpretations and repairs, and give conditions for certifying both a question’s relevance and the returned answer (Section 3). • We express the difference in EC2 gain between two coordinate questions using four counts. This identity gives attainable bounds on the difference before all Boolean answers are known (Section 4). • On the 120 Sales Test tasks with fixed execution order, certifying a maximizer takes 0.62 more executions and saves 0.025 questions per episode relative to asking at the first witness. On AmbiQT, we measure the loss in reference coverage from observed-state prun-
Query Equivalence. AIR removes interpretations with identical outputs on the observed data 1
Code and experiment scripts: com/fmh1art/AskWise.
2
https://github.
(Yin et al., 2026). SOMA-SQL uses synthetic logs and execution probes (Somayajula et al., 2026), and CircleClar studies which answers a model can reach through repeated clarification (Tang et al., 2026). Executing queries on additional databases can expose differences that a single instance conceals (Zhong et al., 2020). Cosette proves equivalence or finds counterexamples for supported SQL fragments (Chu et al., 2017). VeriEQL verifies bounded equivalence under integrity constraints (He et al., 2024), and SpotIt+ searches for distinguishing databases under mined constraints (Tremante et al., 2026). For clarification, a counterexample must distinguish the queries on a repair consistent with the user’s replies.
worlds whose answers are still unknown. The policy can execute another world or ask about a choice with a known witness.
3
Clarification Model
3.1
Joint Hypotheses
Let D be the database, I a finite set of interpretations, and R a finite set of repairs. A world pairs a query Qi with a repaired database r(D). Its answer is defined for each admissible pair (i, r) ∈ H ⊆ I × R by A(i, r) = Exec(Qi , r(D)).
(1)
In the SQL audit, we compare outputs as multisets of typed rows. This preserves duplicate rows and ignores row order. Column order within each row still matters (Section 5.6). Two queries can give the same output on a particular database even when they differ on other instances (Zhong et al., 2020; Chu et al., 2017). A clarification question q reveals q(h⋆ ) for the hidden world h⋆ . After responses ψ, the surviving worlds form the version space
Data Cleaning. Selective cleaning for top-k queries and query-driven entity resolution target records that affect a query result (Mo et al., 2013; Altwaijry et al., 2013). QOCO consults experts about wrong or missing answers and the records responsible (Bergman et al., 2015). ActiveClean selects records to clean while updating a statistical model (Krishnan et al., 2016). HoloClean infers repairs from constraints, external information, and statistical signals (Rekatsinas et al., 2017). Consistent query answering finds individual answers shared by all admissible minimal repairs (Arenas et al., 1999). We test whether the full output agrees across candidate repairs and interpretations. Semiring provenance tracks dependencies on annotated records (Green et al., 2007). We group worlds by bounded integer score using generating functions and differential inference (Todor et al., 2013; Darwiche, 2003).
Vψ = {h ∈ H : ∀q ∈ dom(ψ), q(h) = ψ(q)}. (2) The policy records each executed world in K and caches its answer. A user response narrows Vψ . For example, specifying completed orders rules out every interpretation that includes pending orders, whatever the missing amount. Answer Certificate. The policy can return a when Vψ is nonempty and A(h) = a for every h ∈ Vψ . Our black-box implementation checks that each surviving world belongs to K and has the same answer. If h⋆ ∈ H and responses are truthful, then h⋆ survives every response and the returned answer equals A(h⋆ ).
Adaptive Selection. Generalized binary search selects questions to identify a hidden hypothesis (Nowak, 2011). EC2 targets its answer class (Golovin et al., 2010), and decision-region determination allows overlapping sets of acceptable answers (Javdani et al., 2014). Adaptive submodularity gives conditions for greedy guarantees and lazy evaluation (Golovin and Krause, 2011). Stochastic Boolean function evaluation and score classification study the cost of revealing inputs sequentially (Deshpande et al., 2016; Gkenosis et al., 2018). EC2 takes the answer classes as input. Several worlds can share an answer. Here the policy must execute candidate queries on the proposed repairs to learn which worlds belong to each class. An execution labels one world and leaves the others admissible. A user response can rule out several
3.2
Answer Signatures
An interpretation’s answer signature lists its outputs across repairs. For queries admissible on the same repairs R, the equivalence relation is i ≡R j ⇐⇒ ∀r ∈ R, A(i, r) = A(j, r).
(3)
For order O-103 in Figure 2, the two repairs fill in $0 and $50, in that order. Summing all orders gives the signature (100, 150) and summing completed orders gives (100, 100). Comparing only the first entries would merge the queries and lose 3
the distinction at $50. We use signatures to evaluate candidate pruning. Grouping worlds to select questions must also preserve response partitions and their probability masses. 3.3
nor ask, it executes a surviving world whose answer is still unknown. The fourth panel updates K after execution or filters Vψ after a user response. Initially, Vψ = H and K = ∅. T1 ranks questions within the interaction. T2 uses Eq. 3 to group candidate queries by their answers on the original and modified databases. EC2 assigns an edge to each unordered pair of worlds with different answers. Its gain is the expected weight of the edges eliminated by a response (Golovin et al., 2010). For n surviving worlds, let xuv = 1[A(u) ̸= A(v)] and let nz count worlds giving response z to question q. With uniform weights, X G(q) = n−3 cq (u, v)xuv , (5)
Question Relevance
For coordinate questions on a Cartesian product, we call q locally relevant if there are surviving worlds u, v ∈ Vψ such that uj = vj (j ̸= q),
A(u) ̸= A(v).
(4)
The two worlds agree on every other choice, so their different answers establish the effect of changing q alone. In Figure 1, holding the pending amount at 50 gives such a pair for the intent question. Comparing all orders at 50 with completed orders at 0 would change both choices and leave the cause of the disagreement unresolved. Consider an answer given by the XOR of two fair bits. Conditioning on either bit leaves the answer evenly split, just as conditioning on an unused bit would. Yet flipping either input with the other held fixed reverses the answer. The neighboring worlds in Eq. 4 expose this dependence. A SK W ISE requires an observed pair, or relevance witness, before asking a question. We count distinct worlds executed (E) and questions asked (Q). Their weighted cost is E + cQ, where c is the cost of a question in execution units. SQL answers are deterministic, hidden worlds equiprobable, and responses to binary questions truthful.
4
Question Selection
4.1
Clarification Policy
{u,v}
( n, q(u) ̸= q(v), cq (u, v) = n − nq(u) , q(u) = q(v). If u and v give different responses, either response eliminates their edge. If they give the same response z, their edge disappears only when the response differs from z. 4.2
Four-Cell Gain Bound
Assume Boolean answers, a uniform binary Cartesian cube, and equal question costs. Fixing coordinates through clarification leaves a smaller cube. For two unanswered coordinates q, r, group the surviving worlds by their responses (q, r). Let a, b, c, d count the positive answers in cells 00, 01, 10, 11, respectively. Proposition 1. The scaled gain difference equals n2 G(q) − G(r) = (a − d)(b − c). (6)
The four revenue worlds in Figure 2 illustrate how the policy uses evidence from different rounds. Suppose the all-orders query has returned 100 with the pending amount set to zero and 150 with it set to 50. These two executions establish a witness for the amount question. If the user supplies 50, only two worlds survive. The policy already knows the all-orders result on that branch and needs one more execution to learn the completed-orders result. Appendix F traces both responses. In the third panel, agreement on a known answer across all surviving worlds (Ca ) lets the assistant return immediately. A relevance witness (Cr ) lets the immediate policy ask the corresponding question. The certified policy also requires an action certificate (Co ) showing that the question maximizes the current EC2 gain. If the policy can neither answer
Each question bisects the cube. The positive counts in the two halves are (a + b, c + d) for q and (a + c, b + d) for r. Both remove every edge that crosses their split and, in expectation, half the edges within the two halves. Since the total edge weight is fixed, the question that leaves fewer edges within its halves has greater gain. Comparing those within-half counts gives the product in Eq. 6 (Appendix A). Each execution narrows the range of one cell count. For cell 00, the lower bound a− is its number of observed positives and the upper bound a+ adds its number of unknown answers. Applying
4
the same bounds to each cell gives a − d ∈ [a− − d+ , a+ − d− ],
(7)
b − c ∈ [b− − c+ , b+ − c− ].
(8)
SQL outputs. Sales Test measures policy costs on Boolean versions of the same three queries with new seeds. AmbiQT Swap tests whether two reference queries still agree after a value swap. AmbiQT Candidates measures which reference answers survive pruning in a sample from that audit. Boolean Stress isolates six patterns of answer dependence, and Boolean Cube enumerates partially labeled maps. Score Sums times the aggregation of worlds with equal integer scores (Appendix C).
The factors depend on disjoint pairs of cells. Assigning the unknown Boolean answers within each cell therefore attains every combination of interval endpoints. The smallest and largest of the four endpoint products give exact bounds on the scaled gain difference. If the lower bound for q against every competitor is nonnegative, q maximizes the gain under every completion. The policy asks the first certified maximizer with a relevance witness. 4.3
Evaluation set Sales Dev Sales Test Boolean Stress Boolean Cube AmbiQT Swap AmbiQT Candidates Score Sums
Execution Order
We compare the four-cell bound with a partition bound that groups executed worlds by answer. An unknown world can join one of these groups or form a new one. For each unknown world, the relaxation chooses the class assignment that gives the smallest contribution to the gain difference. These assignments can be incompatible when two unknown worlds share an edge. The four-cell bound counts each Boolean label in a single response cell. Appendix A derives the relaxation. When a policy needs another execution, fixed order takes the first unknown surviving world. Witness order prefers worlds with the most distinct labels among known neighbors one coordinate away. It breaks ties by neighbor count and then by fixed order. If the neighbors have both Boolean labels, either outcome supplies a witness.
Experimental Evaluation
5.1
Tasks And Policies
300 tasks 120 tasks 48 fixtures 38 maps 1,240 items 155 questions, 2 models 3 seeds per size
Table 1: Evaluation sets and sample sizes.
For each of 40 Sales Test seeds, we generate a leading-region query, a customer-count query, and an order-count query. One intent choice and three decisions about duplicate records define 16 worlds for each query. To test the Boolean bound, we ask whether East is among the leading regions, whether the customer count is at least six, and whether the thresholded order count is at least five. We fixed the seeds and Boolean predicates before evaluation. Each world serves once as the simulator’s hidden world, giving 1,920 episodes per policy. We precompute the answers in SQLite and reveal each to the policy only when it requests that execution. We compute paired confidence intervals using 2,000 bootstrap samples of the 40 seeds, keeping the three queries from each seed together. Appendix B reports the original SQL results.
Stopping Conditions. Each execution reveals a new label and each question fixes a coordinate. On a fully known nonconstant cube, a path between worlds with different answers must contain an edge whose endpoints have different labels. The coordinate on that edge is relevant. An irrelevant coordinate splits the positive labels evenly and has minimum EC2 gain. Thus some relevant coordinate attains the maximum, even if all gains tie. Either policy can then ask that question. On a constant map, every question is irrelevant. The policy must execute all worlds because any unseen answer could differ.
5
Size
Policy Configurations. We evaluate ten configurations. The anchor policy returns the answer from one execution. Ask-all resolves every coordinate and then executes the remaining world. Full EC2 executes all worlds before selecting questions. Full relevant EC2 also checks each question for a local witness (Eq. 4). The other six configurations pair exact, partition, or immediate selection with fixed or witness execution order. Table 2 compares the seven policies that require a witness for every question and agreement before returning an answer. Table 6 reports violations for all ten.
We test question selection and candidate pruning separately (Table 1). Sales Dev uses the original 5
Relevant
Exact bound
Partition bound Immediate witness
Task family
Metric
EC2 Fixed Witness Fixed Witness Fixed
Witness
Leading region (n = 40)
E↓ Q C10 ↓
16.00 15.16 0.52 0.52 21.19 20.35
15.16 15.68 0.52 0.52 20.35 20.87
15.67 13.83 0.52 0.57 20.86 19.52
13.83 0.57 19.52
Customer count (n = 40) E ↓ Q C10 ↓
16.00 12.50 1.00 1.00 26.00 22.50
12.50 14.00 1.00 1.00 22.50 24.00
14.00 12.50 1.00 1.00 24.00 22.50
12.50 1.00 22.50
Order threshold (n = 40) E ↓ Q C10 ↓
16.00 13.75 0.91 0.91 25.12 22.87
13.78 14.95 0.91 0.91 22.90 24.07
15.03 13.22 0.91 0.94 24.16 22.59
13.22 0.94 22.59
E↓ Q C10 ↓
16.00 13.80 0.81 0.81 24.10 21.91
13.81 14.88 0.81 0.81 21.92 22.98
14.90 13.18 0.81 0.84 23.00 21.54
13.18 0.84 21.54
All tasks (n = 120)
Table 2: Sales Test costs. Bold marks the lowest E and C10 = E + 10Q within each group. Executed worlds saved
(a) Leading region 10
(b) Customer count
Mean +1.32
(c) Order threshold
Mean +0.00
Mean +0.53
8 6 4 2 0 40 seeds
Mean + CI
40 seeds
Mean + CI
40 seeds
Mean + CI
Figure 3: Executions saved by immediate selection with witness order relative to exact selection with fixed order. Diamonds show means and bars give 95% intervals from resampling seeds.
Policy Costs
a live database would add a separate cost to each requested world. The seven policies give the correct answer and ask only witnessed questions on all 1,920 sales episodes per policy. The anchor policy gives 580 wrong answers. Ask-all answers correctly after four questions, of which 79.11% are irrelevant. It asks every question before its first execution, so none has an observed witness when asked. Excess cost, Cc − min Cc
With fixed execution order, the exact bound uses 13.80 executions per episode, compared with 14.88 for the partition bound and 16 for full relevant EC2 (Table 2). Among the seven policies in the table, immediate selection uses the fewest executions, 13.18 per episode. Waiting to certify an EC2 maximizer costs an additional 0.619 executions on average (95% paired interval [0.346, 0.942]) and reduces mean questions from 0.835 to 0.810. Immediate selection saves 1.325 executions on leadingregion queries and 0.531 on order thresholds relative to exact selection with fixed order (Figure 3, using witness order for immediate selection). They tie on every customer-count seed at a mean of 12.50. Changing the execution order has little effect on these means. The immediate policy uses 13.18 executions with either order. Searching the known neighbors for the most informative world increases its decision time from 0.168 to 0.516 milliseconds per episode. For the exact policy, witness order costs 13.81 executions, compared with 13.80 under fixed order. These timings cover the policy and its lookup of cached answers. Query execution on
3.0
c = 24.75
5.2
1.5
0.0
10−2
10−1
100
101
102
Question / execution cost, c Full relevant EC2
Partition bound
Exact bound
Immediate witness
Figure 4: Excess cost at each question weight. Shading gives pointwise 95% paired bootstrap intervals.
Figure 4 shows how policy costs vary with the 6
question weight. With fixed order the mean cost difference between exact and immediate selection is 0.61875 − 0.025c. At c = 10, immediate selection costs 21.54 and exact selection costs 21.91. Exact selection costs less above c = 24.75. Appendix C reports timings. 5.3
database and disagree after the swap in 424 cases (35.16% of eligible interventions). In the other 782 cases, all four worlds give the same answer. Swapping two values preserves the column’s multiset, so a whole-column aggregate can remain constant even as the values associated with particular rows change. In each of the 424 affected cases, pruning on the observed database gives the right answer in three of the four worlds. It makes 424 errors in 4 × 1,206 equally weighted trials, yielding 91.21% accuracy. Given both reference queries and the complete answer map, EC2 averages 1.5 questions on the 424 affected cases. On the other 782 it can return the common answer immediately. It answers correctly in every world, averaging 0.5274 questions. Figure 10 gives the database counts.
Certificate Quality
To measure what the bound itself contributes, we enumerate all 38 = 6,561 partial answer maps on three binary coordinates. Each of the eight worlds can have a known positive answer, a known negative answer, or an unknown answer. We check Eq. 6 against direct edge counts and apply both bounds to each partial map. With six answers known, the exact bound certifies a maximizer with a relevance witness in 71.4% of maps, compared with 13.8% for the partition bound (Figure 5). Our six stress tests cover a constant, a single relevant bit, XOR with nuisance coordinates, a rare conjunction, a weighted threshold, and branching on intent. Eight seeds give 48 fixtures, some with repeated answer maps (Figure 6). On the XOR fixture, full EC2 breaks ties by fixed order and spends half its questions on irrelevant coordinates. Requiring a relevance witness removes these questions. On a constant map, every policy that requires a witness executes all 16 worlds and asks zero questions. The cost changes when the query has known structure. In Score Sums, worlds with the same integer score share a count. With 256 binary repairs and one binary intent, the score histograms for 2257 worlds take 0.55 to 0.59 seconds to compute across three seeds. Appendix C compares this computation with enumeration. 5.4
5.5
Reference Signature Recovery
We sample up to eight distinct questions per database by a deterministic hash, giving 155 questions across 20 databases. Doubao Lite and GPT Sol each receive the question and schema and propose up to four SQL interpretations in one request. We discard queries that fail on either state. In generation order, observed-state pruning keeps the first query for each distinct original answer. Two-state pruning keeps the first for each distinct pair of original and modified answers. For each question, recall is the fraction of reference signatures recovered, and precision is the fraction of retained signatures that match a reference. Full recovery requires every reference signature. Table 3 averages each measure over questions. Both rules retain the first query for each original answer. The recall difference measures the coverage lost by pruning before the swap. Two-state pruning raises mean recall by 8.71 percentage points for Doubao Lite (95% paired database bootstrap interval [4.69, 12.81]) and 10.00 for GPT Sol ([5.94, 14.14]). All gains occur on the 53 questions with two reference signatures. Since both yield the same original answer, observed-state pruning retains at most one. After the swap, both signatures survive on 27 of these questions for Doubao Lite and 31 for GPT Sol. Mean recall increases in 11 of 20 databases for Doubao Lite and in 12 for GPT Sol (Figure 11). Two-state pruning adds 39 signatures for Doubao Lite and 45 for GPT Sol. Of these, 12 and 14 match neither reference. Mean precision changes by +0.65 and −0.43 points, respectively. Both paired 95% intervals include zero. Of the
Sensitivity To Repairs
We examine all 1,240 validation items in the column-synonym category of AmbiQT (Bhaskar et al., 2023), using the associated Spider databases (Yu et al., 2018). Spider-Syn changes schema terms in the question (Gan et al., 2021), and Dr.Spider perturbs databases, questions, and SQL (Chang et al., 2023). We hold both reference queries fixed and swap two values in the second synonym column. We choose the rows deterministically from distinct non-null values before examining query outputs. Twenty items fail to execute and 14 more lack a pair of eligible values, leaving 1,206 cases. We execute both queries on both states for each eligible case. The two reference queries agree on the observed 7
(a) Action certificates Exact four-cell Partition relaxation
100
0.45 71.4
75
Bound gap
Certified states (%)
(b) Relaxation slack
50
25
0.30
0.15
13.8
0
0
1
2
3
4
5
6
7
0.00
8
0
Observed labels (of 8)
1
2
3
4
5
6
7
8
Observed labels (of 8)
Figure 5: Witnessed EC2 maximizers (left) and mean bound gap in edge-cut units (right). All cases (n = 155) Two signatures (n = 53) One signature (n = 102) Model
Pruning
Rec.
Prec.
Full
Rec.
Prec.
Prec.
Full
Doubao Lite Observed 59.03 47.37 44.52 42.45 51.73 Two-state 67.74 48.01 61.94 67.92 55.82
0.00 67.65 45.10 50.94 67.65 43.95
67.65 67.65
GPT Sol
0.00 66.67 52.86 58.49 66.67 51.55
66.67 66.67
Observed 59.03 59.89 43.87 44.34 73.43 Two-state 69.03 59.46 63.87 73.58 74.69
Full
Rec.
Table 3: Reference recovery (%) on AmbiQT Candidates.
208 reference signatures across questions, 67 for Doubao Lite and 62 for GPT Sol are already absent before pruning. For songs by singers older than average, GPT Sol proposed both track_name and composition_name. Swapping two composition names separated the lists (Appendix F.3). 5.6
For example, a query returned opening year and staff size in the order the question requested, while the reference returned staff size first. Across all 453 executable mismatches, we tested whether a fixed permutation of the columns reproduced either reference on both states. This recovered a match for 17 of 276 Doubao Lite queries and 15 of 177 GPT Sol queries. The choice of join could change who appeared in an answer. A left join counted friends for all 16 students, including two with no friendship record. Both references used an inner join and reported counts for the other 14 students.
SQL Error Analysis
Before pruning, 276 Doubao Lite queries and 177 GPT Sol queries executed on both states but matched neither reference signature. A further 11 and six, respectively, failed to execute on at least one state. We sampled 50 executable mismatches per model by hash. The sample spans 73 questions and 20 databases. With model names hidden, OpenAI Codex compared each query with both references in one pass and labeled its discrepancies from the closer one (Table 4). Since the comparison rule affects measured accuracy (Renggli et al., 2025), we also tested the effect of column order. Discrepancy Output columns Source or join Aggregation Predicate Ranking or ties
Doubao Lite
GPT Sol
Pooled
17 15 13 11 5
29 13 14 8 9
46 28 27 19 14
6
Main Conclusions
A SK W ISE asks about a choice only when two SQL executions show that it can change the answer. On 120 Boolean sales tasks, the certified policy averaged 13.80 executions per episode with the four-cell bound and 14.88 with the partition bound. Asking at the first witness saved another 0.62 executions at the cost of 0.025 more questions per episode. On AmbiQT, two-state pruning preserved a second reference signature on 27 of 155 questions for Doubao Lite and 31 for GPT Sol. In each case the queries agreed on the original records and gave different answers after the swap.
Table 4: Counts among 50 sampled SQL mismatches per model. Of the 100 queries, 32 had multiple labels.
Output columns differed in 46 of the 100 queries. 8
Limitations
Shuaichen Chang, Jun Wang, Mingwen Dong, Lin Pan, Henghui Zhu, Alexander Hanbo Li, Wuwei Lan, Sheng Zhang, Jiarong Jiang, Joseph Lilien, Steve Ash, William Wang, Zhiguo Wang, Vittorio Castelli, Bing Xiang, and Patrick Ng. 2023. Dr.Spider: A diagnostic evaluation benchmark towards text-to-SQL robustness. In The Eleventh International Conference on Learning Representations.
Answer correctness assumes that the supplied candidates include the intended query and the true database state. The AmbiQT audit uses one value swap in one category. Estimating their frequency requires data on actual repairs. The sales tasks use new seeds from the development generator. The simulator answers truthfully and assigns the same cost to each question. Measuring the effort and reliability of real responses requires a user study. The exact bound assumes Boolean answers on a uniform binary cube. Dependencies among repairs or unequal probabilities change the gain calculation.
Shumo Chu, Chenglong Wang, Konstantin Weitz, and Alvin Cheung. 2017. Cosette: An Automated Prover for SQL. In Proceedings of the 8th Biennial Conference on Innovative Data Systems Research (CIDR). Adnan Darwiche. 2003. A differential approach to inference in bayesian networks. Journal of the ACM, 50(3):280–305. Amol Deshpande, Lisa Hellerstein, and Devorah Kletenik. 2016. Approximation Algorithms for Stochastic Submodular Set Cover with Applications to Boolean Function Evaluation and Min-Knapsack. ACM Transactions on Algorithms, 12(3):1–28.
Ethical Considerations The study uses public databases, generated sales records, and simulated users. Models generate candidates from schemas and questions alone.
Mingwen Dong, Nischal Ashok Kumar, Yiqun Hu, Anuj Chauhan, Chung-Wei Hang, Shuaichen Chang, Lin Pan, Wuwei Lan, Henghui Zhu, Jiarong Jiang, Patrick Ng, and Zhiguo Wang. 2025. PRACTIQ: A practical conversational text-to-SQL dataset with ambiguous and unanswerable queries. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 255–273, Albuquerque, New Mexico. Association for Computational Linguistics.
Acknowledgements We used OpenAI Codex to organize and revise the manuscript, draft the explanations in Appendix F, and edit the LATEX source. We consulted Doubao Lite and GPT Sol on question selection and the EC2 derivation. We checked the gain identity by exhaustive enumeration (Section 5). Both models also generated candidate SQL queries for the AmbiQT evaluation (Appendix E).
Ahmed Elgohary, Saghar Hosseini, and Ahmed Hassan Awadallah. 2020. Speak to your parser: Interactive text-to-SQL with natural language feedback. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2065– 2077, Online. Association for Computational Linguistics.
References Hotham Altwaijry, Dmitri V. Kalashnikov, and Sharad Mehrotra. 2013. Query-driven approach to entity resolution. Proceedings of the VLDB Endowment, 6(14):1846–1857.
Yujian Gan, Xinyun Chen, Qiuping Huang, Matthew Purver, John R. Woodward, Jinxia Xie, and Pengsheng Huang. 2021. Towards robustness of textto-SQL models against synonym substitution. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 2505– 2515, Online. Association for Computational Linguistics.
Marcelo Arenas, Leopoldo Bertossi, and Jan Chomicki. 1999. Consistent query answers in inconsistent databases. In Proceedings of the eighteenth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems, pages 68–79. Moria Bergman, Tova Milo, Slava Novgorodov, and Wang-Chiew Tan. 2015. QOCO: A query oriented data cleaning system with oracles. Proceedings of the VLDB Endowment, 8(12):1900–1903.
Dimitrios Gkenosis, Nathaniel Grammel, Lisa Hellerstein, and Devorah Kletenik. 2018. The stochastic score classification problem. Preprint, arXiv:1806.10660.
Adithya Bhaskar, Tushar Tomar, Ashutosh Sathe, and Sunita Sarawagi. 2023. Benchmarking and improving text-to-SQL generation under ambiguity. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 7053– 7074, Singapore. Association for Computational Linguistics.
Daniel Golovin and Andreas Krause. 2011. Adaptive submodularity: Theory and applications in active learning and stochastic optimization. Journal of Artificial Intelligence Research (JAIR), 42:427–486.
9
Daniel Golovin, Andreas Krause, and Debajyoti Ray. 2010. Near-optimal bayesian active learning with noisy observations. In Advances in Neural Information Processing Systems.
Robert D. Nowak. 2011. The geometry of generalized binary search. IEEE Transactions on Information Theory, 57(12):7893–7906. Minh Tam Pham, Thanh Trung Huynh, Thanh Dat Hoang, Quoc Viet Hung Nguyen, Hongzhi Yin, and Thanh Tam Nguyen. 2026. RAQS-SQL: Schema and value ambiguity resolution in text-to-SQL. IEEE Transactions on Knowledge and Data Engineering, pages 1–18.
Todd J. Green, Grigoris Karvounarakis, and Val Tannen. 2007. Provenance semirings. In Proceedings of the twenty-sixth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems, SIGMOD/PODS07, pages 31–40. ACM.
Theodoros Rekatsinas, Xu Chu, Ihab F. Ilyas, and Christopher Ré. 2017. HoloClean: Holistic data repairs with probabilistic inference. Proceedings of the VLDB Endowment, 10(11):1190–1201.
Izzeddin Gur, Semih Yavuz, Yu Su, and Xifeng Yan. 2018. DialSQL: Dialogue based structured query generation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1339–1349, Melbourne, Australia. Association for Computational Linguistics.
Cedric Renggli, Ihab F. Ilyas, and Theodoros Rekatsinas. 2025. Fundamental challenges in evaluating Text2SQL solutions and detecting their limitations. Preprint, arXiv:2501.18197.
Yang He, Pinhan Zhao, Xinyu Wang, and Yuepeng Wang. 2024. VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity Constraints. Proceedings of the ACM on Programming Languages, 8(OOPSLA1):1071–1099.
Irina Saparina and Mirella Lapata. 2024. AMBROSIA: A benchmark for parsing ambiguous questions into database queries. In Advances in Neural Information Processing Systems, volume 37, pages 90600–90628. Curran Associates, Inc.
Shervin Javdani, Yuxin Chen, Amin Karbasi, Andreas Krause, Drew Bagnell, and Siddhartha Srinivasa. 2014. Near Optimal Bayesian Active Learning for Decision Making. In Proceedings of the Seventeenth International Conference on Artificial Intelligence and Statistics, volume 33 of Proceedings of Machine Learning Research, pages 430–438, Reykjavik, Iceland. PMLR.
Irina Saparina and Mirella Lapata. 2025. Disambiguate first, parse later: Generating interpretations for ambiguity resolution in semantic parsing. In Findings of the Association for Computational Linguistics: ACL 2025, pages 16825–16839, Vienna, Austria. Association for Computational Linguistics. Tabinda Sarwar, Farhad Moghimifar, Cong Duy Vu Hoang, Xiaoxiao Ma, Shawn Chang Xu, Fahimeh Saleh, Poorya Zaremoodi, Avirup Sil, and Katrin Kirchhoff. 2026. CLARITY: A framework and benchmark for conversational language ambiguity and unanswerability in interactive NL2SQL systems. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 6: Industry Track), pages 1218–1250, San Diego, California, USA. Association for Computational Linguistics.
Sanjay Krishnan, Jiannan Wang, Eugene Wu, Michael J. Franklin, and Ken Goldberg. 2016. ActiveClean: Interactive data cleaning for statistical modeling. Proceedings of the VLDB Endowment, 9(12):948–959. Dongryeol Lee, Segwang Kim, Minwoo Lee, Hwanhee Lee, Joonsuk Park, Sang-Woo Lee, and Kyomin Jung. 2023. Asking clarification questions to handle ambiguity in open-domain QA. In Findings of the Association for Computational Linguistics: EMNLP 2023, pages 11526–11544, Singapore. Association for Computational Linguistics.
Sai Ashish Somayajula, Marianne Menglin Liu, Chuan Lei, Fjona Parllaku, Daniel Garcia, Rongguang Wang, Syed Fahad Allam Shah, Ankan Bansal, Sujeeth Bharadwaj, Tao Sheng, Sujith Ravi, and Dan Roth. 2026. Soma-sql: Resolving multi-source ambiguity in nl-to-sql via synthetic log and execution probing. Preprint, arXiv:2606.11424.
Fei Li and H. V. Jagadish. 2014. Constructing an interactive natural language interface for relational databases. Proceedings of the VLDB Endowment, 8(1):73–84. Sewon Min, Julian Michael, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2020. AmbigQA: Answering ambiguous open-domain questions. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5783– 5797, Online. Association for Computational Linguistics.
Jingqin Tang, Tim Tomov, Sebastian Schmidt, Dominik Fuchsgruber, and Stephan Günnemann. 2026. What is a clarification? estimating model-dependent input ambiguity. Preprint, arXiv:2610.20052. Yuan Tian, Zheng Zhang, Zheng Ning, Toby Jia-Jun Li, Jonathan K. Kummerfeld, and Tianyi Zhang. 2023. Interactive text-to-SQL generation via editable stepby-step explanations. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 16149–16166, Singapore. Association for Computational Linguistics.
Luyi Mo, R. Cheng, Xiang Li, D. W. Cheung, and X. S. Yang. 2013. Cleaning uncertain data for top-k queries. In 2013 IEEE 29th International Conference on Data Engineering (ICDE), pages 134–145. IEEE.
10
Andrei Todor, Alin Dobra, Tamer Kahveci, and Christopher Dudley. 2013. Making massive probabilistic databases practical. Preprint, arXiv:1307.0844.
Conference on Empirical Methods in Natural Language Processing, pages 3911–3921, Brussels, Belgium. Association for Computational Linguistics.
Andrew Tremante, Yang He, Rocky Klopfenstein, Yuepeng Wang, Nina Narodytska, and Haoze Wu. 2026. Spotit+: Verification-based text-to-sql evaluation with database constraints. Preprint, arXiv:2603.04334.
Tao Yu, Rui Zhang, Michihiro Yasunaga, Yi Chern Tan, Xi Victoria Lin, Suyi Li, Heyang Er, Irene Li, Bo Pang, Tao Chen, Emily Ji, Shreya Dixit, David Proctor, Sungrok Shim, Jonathan Kraft, Vincent Zhang, Caiming Xiong, Richard Socher, and Dragomir Radev. 2019b. SParC: Cross-domain semantic parsing in context. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4511–4523, Florence, Italy. Association for Computational Linguistics.
Bing Wang, Yan Gao, Zhoujun Li, and Jian-Guang Lou. 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, pages 5701–5714, Toronto, Canada. Association for Computational Linguistics.
Tong Zhang, Peixin Qin, Yang Deng, Chen Huang, Wenqiang Lei, Junhong Liu, Dingnan Jin, Hongru Liang, and Tat-Seng Chua. 2024. CLAMBER: A benchmark of identifying and clarifying ambiguous information needs in large language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 10746–10766, Bangkok, Thailand. Association for Computational Linguistics.
Jingjing Xu, Yuechen Wang, Duyu Tang, Nan Duan, Pengcheng Yang, Qi Zeng, Ming Zhou, and Xu Sun. 2019. Asking clarification questions in knowledgebased question answering. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 1618–1629, Hong Kong, China. Association for Computational Linguistics.
Ruiqi Zhong, Tao Yu, and Dan Klein. 2020. Semantic evaluation for text-to-SQL with distilled test suites. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 396–411, Online. Association for Computational Linguistics.
Ziyu Yao, Yu Su, Huan Sun, and Wen-tau Yih. 2019. Model-based interactive semantic parsing: A unified framework and a text-to-SQL case study. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 5447–5458, Hong Kong, China. Association for Computational Linguistics.
A
Certificate Proofs
A.1
Four-Cell Identity
Let n = 2m surviving worlds have P positive Boolean answers. There are T = P (n − P ) edges between opposite labels. For a coordinate q, let p0 , p1 be the positive counts in its two halves. The number of edges within the halves is
Youbing Yin, Xujun Peng, Muhammad Sharif Uddin, Erin Babinsky, Daben Liu, and Anoop Kumar. 2026. Probing ambiguity: Adversarial intent resolution for robust text-to-SQL. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 55493–55504, Budapest, Hungary. Association for Computational Linguistics.
Wq = p0 (m − p0 ) + p1 (m − p1 ).
Tao Yu, Rui Zhang, Heyang Er, Suyi Li, Eric Xue, Bo Pang, Xi Victoria Lin, Yi Chern Tan, Tianze Shi, Zihan Li, Youxuan Jiang, Michihiro Yasunaga, Sungrok Shim, Tao Chen, Alexander Fabbri, Zifan Li, Luyao Chen, Yuwen Zhang, Shreya Dixit, and 5 others. 2019a. CoSQL: A conversational text-toSQL challenge towards cross-domain natural language interfaces to databases. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 1962–1979, Hong Kong, China. Association for Computational Linguistics.
(9)
A cross-half edge is cut under either response. A within-half edge is cut with probability 1/2. Each edge has weight 1/n2 , giving n2 G(q) = T −Wq /2. Since p0 + p1 = P , the only term in the gain that depends on the split is (p20 + p21 )/2. For q the two counts are a+b, c+d, and for r they are a+c, b+d. Subtracting the gains gives n2 (G(q) − G(r)) = 21 (a + b)2 + (c + d)2 − (a + c)2 − (b + d)2 = (a − d)(b − c).
Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, Zilin Zhang, and Dragomir Radev. 2018. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-SQL task. In Proceedings of the 2018
Attainable Bounds. The observed positives in a cell give its smallest possible final count. Assigning every unknown label in that cell to one gives its largest count. Both extremes of a − d are therefore 11
attainable, independently of either extreme of b − c. The minimum and maximum of their product occur at corners of this rectangle, and every corner is realized by a completion. A question with a nonnegative lower bound against every competitor maximizes gain under every completion. A.2
Strategy
Questions
38.46 100.00 100.00 100.00 100.00 100.00 100.00 98.98 98.88 100.00 100.00
0.0000 4.0000 2.1850 2.4900 2.1850 1.8079 1.8079 1.7058 2.0246 2.9354 1.8067
No clarification Ask all Fixed order Random order World entropy Answer entropy EC2 Local check Observed then repair Repair first Exact optimal
Partition Relaxation
The partition bound accommodates any number of answer classes. Let duv = cq (u, v) − cr (u, v). A pair of known answers contributes duv xuv to the unnormalized gain difference. A pair of unknown answers contributes at least min(0, duv ). For an unknown world u, group its known P neighbors by their answers s. Write gu,s = v:A(v)=s duv for the sum P over known neighbors in class s, and Tu = s gu,s . The contribution from all known neighbors of u is at least ℓu = min {Tu } ∪ {Tu − gu,s : s known} . (10)
Table 5: Question selection on Sales Dev.
B
Complete SQL Answers
The 300 development tasks use complete SQL results, including counts and sets of leading regions. Table 5 compares selectors with access to the full answer map. Each simulated user responds according to one of the supplied worlds. We measure how often a selector returns the correct result and how many questions it asks. The anchor policy answers immediately, and askall resolves every coordinate. Fixed and random orders stop as soon as all surviving answers agree. World entropy and answer entropy choose the coordinate with the largest expected reduction in their respective uncertainties. EC2 chooses the largest expected reduction in edge weight between different answer classes. A local check probes changes to one coordinate at the anchor. Observed-then-repair merges queries on the observed data. Repair-first asks about all repairs first. An exact decision tree gives the minimum mean question count of 1.8067. Answer entropy and EC2 both average 1.8079 questions with correct answers throughout. The local check asks fewer questions (1.7058) and gives a correct answer in 98.98% of episodes. Resolving all repairs before intent costs 2.9354 questions on average.
If u has a new answer, every known class contributes. If it belongs to a known class s, only the edges to that class drop out. The bound enforces this choice for each unknown world separately. The individual minima can correspond to incompatible assignments across worlds, which makes the partition bound a relaxation. A.3
Correct (%)
Policy Termination
Each execution reveals a new answer and each question fixes a new coordinate. On a fully executed nonconstant cube, a path between two different answers must contain neighbors with different answers, so at least one coordinate is locally relevant. An irrelevant coordinate has identical positive counts in its two halves, which minimizes EC2 gain. If its gain is maximal, all gains tie and a relevant coordinate also attains the maximum. Thus both policies can ask a witnessed question on a fully known nonconstant cube. They terminate by returning the common answer once the answer certificate holds. To see why an irrelevant coordinate has minimum gain, observe that each positive world on one side has a positive partner on the other. This gives p0 = p1 = P/2, which minimizes p20 + p21 for fixed P . On a constant map the policy has no admissible question. Until every world is known, changing one unseen label remains consistent with the observations. The worst case therefore requires |H| executions.
C
Policy Diagnostics
Table 6 counts decisions across 1,920 sales episodes and 768 stress episodes per configuration. Wrong counts incorrect answers and No cert. counts returns before the surviving answers were known to agree. Irr.Q counts questions for which the full answer map contains no local witness. Unpr.Q counts questions for which the policy had yet to observe a witness. The anchor policy asks zero questions. Full EC2 asks 256 irrelevant questions on Boolean Stress. Figure 6 gives failure rates by Boolean function. 12
Sales Test Configuration
Boolean Stress
Wrong Irr.Q Unpr.Q No cert. Wrong Irr.Q Unpr.Q No cert.
Anchor answer Ungated ask-all Full EC2 Full relevant EC2 Exact / fixed Exact / witness Partition / fixed Partition / witness Immediate / fixed Immediate / witness
580 n/a 0 6076 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
n/a 7680 0 0 0 0 0 0 0 0
1920 0 0 0 0 0 0 0 0 0
268 n/a 0 1776 0 256 0 0 0 0 0 0 0 0 0 0 0 0 0 0
n/a 3072 256 0 0 0 0 0 0 0
768 0 0 0 0 0 0 0 0 0
Table 6: Answer and question violations by policy. (a) Wrong answers (%)
(b) Irrelevant questions (%)
Anchor answer
0
50
50
6
66
38
–
–
–
–
–
–
Ungated ask-all
0
0
0
0
0
0
100
75
50
53
25
44
Full EC2
0
0
0
0
0
0
–
0
50
0
0
0
Full relevant EC2
0
0
0
0
0
0
–
0
0
0
0
0
Exact / fixed
0
0
0
0
0
0
–
0
0
0
0
0
Exact / witness
0
0
0
0
0
0
–
0
0
0
0
0
Partition / fixed
0
0
0
0
0
0
–
0
0
0
0
0
Partition / witness
0
0
0
0
0
0
–
0
0
0
0
0
Immediate / fixed
0
0
0
0
0
0
–
0
0
0
0
0
Immediate / witness
0
0
0
0
0
0
–
0
0
0
0
0
XOR
AND
Thr.
Branch
XOR
AND
Thr.
Branch
100
50
Const. Single
Const. Single
Rate (%)
75
25
0
Figure 6: Answer and question relevance failures on six Boolean functions. Question rates are undefined for policies that ask no questions.
C.1
White cells indicate zero violations, and gray cells mark undefined rates. On the nuisance XOR fixture, a fixed tie order can favor an irrelevant coordinate even after the full answer map is known. A local witness distinguishes an input to XOR from a nuisance coordinate with the same EC2 gain. On the development tasks, we also tested two looser criteria. Bounding each pair of worlds independently required 15.3913 executions per episode to reproduce the full EC2 question sequence. Grouping known answers by class reduced this to 14.9000 with the same sequence. A separate heuristic counted unknown worlds and pairs with different answers to guide executions and questions. It allowed a question whenever two worlds with different answers gave different responses to it. If the worlds differ on two coordinates, either may explain the answer change.
Policy Costs
Choosing the next execution by its known neighbors adds computation with little change in executions (Figure 7). Under the exact bound, switching from fixed to witness order changes the mean from 13.8021 to 13.8135 and increases decision time from 0.200 to 0.582 milliseconds. With the partition bound, the corresponding means are 14.8771 and 14.9000 executions, with decision times of 0.526 and 0.974 milliseconds. Both immediate policies use 13.1833 executions. Searching the neighbors increases their decision time from 0.168 to 0.516 milliseconds. These timings cover the policy and its lookup of cached answers. Question Cost. In units where one execution costs one and one question costs c, the mean cost of exact selection minus that of immediate selection is 0.61875 − 0.025c under fixed order. At c = 10, Table 2 gives mean costs of 21.91 for exact
13
Questions, Q
(b) User questions
15 10 5 0
Region
Customers
Threshold
C10 = E + 10Q
(c) Weighted total cost 24 16 8 0
Region
Customers
Threshold
Full relevant EC2
1.2 0.8 0.4 0.0
Pooled
Time per episode (ms)
Executed worlds, E
(a) Execution cost
Pooled Exact bound
Region
Customers
Pooled
(d) Policy computation 1.2 0.8 0.4 0.0
Region
Customers
Partition bound
Fixed acquisition
Threshold
Threshold
Pooled
Immediate witness
Witness acquisition
Figure 7: Executions, questions, weighted cost, and policy computation by query family. Error bars show 95% intervals from resampling seeds.
and 21.54 for immediate selection. The two are equal at c = 24.75. At higher weights, the reduction in questions favors exact selection. Figure 4 reweights the same recorded actions for each value of c. Within each bootstrap sample we center the costs on the cheapest displayed policy. C.2
case selection. The right panel orders databases by the fraction of eligible swaps that separate the reference queries. Figure 11 shows reference recall and its change under pruning in the 20 sampled databases. Each value averages over the questions sampled from that database. The signatures used for scoring contain two outputs. Different SQL programs can still produce the same signature if their answers agree on both tested states. Figure 9 compares recall, precision, and full recovery by reference set size. Table 7 reports perquestion candidate and token counts. Median call times were 32.00 seconds for Doubao Lite and 5.02 seconds for GPT Sol.
Score Aggregation
For bounded integer scores, forward messages count how many assignments attain each score (Todor et al., 2013). A reverse pass recovers the contributions of individual variables using differential inference (Darwiche, 2003). Figure 8 compares the resulting score histograms with enumeration through 16 repair variables, the largest enumerated setting. The histograms agree throughout this range. The computation is pseudo-polynomial in score range. Across three seeds it covers 2257 worlds in 0.55 to 0.59 seconds at 256 repairs.
D
E
Evaluation Protocols
Tasks And Seeds. The sales generator uses seeds 0 to 99 for development and 10000 to 10039 for the policy comparison. Stress seeds 20000 to 20007 each give six fixtures. We weight all 16 hidden worlds equally. Across 120 sales tasks, 48 stress fixtures, and ten configurations, the evaluation contains 26,880 episodes. The paired bootstrap uses seed 20261029 and 2,000 resamples. We resample seeds for the sales comparisons and databases for the model comparisons.
AmbiQT Audit Details
To execute the AmbiQT queries, we reconstruct synonym columns from the published mapping. We preserve SQLite’s case-insensitive identifiers and compare text containing invalid UTF-8 as bytes. We record execution failures separately from valid empty answers. For eligible cases we choose two rows with distinct non-null values in the second synonym column and exchange those values. The left panel of Figure 10 shows successive stages of
Policy Accounting. Each previously unseen answer costs one execution, so a full map costs 16. 14
(a) Root inference time
1060
10−1
Count
Runtime (s)
(b) Declared score family
1080
100
10−2
1040 1020
10−3 8
16
32
64
128
100
256
8
16
Repair variables
32
64
128
256
Repair variables
Compiled messages Explicit enumeration
Materialized states Implicit worlds
Figure 8: Runtime and state counts for score aggregation. Timing curves show the median and observed range over three seeds per setting. Model Doubao Lite GPT Sol
Outcomes
Valid SQL (%)
Generated
Kept: obs./two
Tokens
t50 (s)
t90 (s)
155 155
97.98 98.57
3.51 2.71
1.99 / 2.24 1.47 / 1.76
2001 575
32.00 5.02
48.66 11.11
Table 7: Candidate-generation resources and SQL validity, reported once per model.
The evaluator checks returns and question relevance against the complete map. It checks certificates against the answers the policy knew at the time of each decision. Question violation rates divide by the number asked and are undefined when a policy asks none. Cost curves reweight the same recorded actions. Timings cover one pass of the Python decision logic and answer lookup. SQLite map construction and auditing occur outside that pass.
as executable if it runs successfully on both the original and modified databases. Input And Output. Each request contains the schema and the ambiguous question. The model supplies one to four interpretations in JSON, each with a short meaning and a SQLite query. The completion budget is 4,096 tokens. Reference queries and table rows are withheld. Appendix G gives the prompt and mismatch coding rules. We rank each database’s items by a SHA256 hash of seed and item ID and keep up to eight distinct questions.
Candidate Counts. Most generated queries execute on both database states (97.98% for Doubao Lite and 98.57% for GPT Sol). The models generate 3.51 and 2.71 queries per question on average. Two-state pruning retains 2.24 and 1.76 distinct candidates per question, compared with 1.99 and 1.47 under observed-state pruning (Table 7). Even after preserving these differences, both models recover fewer than 70% of the reference signatures. Changing how candidates are grouped can recover only answers present among the generated queries.
Scoring Rules. We run each query in read-only mode on both states, with a four-second execution deadline and a limit of 10,000 result rows. Both executions must succeed for the query to enter the comparison. For observed-state pruning we keep the first valid query for each distinct observed output, in generation order. Two-state pruning keeps one representative for each distinct pair of outputs. Let R be the set of reference pairs and S the retained pairs. Recall is |R ∩ S|/|R|, precision is |R ∩ S|/|S| (zero for an empty S), and full recovery is the indicator of R ⊆ S. We average each metric over questions. In the paired bootstrap, a sampled database contributes all of its questions to both pruning rules.
Model Generation. The API identifiers were doubao-seed-2-0-lite-260428 and gpt-5.6-sol-2026-07-09. Each model produced 155 outputs. The providers reported 310,128 and 89,063 tokens, respectively. We measure elapsed time per generation call and count malformed or truncated outputs as failures on the original request. A generated query counts
Replication Details. The repositories record the evaluation protocols, exclusions, request signatures, and analysis scripts. Tables and statistical plots use 15
Doubao Lite Score (%)
(a) Recall 100
(b) Precision
+25.5 pp
+50.9 pp
75 50 25
0
0
All
Two sig.
One sig.
All
(d) Recall GPT Sol Score (%)
(c) Full recovery
100
Two sig.
One sig.
All
(e) Precision
Two sig.
One sig.
(f) Full recovery
+29.2 pp
+58.5 pp
75 50 25
0
0 All n = 155
Two sig. n = 53
One sig. n = 102
All n = 155
Two sig. n = 53
One sig. n = 102
Observed-state pruning
All n = 155
Two sig. n = 53
One sig. n = 102
Two-state pruning
Figure 9: Reference recovery by pruning rule. Bars show 95% database bootstrap intervals. (b) Database variation
All items
1,240
Eligible swaps
1,206
Equal → different (%)
(a) Audit denominators
424
Changed equality 20
Query errors
No eligible swap 14 0
400
800
100 75 50 25 0
1200
Items (nested counts)
1
5
10
15
20
Database rank (ordered by effect) Eligible cases 3 52 148
Figure 10: Cases eligible for the AmbiQT value swap and cases where it separates the reference queries. Marker area gives the number of eligible cases per database.
the saved measurements.
Interpretation
r0
r50
F
Worked Examples
F.1
Revenue Clarification Trace
All orders Completed orders
100 100
150 100
Table 8: Revenue in dollars when order O-103 has amount 0 or 50. Each column fixes a possible repair.
Table 8 lists the four worlds in Figure 1. Suppose the assistant first executes the all-orders query with the pending amount set to zero, then executes it with the amount set to 50. The answers differ only because of the amount. The immediate policy can now ask about the missing value. If the response is zero, only the first column survives. Executing the completed-orders query in that column gives 100. Both surviving answers are now known, so the policy returns 100 after three executions and one question. If the response is 50, executing the completed-orders query gives 100
alongside the known answer of 150. These two worlds witness the intent question. Either response selects a world whose answer is already known. Across this branch the user answers twice and the assistant executes three worlds. F.2
Partial Boolean Map
Consider the Boolean question of whether revenue exceeds 100 in Table 8. Encode intent q as com16
(a) Doubao Lite
(b) GPT Sol
battle_death (8) car_1 (8) concert_singer (8) course_teach (8) cre_Doc_Template_Mgt (8) dog_kennels (8) employee_hire_evaluation (8) flight_2 (8) museum_visit (8) network_1 (8) orchestra (8) pets_1 (8) poker_player (8) real_estate_properties (3) singer (8) student_transcripts_tracking (8) tvshow (8) voter_1 (8) world_1 (8) wta_1 (8)
0
25
50
75
100
Reference recall (%)
0
25
50
75
100
Reference recall (%)
Observed-state pruning
Two-state pruning
Figure 11: Reference recall by database and pruning rule. Parentheses give the number of sampled questions.
pleted orders (0) or all orders (1), and repair r as amount 0 or 50. For illustration, suppose the labels for (q, r) = 00, 01, 11 are known to be 0, 0, 1. The label at 10 is still unknown. The worlds 01 and 11 give a relevance witness for q. In the four-cell bound, a = b = 0, d = 1, and c ∈ {0, 1}. Hence 16(G(q) − G(r)) = c. If the missing label is zero, the gains tie. If it is one, q has strictly higher gain. Both completions certify the intent question from three executions.
kept one reference signature, while two-state pruning kept both. Doubao Lite generated four executable queries. Two selected titles directly from the singer table. The other two joined singer_in_concert, adding a performance requirement absent from the question. The four queries produced three two-state signatures, of which two matched the references. Its recall rose from 1/2 to 2/2 and its precision from 1/2 to 2/3. The extra signature lowers precision.
F.3
G
Candidate Audit Materials
G.1
SQL Candidate Prompt
Song Title Query
AmbiQT Candidates includes a question about songs by singers above the average age (column-synonym validation index 16 in concert_singer). The first reference query is
Both models received the same single user message. Bracketed fields below stand for the schema without table contents and the question as written in AmbiQT.
SELECT track_name FROM singer WHERE age > (SELECT AVG(age) FROM singer)
Translate an ambiguous question into the distinct plausible SQLite SELECT queries it can mean. Use the schema exactly. Return JSON only: {"interpretations":[{"meaning":"short explanation", "sql":"SELECT ..."}]}. Include up to four genuinely different plausible readings; do not invent columns or irrelevant interpretations. No data modification. The schema may contain columns with overlapping names. Schema: [schema] Question: [question]
The second reference query selects composition_name with the same predicate. The columns initially give the same list. Swapping two composition_name entries changes only the second result. GPT Sol generated two executable queries for this question. Pruning on the original database
17
For the case in Appendix F.3, the question was List all song names by singers above the average age. GPT Sol supplied two interpretations. The first named tracks, the second compositions. Both SQL queries used the same age predicate. The evaluator executed the sql field of each entry in response order. The meaning field played no part in scoring. Both pruning rules thus received the same candidate queries. G.2
Mismatch Coding Rules
The unit in Table 4 is one candidate occurrence before pruning. Two candidates with the same output pair remain separate occurrences. For each sampled candidate, the annotation packet contained the question, the candidate SQL and both reference queries. It withheld model identity, response position, and the model’s explanation. The annotator compared the candidate with the closer reference. A different returned field or column order counted as projection. A join that changed the population counted as relation, even if its effect was to exclude rows. A change to a selection predicate counted as filter. Grouping, counting units, and duplicate handling fell under aggregation. Ordering and ties counted as ranking when they affected which rows were selected. The protocol reserved other for a specific discrepancy outside these categories and unresolved for cases without a defensible label. A candidate that returned both synonym columns when each reference returned just one received a single projection label. In another case, a candidate joined documents through either of two template keys and selected three tied templates where each reference selected one. It received both relation and ranking labels. One candidate can therefore contribute to several category counts.
18
Related documents
- AskWise: Execution-Guided Clarification of Intent and Data in Text-to-SQL#1749901
- ABISS: Evaluating Text-to-SQL Systems Through Agent Interaction#411162
- SQL-o1: Automatic Text-to-SQL Program Synthesis via Self-Reward Heuristic Search#1586637
- Prompt as a Data Type: In-Database LLM Prompt Management and Rewriting#411179
- Toward Multi-Database Query Reasoning for Text2Cypher#175357
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