Text-to-SQL Models Settle Calculation Choices Silently
The gap in text-to-SQL sits in reporting, not computing: models can usually produce each interpretation of an open request but hand back one without saying which, and single-reference benchmarks are structurally blind to it.
On this page
A team holds 200 text-to-SQL answers that all ran without error, yet the arithmetic behind them may still be wrong. The usual advice is that a query which executes and returns a plausible number is safe to hand to the business. This paper shows what that advice misses: a request like 'average rental price per day' supports two clean readings, one averaging each film's daily price and one dividing two averages, and the model quietly picks one without telling anyone which [1]. Nothing throws an error. The number is simply a different number than the analyst pictured.
Three requests that differ by exactly one choice
The paper calls its unit a request set: one database, every requirement of a query fixed except a single calculation choice. Each set holds three requests. Specific A names the first reading, specific B names the second, and the open request names neither while sharing all remaining wording with A and B. All three use the same prompt, which asks the model to state any assumption the request leaves unsettled and to supply SQL for the other interpretations. Scoring runs the SQL; a judge model scores the explanation. Because only the choice varies, failures split cleanly: a wrong answer to a specific request is a failure to compute, a missing interpretation on the open request that the same model produces when asked directly is a failure to report, and raising the choice on a specific request is a false alarm.
The running example uses Spider's sakila database and asks for the average rental price per day for each film rating. Reading A averages each film's own daily price; reading B divides the average price by the average rental duration. Two films both cost 6 dollars, rented for 2 and 6 days: A gives (3+1)/2 = 2.00 dollars and B gives 6/4 = 1.50 dollars. Both are plain SQL, and on sakila_1 the two differ for every rating.
| Request | What the wording asks for | Accepted SQL | Result on two films |
|---|---|---|---|
| Specific A | Average each film's daily price, then average by rating | AVG(price/days) | 2.00 dollars |
| Specific B | Average price divided by average duration | AVG(price)/AVG(days) | 1.50 dollars |
| Open | Average rental price per day | Both accepted | Model returns one |
Queries are generated on unmodified benchmark databases rather than lifted from benchmark questions. Generation starts from counts, sums or per-entity averages, then stacks comparisons, shares, re-aggregation or top-k per group. Two knobs control arithmetic depth and step depth; column-type rules decide which quantities can be combined, and data checks reject empty answers, constants, non-positive denominators and groups that are too small. Code then writes an exact description of each query covering source rows, joins, unmatched rows, filters, groups, formulas, missing values, ordering, limits, ties and SQLite conventions. Of 307 sets that passed automated checks, two authors reviewed without seeing model results and kept 232, of which results use 204.
The choices themselves are mined from benchmark failures. When a model fails the original BIRD or Spider question but succeeds on the exact description of the reference SQL, the wording was to blame. Failures are classified as output columns, a different column or value, an unstated requirement, numerical precision, or an open choice. For the last class, the alternative reading is written as an edit to the reference SQL and both queries are executed; two reviewer models judge each reading independently and disagreements are kept. The choice types that ship are ties, counting units, missing values and aggregation level.
Models can compute both readings but volunteer one
Four models are tested: Claude Haiku 4.5, Claude Sonnet 5.5, GPT-6 Sol and GPT-6 Luna. Across the 204 sets they mostly compute what a specific request asks for, and they almost never raise a choice that the wording already settles. On the open request, however, they return both interpretations in only 15-58% of the sets where they can compute them, and they name the choice at all in only 38-70% of sets.
The decisive number is this one: in 72-94% of the sets where a model misses an interpretation, the same model computes it correctly when asked for it alone. The failure distribution is not 'cannot compute' but 'computed and did not hand it over'. That distinction decides which remedies are available. If the gap were computational, only a stronger model would help; because it is a reporting gap, engineering can narrow it.
- Cannot compute: the model gets a specific request wrong and cannot write that SQL at all.
- Does not report: the open request returns one reading, while the same model answers the other correctly when asked directly.
- False alarm: the wording already settles the choice and the model raises it anyway; this barely occurs across the four models.
Benchmarks score one convention as the answer
Every Spider and BIRD question carries a single reference SQL. A model that guesses the author's reading scores exactly as well as one that honestly reports both. The benchmarks do not even agree with themselves: BIRD's and Spider's own authors return one row when several tie, yet questions Spider imported from two older datasets usually return all tied rows. Whether a model is marked right can depend on which dataset a question originally came from.
On BIRD, 156 development questions, one in ten of the whole set, change their answer under the other interpretation. On 79 of them both readings are valid, and accepting both lifts the four models' accuracy from 25% to 57%. Among answers the benchmark marks wrong, more than two in five are correct under the alternative reading. The paper's extreme case is the 2014 public-debt controversy: the same data, averaged within each country and then across countries, gave high-debt countries -0.1% growth per year; weighting each year equally gives 2.2%.
| Comparison dimension | AmbiQT | AMBROSIA | SpecBridge |
|---|---|---|---|
| Where choices live | Schema (synonyms, split columns) | Wording (scope, attachment, vagueness) | Calculation (ties, counting units, missing values, aggregation level) |
| Uses unmodified benchmark databases | No | No | Yes |
| Scores the explanation | No | No | Yes |
| Separates computing from reporting | No | Possible | Yes |
| Penalizes raising a settled choice | No | Yes | Yes |
That table explains why the existing ambiguity benchmarks are not enough: they manufacture choices inside schemas and wording, while the calculation choices that recur in real questions are settled silently by whoever wrote the reference SQL [1].
Decide first, then answer each reading in its own call
The method is called Decide-then-answer and runs in two phases. Phase 1 first decides whether a request leaves a choice open, then answers each interpretation of an open request in its own call. Phase 2 keeps the original request and appends the user's pick as a single clause. On the authors' request sets and on AMBROSIA, this raises the share of open requests that receive every interpretation by 29-63 points over the single answer that production assistants give, without lowering precision on clear requests. In a simulated conversation it needs 35.0-40.8 fewer user turns per 100 requests than asking a clarifying question.
Phase 2 targets a practical annoyance: after the user picks a reading, today's systems rewrite the request, and the rewrite often drops the choice, changes a formula or loses an output column. Keeping the request and adding one clause computes 8.5-10.5 points more interpretations correctly than rewriting approaches such as LangChain and DtP. Production assistants currently stop instead: Snowflake's Cortex Analyst rejects questions its classifier flags as ambiguous, Databricks' Genie asks a clarifying question, and Microsoft's Fabric data agent defers to instructions its authors write. By the paper's accounting, none of them meets the reporting requirement by default.
When this method does not apply
The direction of the finding is solid: across 204 sets, four models consistently compute more than they report. The measurement, however, has clear edges, and the numbers should be used inside them.
- It covers calculation choices only: ties, counting units, missing values, aggregation level. Schema synonymy and wording scope, the territory of AmbiQT and AMBROSIA, are not tested here.
- The choice library is mined from BIRD and Spider failures, so it inherits those benchmarks' question styles and author conventions. In a warehouse where reporting definitions are fixed by policy, which choices count as open has to be decided again.
- The scale is 204 hand-reviewed sets, four models, one snapshot. It exposes a mechanism rather than estimating an industry average.
- Explanation quality is scored by a judge model, which carries its own error. The paper has two reviewers judge independently and keeps disagreements, which reduces missed detections but does not remove them.
- Phase 1 depends on a classifier deciding whether a request is open; when it errs, the system degrades to a single answer. On regulated reports that demand one definition, volunteering several readings is itself wrong.
- It does not apply when the request legally admits only one interpretation, nor to databases where a model cannot compute even a single reading: there the gap really is computational and a stronger model is the answer.
