Conceptio › Archive › arXiv CS
arXiv CS open access

Mind the Trap As LLMs Guess the Data Model: Grain-Aware Guards Against Fan-out in Text-to-SQL and Its Benchmarks

Ahmed M. Mahran · arxiv_cs
arXiv CS · Papers
Open Source ↗Direct PDF ↓
data-managementdatabasessqlstorage
Text-to-SQL systems built on large language models (LLMs) often aggregate over one-to-many and many-to-many joins, a classic trap: when the joined rows repeat an entity, a SUM or COUNT counts it more than once, yet the query runs and returns a plausible number. We characterize these fan-out errors b
Conceptio Open Archive

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.

Mind the Trap As LLMs Guess the Data Model: Grain-Aware Guards Against Fan-out in Text-to-SQL and Its Benchmarks Ahmed M. Mahran

arXiv:2611.29009v1 [cs.DB] 21 Nov 2026

Incorta Egypt ahmahran@gmail.com ahmed.mahran@incorta.com

ABSTRACT

“What is the total shipping fee of orders that contain a toy?”

Text-to-SQL systems built on large language models (LLMs) often aggregate over one-to-many and many-to-many joins, a classic trap: when the joined rows repeat an entity, a SUM or COUNT counts it more than once, yet the query runs and returns a plausible number. We characterize these fan-out errors by one condition on the relation an aggregate reads, which depends on two facts a schema does not show: each measure’s grain, and how many rows a join on each key repeats. An audit that tests the condition on the data finds distorted gold answers for 4.2% of the dev questions of BIRD, a widely used benchmark, and BIRD’s later, independent revision changed 44% of the answers the audit flags as definite fan-out, against 16% of unflagged ones. We release BIRD-FanOut, 486 BIRD questions with reviewed gold, and GrainTraps, synthetic questions that set this trap and related ones. Across eight LLM agents, functional dependencies (FDs) computed from the data help no more than per-column statistics on GrainTraps, but grain-aware FDs, which also state each measure’s grain and the repetition per key, cut fan-out errors on BIRD from 18.4% of runs to about 13%, also on held-out questions and without LLM judges. Accuracy rises less, because most remaining errors are not fan-out and BIRD’s hints often prescribe the over-count. Text-to-SQL models should be given the grain of the data, and benchmark gold should be audited on the data. Code, data and benchmarks are available at https://github.com/ ahmed-mahran/misqal

orders

1

INTRODUCTION

An analyst asks a text-to-SQL assistant for “the total shipping fee of orders that contain a toy”. The natural query joins the orders to their lines, keeps the toy lines and sums the fee (Figure 1). It runs and returns a plausible number, but it is wrong. The fee is stored once per order, the join repeats it once per toy line, and an order with two toy lines is charged twice. The error comes from an assumption about the data that the query never checked, namely that each order appears once in the rows being summed. This is one instance of a broad class of errors we call fan-out errors. When a query aggregates rows in which an entity repeats, a duplicate-sensitive aggregate (COUNT, SUM, AVG, or ORDER BY . . . LIMIT) sees that entity several times. Fan-out errors are the main kind of grain error, an aggregate computed at a grain other than the question’s; the other kind groups or ranks at the wrong grain without any repetition (§2.1). The repetition has several sources: joins on non-unique keys (the classic fan and chasm traps), denormalized tables that repeat order-level values on every order line, and many-to-many mappings. Data warehousing guards against

order

1 2 3

fee

orders ⋈ toy lines

10 5 8

order line

1 1 3

order_lines line order

a b c d

1 1 2 3

item

toy toy book toy

a b d

fee

10 10 8

SUM(fee) = 28

order 1’s fee repeats once per toy line

true total = 18

Figure 1: A fan trap. The question needs the order lines to pick the orders, but the fee is stored once per order; the join repeats it once per toy line, so the sum counts order 1’s fee twice (28 instead of 10 + 8 = 18).

them by declaring the grain of each fact table, that is, what one row stands for (an order, an order line) [34]; semantic layers declare join cardinalities [12, 18, 23], but these cannot describe dependencies inside a single wide table. A text-to-SQL model over a raw database has neither; it sees table and column names and must guess, or check, the data model behind them. Fan-out is hard to see, for models and for evaluation. A fan-out error raises no exception and usually returns a plausible number. Evaluation rarely catches it. BIRD [40], a widely used text-to-SQL benchmark of 12,751 questions over 95 real databases, scores answers by set-based execution accuracy (EX), which ignores duplicate result rows and so hides 5.8–6.8 points of multiplicity errors on its dev set [66]. An over-count that changes an aggregate’s value does fail EX, but only against a correct gold, and BIRD’s gold answers themselves contain fan-out; 4.2% of dev questions are distorted, and the cleaned release still has definite fan-out flags (§4). Systems that give the model cardinality information report small effects (removing it costs MCI-SQL 0.5 EX points [60] and SQLfuse 2 points [64]), but these are measured by EX, not by fan-out errors. This paper. A text-to-SQL model needs two facts that a schema does not show, each measure’s grain and how many rows a join on each key repeats, and both can be computed from the data. We ask three questions. How much fan-out is in BIRD’s gold, and can an audit that tests on the data find it? When do current LLMs make fan-out errors? And does evidence computed from the data help them avoid these errors, in particular evidence that states each measure’s grain and how many rows a join on each key repeats? Each model runs as an agent that queries the database through a SQL tool and then submits one final query. We compare seven

arms, conditions that differ only in the evidence the model receives. Figure 2 maps the study. Contributions and findings. The paper makes four contributions, each with its main finding:

with a trap usually has a trap query, the natural SQL that falls into it. • Fan. A parent’s measure repeats once per child row, whether a join brings in the children or a denormalized table already holds them: an order’s shipping fee counts once per line (Figure 1). • Chasm. Two independent children of one parent are joined through it and multiply each other: each order line of a product repeats once per inventory lot, and each lot once per line. • Many-to-many mapping. A bridge repeats a measure once per partner: a product’s price counts once per tag. • Rank-then-attach. A top-N ranked inside a finer grouping than the question’s ranks the wrong things: asked for the top five products and their sales per customer, the query returns the five largest product–customer pairs. • Projection join. A column that the grouping key does not determine splits or repeats rows: a region’s revenue repeats once per target row of the region. • NULL split. A blank forms its own group and splits an entity: a product whose category is missing on some rows appears in two groups.

1. A grain condition for aggregates (§2.2). A duplicatesensitive aggregate is correct when each entity at its measure’s grain appears once in the relation it reads, and its error is the measure weighted by each entity’s surplus multiplicity. This is a query-level form of OLAP summarizability [39] that applies to the relation any SQL aggregate reads and can be checked on the data. It names the two facts a model must know, the measure’s grain and the multiplicity the joins induce, and reads the fan, chasm and many-tomany traps as normal-form violations. 2. A fan-out audit and BIRD-FanOut (§4). The audit tests on the data, under each query’s own filters, whether the rows an aggregate reads repeat. Fan-out distorts 4.2% of BIRD’s dev gold, 6.2% of train golds have a definite flag, and BIRD’s independent revision changed 44% of the gold answers the audit flags as definite fan-out, against 16% of unflagged ones. BIRD-FanOut has 486 BIRD questions whose gold was labelled, corrected and reviewed by LLM judges. Run on model answers, the audit flags most overcounts and few correct answers, but cannot tell whether a question meant to count the repeats (§6.7). 3. GrainTraps (§5.1), a synthetic suite separate from BIRDFanOut: 59 questions on three generated databases that isolate six traps, in explicit and vague wordings. Without evidence, every model makes grain errors on it, in 2% to 42% of runs. The models that check the data before answering make the fewest, but telling a model to check makes it check more without reducing its errors (§6.1). 4. A controlled study of data-derived evidence (§5.2, §6): eight LLMs, seven arms and 38,232 agent runs. On GrainTraps, FD labels such as “can have many” do no better than per-column statistics. Grain-aware FDs, which state each measure’s grain, how many rows a join on each key repeats and where a blank breaks a dependency, cut fan-out errors on BIRD train from 18.4% of runs without evidence, and 17.0% with statistics, to 13.1–13.6%, and the cut holds on 183 held-out questions; the repetition counts alone give about half of this cut. Accuracy rises only about 3 points, because BIRD’s hints often prescribe the distorted formula and small over-counts barely show in the data (§6.4).

An answer that falls into a trap makes a grain error: it aggregates at a grain other than the question’s. Grain errors are of two kinds: • fan-out errors: rows repeat an entity, as in fan, chasm, manyto-many and projection-join traps and in denormalized tables (the fan trap is the simplest way a join fans rows out); • grouping errors: the grain is wrong but no row repeats, as in rank-then-attach and NULL splits. The trap query makes its question’s grain error by construction, so an answer whose result equals the trap query’s makes that error; we call such an error exact. An answer that also makes another mistake returns a different result, so §5.1 also counts grain errors that the audit finds, and §6 those an LLM judge finds.

2.2

When is an aggregate correct?

Let a query scope aggregate a measure 𝑚 over the relation 𝑄 = 𝜎𝜑 (𝑅1 ⊲⊳ · · · ⊲⊳ 𝑅𝑘 ) under bag semantics (within each group, if the scope groups), where 𝑚 is a column of some 𝑅𝑖 with grain 𝐺: the functional dependency 𝐺 → 𝑚 holds in 𝑅𝑖 , and the question asks for one value of 𝑚 per 𝐺-value. Because every FD of an input holds in a selection and in an equi-join, 𝐺 → 𝑚 also holds in 𝑄. Let 𝐸 be the set of 𝐺-values in 𝑄, and let the multiplicity 𝜇 (𝑔) be the number of tuples of 𝑄 with 𝐺 = 𝑔. In words, a duplicate-sensitive aggregate over 𝑄 weights each entity by its multiplicity:

2 BACKGROUND 2.1 Grain errors and their traps

Proposition 2.1 (Grain condition). SUM𝑄 (𝑚) = 𝜇 (𝑔) 𝑚(𝑔) over the 𝑔 with non-NULL 𝑚(𝑔), so it differs 𝑔∈𝐸 Í from the sum over entities by 𝑔 (𝜇 (𝑔) − 1) 𝑚(𝑔), and COUNT𝑄 (𝑚) differs from the number of entities with a non-NULL 𝑚 by Í 𝑔: 𝑚 (𝑔)≠NULL (𝜇 (𝑔) − 1). Hence SUM and COUNT are correct when 𝜇 (𝑔) = 1 for every such 𝑔; COUNT is correct only then, and SUM of a non-negative measure only if 𝜇 (𝑔) = 1 wherever 𝑚(𝑔) > 0. AVG is the 𝜇-weighted mean of 𝑚 over 𝐸, and it is correct for every 𝑚 if and only if 𝜇 is constant on 𝐸. MIN, MAX and COUNT(DISTINCT 𝑚) do Í

Figure 3 sketches six ways a query can count an entity more than once or at the wrong grain. Fan and chasm traps are the connection traps of entity-relationship modelling, an ambiguous or a broken path between entities [17, 30]; BI tools use the names for the overcounts that joins along such paths produce [12], and we extend the name to the other four. A measure is a numeric column that queries aggregate (a fee, a quantity); its grain is the entity it has one value per (an order for a shipping fee, a line for a quantity). A question 2

Evaluation side

BIRD gold

Fan-out audit

LLM judges

BIRD-FanOut

Audit flags vs BIRD’s revision

dev 1,534 + train 9,428

probe queries on the data under each query’s filters

label, correct, then review every gold

486 questions (distorted + intended)

BIRD’s revision changed 44% of answers with a definite flag and 16% of unflagged ones

Generation side 7 arms: evidence computed from the data

GrainTraps

none

59 questions, 3 synthetic databases

Stats

+Rep

FD

FD (t)

G-FD

G-FD (t)

8 LLM agents

Scoring

3 tiers, SQL tool, 38,232 runs

correct / grain error / other; BIRD: fan-out, + LLM judge

statistics → repetition counts → FDs → grain-aware FDs

Figure 2: The study. Top: an audit on the data flags BIRD gold queries that repeat the rows they aggregate; LLM judges label and correct the flags, BIRD’s independent revision validates them, and the result is BIRD-FanOut. Bottom: eight LLM agents in three tiers answer BIRD-FanOut and GrainTraps, a separate synthetic trap suite, under up to seven evidence arms (six on BIRD dev; G-FD: Grain-FD, (t): delivered by a tool). These colours are used in every figure; hatched or hollow marks denote delivery through a tool. We count grain errors on GrainTraps (the answer reproduces the trap query’s result or the audit flags it) and fan-out errors on BIRD (exact, or judged by an LLM; §6). Fan

10 q order: fee

Chasm

10 q product

1 N

N

line

line: qty

fee × lines of its order

a parent’s measure repeats once per child row

1

1

Many-to-many

11 q

product: price

tag

N

1 N

lot: units

product_tag

qty × lots, units × lines

two children of one parent multiply each other

Rank-then-attach

15 q

✓ rank products, then split by customer

1 N

✗ rank product–customer pairs

price × tags of the product

top 5 pairs, not top 5 products

a bridge repeats a measure once per partner

top-N ranked inside the finer grouping ranks the wrong things

Projection join region

6q

sales: revenue 1 N

target(region, segment, quarter) revenue × target rows per region

a column the key does not determine splits rows

NULL split

4q units

P1

Toys

5

P1

Toys

3

P1

NULL

2

P1’s units split over 2 groups

a blank forms its own group and splits an entity

Figure 3: Six traps that cause grain errors; all but rank-then-attach and NULL split are fan-out. Red marks the measure that repeats or the entity that splits, and the italic line says by how much; for rank-then-attach, the green box is the correct order of operations and the red one the trap. The number at the top right of each panel is the number of GrainTraps questions (§5.1) of that type, explicit and vague wordings together; controls not shown. not depend on 𝜇, and ORDER BY . . . LIMIT over a distorted aggregate ranks by the distorted values.

Here the condition is stated for the relation an arbitrary SQL aggregate reads, after its joins and filters, and both of its inputs can be measured on the data: the grain 𝐺 of each measure, and the multiplicity 𝜇 that the query’s joins and filters induce. Neither is visible in a schema. The audit (§4) tests on the data whether 𝜇 > 1 at the grain of each table’s rows, under the query’s own filters. The grain-aware FD evidence (§5.2) gives the model per-table forms of both inputs: the grain of every measure, and, for each identifier, how many rows each value appears on, which is the factor by which a join on it multiplies the matching rows; the model must still combine them across its joins (§2.3). An FD label such as “each order_id can have many line_id” says only that 𝜇 may exceed one, not by how much or for which measure.

The multiplicity traps of §2.1 are the ways 𝜇 exceeds one. In a fan trap, 𝜇 (𝑔) is the number of child rows of parent 𝑔. In a chasm trap, two independent children 𝑆 and 𝑇 of parent 𝑝 give a measure of 𝑆 the multiplicity |𝑇𝑝 | and a measure of the parent |𝑆𝑝 | · |𝑇𝑝 | (a parent with an empty child drops out). A bridge contributes one tuple per partner, a projection join one per value of the attached column, and a denormalized table has 𝜇 > 1 with no join at all. Assuming no base table holds duplicate rows, 𝜇 (𝑔) > 1 means that 𝐺 is not a superkey of 𝑄 although 𝐺 → 𝑚 holds in 𝑄, so 𝑄 violates BCNF: fan-out is a normalization failure of the relation the aggregate reads, a transitive dependency (line → order → fee) in the fan trap and a product of independent multivalued facts in the chasm trap. Rank-then-attach and NULL splits are errors in the grain of the grouping rather than in multiplicity, and fall outside the proposition. The condition concerns the relation an aggregate reads, not the answer: users ask for breakdowns, and 9 of the 32 explicit gold answers of GrainTraps (controls included) are not in BCNF. Of an answer we require only one value per cell, which the prompt also asks for (§5.2). The proposition is a query-level counterpart of summarizability in OLAP [39, 43], whose conditions (disjointness, completeness, type compatibility) are stated over declared dimension hierarchies.

2.3

Instance-level functional dependencies

Our dependency evidence (§5.2) is computed on the data, so we use instance-level functional dependencies (FDs). For columns A, B of a table r, r satisfies A → B iff d(A) = d(AB), where d counts distinct value combinations [7, 31]. We count NULL as a value (null = null, the semantics of SQL GROUP BY); NULL-aware FD theory distinguishes other notions [8, 36]. Comparing d(A), d(B) and d(AB) labels each pair 1:1, N:1, 1:N or M:N. An FD that holds on the table holds under every filter; a pair without an FD (1:N, M:N) may gain one under a filter, so its warning (“can have many”) is conservative. 3

Per-table FDs carry over to joins by transitivity (A → id in one table and id → B in the other give A → B in the join) [35, 50], but non-dependencies do not, and whether a join repeats rows depends on the uniqueness of its key. The models receive only per-table facts and must combine them; stating the consequences for the model’s own joins is future work (§7).

3

Benchmark quality. Jin et al. [32] find annotation errors in over half of BIRD Mini-Dev and Spider 2.0-Snow samples, including joins on non-unique keys; sqlsure reports an 8× inflated BIRD gold [57]; a practitioner analysis attributes part of a system’s BIRD losses to over-counting gold [28]; Wretblad et al. [61] find noisy questions and gold in a sample of BIRD. Test-suite evaluation [65] compares a query with the gold on many databases, so it still trusts the gold, and ambiguity benchmarks [9, 54] pair a question with several valid readings, as our intended questions do. We measure fan-out in BIRD’s gold on the data and validate it against BIRD’s independent revision.

RELATED WORK

Data-derived dependencies for LLMs. MCI-SQL [60] mines within-table pair FDs with TANE and exposes them through a metadata tool (removing it costs 0.5 EX on BIRD Mini-Dev). SQLfuse [64] uses data-derived one-to-many relations (2.0 EX on Spider dev [63]). Shkapenyuk et al. [56] give single-column profiles; DexterSQL [52] measures join fan-out to disambiguate columns; Su et al. [58] report little gain from cardinality-annotated keys. Our FD labels (FD, §5.2) are in the spirit of MCI-SQL’s pair labels, not a reproduction. Unlike these works, we measure fan-out errors directly rather than EX, and separate statistics, repetition counts and dependencies in controlled arms. Agentic exploration. Agents that query the database before answering [20, 38] check the data implicitly; we measure when they do so for fan-out. Ontologies and knowledge graphs. Ontology-based access to relational data [13, 53] lets a question be posed over entities rather than tables. Sequeda et al. [55] show that asking GPT-4 over a handbuilt ontology and knowledge graph of an insurance database raises accuracy from 16% to 54%, and an ontology-based query check with LLM repair raises it to 72% [3]; NVIDIA’s Auto Ontology builds such a layer automatically [44]. A functional property in an ontology (“an order has exactly one shipping fee”) is a declared dependency, and an ontology that models orders as their own class prevents the fan trap by construction. Our evidence is the instance-level, automatically derived counterpart of that part of an ontology, and our audit plays the role of the ontology-based query check, testing the query against the data rather than against declared axioms. Fan-out detection and repair. Semantic layers and their verifiers take cardinality from declarations: Cortex Analyst’s fan and chasm checks [12], Looker’s symmetric aggregates over declared primary keys [24], GROUND’s declared grain [51], dbt linters [15] (in 14 public dbt projects, the grain of 463 of 765 joins is unknown to the linter). DevRev’s LLM plan verifier checks where deduplication is placed [59]; ModularSQL flags results with many duplicate rows and adds DISTINCT to the outer query [66], so an over-counted aggregate, a single plausible number, passes it; a rule-based doublecounting resolver predates LLMs [29]. Grain Theory formalizes grain at the type level [33], and summarizability [39, 43] states when aggregation along declared dimension hierarchies is correct; eager aggregation [14, 62] is classic. All of these rely on declared cardinality or grain, or patch the query without looking at the data; our audit needs no declarations and tests each query on the data. FD discovery. TANE [31], HyFD [49] and a survey [1] cover discovery; Abedjan and Naumann’s unique-column discovery [2] covers the count-based pruning we use; Kossmann et al. validate dependencies driven by queries [37]. We claim no novelty in computing the evidence; our question is which form of it helps a model.

4

FAN-OUT IN BIRD

We audit every BIRD gold query on its data, check the audit against BIRD’s own later revision, and build BIRD-FanOut from the flags (Figure 4). The audit. The audit tests whether the rows an aggregate reads repeat (§2.2). It parses each query (sqlglot [42], SQLite dialect) into scopes: CTEs, subqueries and branches of set operations. For each scope with a duplicate-sensitive aggregate or an ORDER BY . . . LIMIT, probe queries under the scope’s own filters compare the number of joined rows with the number of distinct rows of each table (SQLite rowid). A join that could repeat rows but does not on this data is not flagged. For example, the gold of BIRD train question 9279 (Figure 5) counts customer_id over rentals joined to customers, so an inactive customer counts once per rental (404 rentals of 15 customers); the audit flags the COUNT as definite fan-out. A flagged query gets one of three flags: • Definite: rows repeat under SUM, AVG, COUNT(col) or ORDER BY . . . LIMIT, or under COUNT(*) when every joined table repeats. The answer is wrong whatever the question means. • Ambiguous: COUNT(*) where only some tables repeat. It counts the rows of the other tables exactly, so it is wrong only if the question counts a repeating one. • Repeated values: COUNT(col) whose column repeats within its own table. The audit takes about 16 s for BIRD dev. Within one denormalized table it checks only COUNT(col), a join to a subquery or CTE is checked only statically, and AVG is flagged over any repetition, which is conservative when rows repeat evenly (§2.2). Prevalence. On the June 2024 dev, 5.3% of gold queries have a definite flag. Two judges (Claude Opus 5.5 [5], GPT-5.5 [47]) label each definite or ambiguous flag as distorted (the question means distinct entities), intended or unclear, write corrected SQL that must run and pass the audit, and say whether the intended reading is resolvable from the data model. They agree on 95% of flags, and a Claude agent reading 20 random flags agreed with each judge on 18. From the two labels, a flagged gold is • distorted if both judges label it so; its gold is corrected; • intended if both label it intended: counting the repeated rows is right; • left out if the judges disagree (contested), the correction returns the same answer on this data (benign), or the reading is not resolvable. 4

BIRD dev

BIRD train

1,534 gold queries

gold answer changed in BIRD’s own cleaning

9,428 gold queries

11 databases

69 databases; 187 do not parse

audit on the data

82 definite flags

586 definite flags

+ 11 only ambiguous, 44 only repeated values

+ 177 only ambiguous, 711 only repeated values

two LLM judges

64 distorted, 21 intended

8

left out

relabelled on the cleaned release

not flagged 1,397 questions

of 586 labelled

105 candidates

36 intended

3

left out

BIRD-FanOut: 384 229 distorted

155 intended

Figure 6: The audit against BIRD’s independent revision. Of the dev gold answers with definite fan-out flags, BIRD’s cleaned release (2025), made without our flags, changed 44%; of the unflagged ones, 16%. 37

left out

30 distorted golds by our labels; the 2026 Mini-Dev [11] has no definite flags. BIRD-FanOut. BIRD-FanOut keeps the distorted and intended questions. Dev questions come from the cleaned release; where the release fixed the fan-out, its SQL is the gold and the old gold is the trap query. On train, two judges (Gemini 3.6 Flash [27], Claude Haiku 5.5 [4]), chosen by agreement with the dev labels, label every definite flag, and two strong judges (Claude Opus 5.5, GPT-5.6 Terra [48]) relabel those they leave unsure. A distorted question is kept only if the two corrected queries return the same answer. Gold review. A correction removes the fan-out but keeps the rest of BIRD’s query, so a gold can stay wrong for another reason: of 40 model answers that both judges called reasonable readings yet that did not match the corrected gold, a Claude agent querying the data found the gold wrong in 21 (a negated filter, a typo copied from the hint, a join on the wrong key). In 9279 the gold also never checks that the rental was not returned (BIRD’s hint puts this on rental_date, which is never empty); the review’s fix lowers the answer from 15 to 4. Every gold of BIRD-FanOut is therefore reviewed. Gemini and Haiku read each question with its hint, the schema, sample rows and the gold’s result; anything either flags goes to the strong judges, who see each other’s review, unnamed, once when they disagree. A fix is accepted only if both strong judges call the gold wrong and their fixed queries return the same result; it must run, change the gold’s result and, on a distorted question, pass the audit, and a fix that returns nothing, 0 or NULL is also checked on the data. Each judge also writes a trap query, kept when both agree, so that exact fan-out errors can be scored without a judge. BIRD-FanOut thus has 486 questions, 295 distorted and 191 intended. Appendix D gives the review’s outcome, its checks on the data and its effect on the results.

Figure 4: From BIRD gold queries to BIRD-FanOut: 10,962 gold queries, 668 definite flags, 486 questions. Dev labels cover the definite and ambiguous flags of the June 2024 release; the dev candidates come from labelling BIRD’s cleaned release. Left out: contested, benign or unresolvable questions and, in the gold review, disputed ones or ones without a fanout signal.

“How many non-active clients have not returned the rented material?” rentals of inactive customers

1 BIRD gold

customer

COUNT(customer_id) one per rental

64 64 64 64 368 368

rented

returned

2005-05-28 2005-06-02 2005-05-28 2005-05-30 2006-02-14 (empty) ... 33 in all 2005-05-25 2005-06-03 ... 35 in all

15 inactive customers, 404 rentals BIRD’s hint: “rental_date is null”, which holds for 0 of 16,044 rentals

= 404

2 fan-out fix COUNT(DISTINCT customer_id) one per customer

= 15

3 gold review + AND return_date IS NULL with an unreturned rental

217 of 1,397

55 questions with only weaker flags (ambiguous or repeated values) are set aside.

gold review; 80 fixed

BIRD-FanOut: 102

16%

left out

421 candidates

gold review; 5 fixed

36 of 82

165

all kept

33 distorted, 35 fixed by BIRD, 37 intended

34 fixed by BIRD

255 distorted, 166 intended

44%

82 questions

1,534 questions

four LLM judges, two stages

of 93 labelled (definite + ambiguous)

66 distorted

definite fan-out flag

BIRD dev

audit on the data

=4

Figure 5: BIRD train question 9279. (1) The gold counts rentals; the audit flags it as definite fan-out. (2) The fan-out correction counts customers. (3) The gold review adds the missing “not returned” condition. (empty) is NULL.

On dev, 4.2% of golds are distorted; where the answer is one number, the distorted gold is a median 6.3 times the corrected answer. On train, 6.2% of gold queries have a definite flag, and the distorted ones are a median 1.6 times the corrected answer. Validation against BIRD’s revision. BIRD’s cleaned dev (2025-11-06) [10] keeps the question ids and rewrites gold queries and questions after human review, independently of our audit. It changed the gold answer of 44% of the questions with a definite flag, against 16% of questions with no flag (Figure 6), and flagged questions were changed more often in each of the 9 databases that have flags. The release also shows how many real fan-out fixes the audit catches. Of the 36 answer changes that both judges call fan-out fixes keeping the question’s meaning, the audit flags 32. We looked for missed fixes only among changes that add DISTINCT, so the true recall may be lower. The cleaned dev still has about

5 GRAINTRAPS AND THE EVIDENCE 5.1 GrainTraps BIRD shows how often fan-out occurs; GrainTraps shows when models make grain errors. It uses three synthetic SQLite databases, generated reproducibly: bookings (one wide sales table; products booked under several divisions and by several customers), supply (orders and inventory lots, both “many” per product), and shop (a wide order-line table with order-level fields repeated per line, NULL gaps in an attribute, many-to-many tags, and sales targets per region, customer segment and quarter). It has 59 questions: 29 5

explicit trap questions, 27 vague twins and 3 controls (questions per trap type in Figure 3). Explicit questions state the intended grain; vague twins drop it from the wording but keep the list of returned columns, and each records why its reading follows from the data model. Every question has a written trap explanation and solution, gold SQL, a trap query (the naive SQL that reproduces the trap), and (for one question) an alternative accepted reading. The NULL-split gold treats the gaps as missing values of a product’s single category; reporting NULL as its own category is the trap reading. Scoring. An answer is

readings open. On BIRD train this cuts the schema to 27% of its size. Full-schema runs. A separate set of runs shows the agent the whole database instead, with measure columns included in the evidence: Claude Opus 5.5, Claude Sonnet 5.5, GPT-5.5, Gemini 3.1 Pro [25], Gemini 3.5 Flash-Lite, GLM, GPT-OSS-120B [46] (which did not complete the main runs) and Nemotron, on GrainTraps, BIRD-FanOut dev and 150 ordinary Mini-Dev questions (2026 release, with joins and no audit flags). §5.1, §6.1, §6.6 and §6.7 use these runs; Appendix D gives their arms and main results. Column roles. Before any question is asked, every column of the known tables (2,879 columns in 352 tables) is labelled identifier, dimension or measure, as in a data catalog. A heuristic (keys, types, numeric share, BIRD’s column descriptions) and two LLM judges per table (Gemini 3.6 Flash, Claude Haiku 5.5; they agree on 97%) assign the roles, and Claude Sonnet 5.5 decides the remaining columns; 704 columns are measures. The heuristic alone leaves 613 integer columns open and misreads 116 numeric columns stored as text. The roles decide what the evidence covers. Measures are left out of the statistics and the dependency profiles, because profiling them adds noise such as accidental keys (“unit_price is a key” because all prices differ); Grain-FD instead states each measure’s grain. Identifiers get the repetition counts. The schema shows no roles; the model learns that a column is a measure only from evidence that says so. The roles ship with the benchmarks. FD evidence. For a table and its non-measure columns, aggregate SQL computes d(·) for single columns and pairs, pruning pairs whose label follows from others (1:1 substitution, transitivity, cardinality bounds, sampled counterexamples) [2]. The profile reports the inferred key, 1:N hierarchies and every pair’s label (Figure 7). Grain-FD evidence. The grain-aware evidence supplies the two inputs of §2.2 with four additions to the FD evidence. It is computed once per table, cached, and delivered exactly as the FD evidence, so FD vs Grain-FD and FD (tool) vs Grain-FD (tool) differ only in content. The examples are from the table of Figure 7.

• correct if its rows match the gold or an alternative as multisets (floats to 2 decimals, order ignored); • a grain error if it is exact or the audit (§4) finds realized fan-out in it; • other if it is wrong otherwise; • failed if no runnable SQL was produced. A model that ends without submitting is scored on the last query it ran; in the runs of §6 this happens in at most 4.0% of runs of any model and arm. Role and construction. We use the suite as a diagnostic rather than a leaderboard, since the four larger models of the full-schema runs (§5.2) solve 92% of it without help. A Claude agent generated the databases, questions, gold and trap queries under the authors’ direction. Tests check on the data that every gold returns rows and every trap query returns a different result; vague questions were kept only if strong models could solve them as written (in runs without evidence), so strong models leave evidence little room to help. There is no held-out split; the three controls are simple, and intended fan-out (counting joined rows on purpose) is covered by BIRD-FanOut’s intended questions instead.

5.2

The evidence

Agent and arms. Each model runs as an agent: it can run SQL on the database through a tool as often as it needs (up to 50 steps), and it ends by submitting one SQL query and a short answer (Appendix B); we call the record of a run its trace. All arms share one prompt, which says Do not assume how tables and columns relate from their names or from what seems typical: check it in the data, and asks for exactly the requested columns with one value per cell. It contains no procedure, trap names or layout hints. The seven arms differ only in the evidence the model receives, and Figure 7 shows, verbatim, what each arm gives the model for one GrainTraps question (Appendix A shows a second). Stats is the content control: rows, distinct values and NULLs per non-measure column, without relating columns. Stats+Rep is an exploratory control that isolates the repetition counts. Evidence is given either in the prompt or through a tool, cardinality_matrix, that the model calls with a table and columns and must call on every table its final query reads. The rest of this section describes the setting all arms share and how the evidence is computed. Known tables. For every question, in every arm, the agent sees only the tables read by its reference queries (the corrected gold and the trap query, or the original gold), with all their columns, never the whole database. Keeping both queries’ tables leaves both

• Measure grain. Leaving measures out of the dependency profiles (above) also hides that a shipping fee repeats on every line of its order. Grain-FD states the grain of each measure: the coarsest non-measure column on which the measure has a single value (“shipping_fee: one value per order_id (3.5 rows each on average; a sum over rows counts it that many times)”), or, if no single column determines it, that it varies by row. • Repetition counts. “Can have many” says that a join may repeat rows, not how often. Grain-FD adds, for each identifier, the number of rows per value and the consequence: “order_id: 1–6 rows (mean 3.5); a join on it repeats each matching row that many times”. • NULL-aware FDs. FDs count NULL as a value (GROUP BY semantics), so “each product has one category” fails as soon as some rows leave the category blank, and the label reads “can have many”. Grain-FD re-checks each failed FD on filled rows only and reports the gap: “product_name → category holds on filled-in rows; category is blank on 523 rows”. 6

No evidence

CREATE TABLE sales_lines (line_id INTEGER PRIMARY KEY, order_id INTEGER, order_date TEXT, customer_name TEXT, customer_segment TEXT, ship_region TEXT, product_name TEXT, category TEXT, quantity INTEGER, unit_price REAL, shipping_fee REAL);

Stats

sales_lines (4185 rows): line_id 4185 distinct; order_id 1200 distinct; ... customer_segment 3 distinct; ... category 6 distinct, 523 NULL.

Stats+Rep

Stats, plus: - order_id: 1–6 rows per value (mean 3.5); a join on it repeats each matching row that many times

FD

Primary keys (inferred): line_id Hierarchies (1:N chains, coarsest → finest): customer_segment → customer_name → order_id → line_id; ... 1:N (source fans out to multiple targets): order_id: line_id; customer_segment: line_id, order_id, customer_name; ... M:N (many-to-many — high Cartesian risk): category ↔ customer_name, customer_segment, order_date, order_id, ...

FD (tool)

cardinality_matrix(table_name='sales_lines', columns=['line_id', 'order_id', 'customer_segment']) sales_lines (4185 rows). Each row has its own line_id. - Each customer_segment can have many order_id. - Each order_id has exactly one customer_segment.

Grain-FD

FD, plus: Rows per value (identifiers): order_id: 1–6 rows (mean 3.5); a join on it repeats each matching row that many times Ignoring blanks (NULL): product_name → category holds on filled-in rows; category is blank on 523 rows, ... Measures (grain): shipping_fee: one value per order_id (3.5 rows each on average; a sum over rows counts it that many times)

Grain-FD (tool)

cardinality_matrix(table_name='sales_lines', columns=['customer_segment', 'shipping_fee']) sales_lines (4,185 rows). Each row has its own line_id. - Each order_id appears on 1–6 rows (3.5 on average): joining another table on order_id repeats each of its matching rows that many times. - Each customer_segment can have many order_id. - Each order_id has exactly one customer_segment. - Measure shipping_fee has one value per order_id: each value appears on the 3.5 rows of its order_id on average, so a sum over rows counts it that many times.

schema only

in the prompt

in the prompt

in the prompt

on request

in the prompt

on request

Figure 7: What each arm gives the model for one GrainTraps question (“How much was charged in shipping fees in total for each customer segment?”, table sales_lines), copied from the run traces and abridged (. . . ); markdown marks are dropped and the many-to-many arrow is drawn as ↔. Blue: what an arm adds over its reference arm; grey italics: the model’s own tool call. Only the Grain-FD arms say that a shipping fee repeats on the 3.5 lines of its order. • Scoping. Grain-FD (tool) always adds the table’s identifiers to the requested columns (up to 25), so a scoped call cannot omit the key that carries a measure’s grain.

Super VL 120B-A12B [45]; 40.8%). BIRD-FanOut, which the grouping does not use, gives the same order (fan-out errors without evidence 13.8%, 17.7%, 24.5%; each step p ≤ .004). The tiers only group the results; on GrainTraps, a tier’s change from no evidence is partly regression to the mean, since the tiers were chosen on that arm. Each model answers every trap question three times and every BIRD-FanOut question once, in the six main arms and, on GrainTraps and BIRD train only, in Stats+Rep, on these question sets (Table 1). Runs were made on the BIRD questions as first labelled (421 train, 105 dev), except Stats+Rep, which ran after the gold review on the 384 train questions it kept; the scores use only the 486 kept questions. There are 38,232 runs in total, one per question, arm and model on BIRD and three on GrainTraps, with provider-default temperature and up to 50 agent steps. Three further models (Gemini 3.8 Flash, Qwen 3.8 27B, GPT-OSS-120B) did not complete every arm and are excluded. Statistical tests. Each evidence run is paired with its reference arm’s run on the same question, model and repeat. We report each comparison as the errors the tested arm avoids (grain errors on GrainTraps, fan-out errors on BIRD), in percentage points of runs (positive is better). The unit of inference is the question. On GrainTraps, a base question is an explicit question together with its vague twin; on BIRD, each question is its own base. Figures give 95% bootstrap intervals over base questions [21]; p-values are from a sign-flip permutation test on the per-question changes unless marked as sign tests. The six headline tests (Grain-FD and Grain-FD (tool) against Stats, on GrainTraps, on BIRD train and on its held-out questions) survive Holm correction (largest adjusted p = .012). The eight tests involving Stats+Rep are exploratory; none survives

Design set and held-out questions. The Grain-FD rules are generic, with no question-specific content. We developed them on a pilot drawn from GrainTraps and from 46 BIRD-FanOut train questions selected because FD evidence changed a model’s outcome on them (Appendix D); all of GrainTraps and these 46 questions form the design set. The other 183 distorted train questions are held out: they played no part in the design. They are the complement of a set selected on FD’s outcomes, not a random split. What each comparison measures. Stats against no evidence gives what simple statistics add; each FD arm against Stats gives what dependencies add beyond them, and each grain-aware arm against the FD arm with the same delivery gives what grain-awareness adds. In the exploratory control, Stats+Rep against Stats gives what the repetition counts add, and Grain-FD against Stats+Rep roughly what the rest of the grain-aware evidence adds (roughly, because Grain-FD lacks the per-column counts of Stats+Rep). FD and FD (tool) differ in both wording and delivery, so each is compared with Stats, not with the other. The grain-aware arms are also the only ones that name the measure columns, so their effect includes that labelling.

6

RESULTS

Models and runs. We test eight models and group them by their grain errors on GrainTraps without evidence: low-error (Claude Sonnet 5.5 [6], Claude Haiku 5.5 [4]; 2.4%), mid-error (DeepSeek V4.1 Flash [19], GPT-5.6 Luna and Terra [48], GLM-5.3-Flash [22]; 13.2%) and high-error (Gemini 3.5 Flash-Lite [26], NVIDIA Nemotron 3.5 7

set

questions

GrainTraps BIRD train, distorted BIRD train, intended BIRD dev, distorted BIRD dev, intended

56 with a trap, 3 controls 229: 183 held out, 46 design 155 32 still distorted, 34 fixed by BIRD 36

grain errors (% of runs)

Table 1: Question sets, scored against their reviewed golds (§4). Fan-out errors are measured on the distorted questions, whose original gold over-counts; harm on the intended ones, where counting the repeated rows is right. GrainTraps has 29 explicit questions and 27 vague twins.

GLM-5.3-Flash

20

GPT-5.6 Terra

10

DeepSeek V4.1 Flash

GPT-5.6 Luna

Claude Haiku 5.5 Claude Sonnet 5.5

0

20

40

60

80

100

runs that ran a checking query (%)

Figure 8: GrainTraps without evidence: share of runs that ran a checking query and share with a grain error, per model (168 non-control runs each); colour gives the tier. Models that check more make fewer grain errors: the two Claude models check in 95–98% of runs and almost never make one.

so these results show that the evidence fixes the failures it targets; the held-out test is on BIRD (§6.3). Figure 9 shows the paired differences between arms; each arm’s absolute rates are listed below (Table 2). Grain errors fall from 17.4% of runs without evidence to 12.8% with the statistics (p = .015). FD and FD (tool) add nothing beyond them; the low-error models even lose a little, all on NULL splits, where an FD counts a blank as a value. Grain-FD and Grain-FD (tool) bring the rate down to 8.3% and 7.7%, 4.5 and 5.1 points below the statistics (p = .012 and .003), and accuracy rises by about as much. Most of the gain is on the fan traps, the failure the measure’s grain targets: 5 of the 29 base questions give 35 of the 60 avoided grain errors. Because the gain is concentrated, a sign test, which counts each base question once whatever its change, is weaker (p = .078 and .041). Grain-FD leaves four of the six low- and mid-error models with no grain error; the high-error models keep 39 and 61 grain errors in their 168 runs (Appendix C). Repetition counts or FDs? (exploratory) The repetition counts alone (Stats+Rep) avoid 2.0 points of grain errors beyond the statistics (p = .019), 45% of Grain-FD’s cut, but barely move accuracy. Grain-FD avoids a further 2.5 points (not significant), mostly on the fan traps, where only it states the measure’s grain (21 grain errors against 49 with Stats+Rep); on chasm questions it has more (20 against 10).

• exact + judged (primary, called fan-out errors): exact fan-out errors plus answers judged to over-count; • exact only: no LLM judge; • exact + audit flags: no LLM judge; the rule used on GrainTraps (Figure 10).

Who makes grain errors?

Every model makes grain errors on GrainTraps, and the models that check the data make the fewest (Figure 8). Without evidence, grain errors range from 2% (Sonnet) to 42% (Nemotron) of the 168 non-control runs per model (Appendix C); the low-error models fail only on NULL splits and fan traps, and solve every chasm question. Checking. A checking query is one the model ran before answering (other than its submission) that tests how columns relate (COUNT DISTINCT, HAVING COUNT, IS NULL). The two Claude models check in 95–98% of runs and almost never make a grain error; the others check far less. Within a model, runs that checked make fewer grain errors (Terra 7% vs 15%, GLM 13% vs 23%, FlashLite 26% vs 44%), but none of these differences is significant, either per model or when only runs on the same question are compared (Mantel-Haenszel [41] p > .7). This suggests that checking marks the careful models rather than making a model careful. In the fullschema runs (§5.2), adding the prompt’s line telling models to check the data to an earlier prompt raised checking sharply (GPT-5.5 3% → 21%, Sonnet 57% → 94%) without reducing grain errors.

6.2

30

0

Holm correction within that family (smallest adjusted p = .058). Results by tier or by model are descriptive. Measuring fan-out on BIRD. All runs are scored against the reviewed golds of §4. Because the audit that found BIRD-FanOut’s questions detects repeated rows only, every distorted gold overcounts, so on BIRD we measure fan-out errors rather than all grain errors. An answer that over-counts and also makes another mistake is not an exact fan-out error. To catch such answers, an LLM judge that is not a subject model labels every other distinct wrong answer as fan-out or not, and a second judge checks a random sample and settles every disagreement with the audit (§6.3). We report three metrics of fan-out errors on BIRD:

6.1

low-error mid-error high-error

Nemotron 3.5 Super Gemini 3.5 Flash-Lite

40

6.3

Real data: BIRD-FanOut

On BIRD train, grain-aware FDs cut fan-out errors from 18.4% of runs to 13.1–13.6%, 3.4–3.9 points fewer than with the statistics (p < .001), also on held-out questions and when errors are counted without any LLM judge. Without evidence, 12.9% of runs on the 229 distorted train questions return exactly the distorted gold’s result. Counting also the answers that over-count but make another mistake as well, 18.4% of runs are fan-out errors (Table 2). Against the statistics, Grain-FD avoids 3.4 points and Grain-FD (tool) 3.9 (both p < .001; Figure 9, right), plain FDs 1.7 and 2.3 points, and the statistics alone avoid 1.4 points against no evidence (not significant). Against plain FDs with the same delivery, the grain-aware additions avoid a further

Evidence on GrainTraps

On GrainTraps, statistics help, FDs add nothing, and grainaware FDs avoid about five more points of grain errors than the statistics (Figure 9, left). GrainTraps belongs to the design set, 8

GrainTraps: grain errors avoided (points)

better →

BIRD-FanOut train: fan-out errors avoided (points)

better →

Statistics vs no evidence Stats vs no evidence

+4.6

+1.4

FDs vs statistics FD vs Stats

+0.7

+1.7

FD (tool) vs Stats

−0.3

+2.3

Grain-FD vs Stats

+4.5

+3.4

Grain-FD (tool) vs Stats

+5.1

+3.9

Repetition-count control (exploratory) Stats+Rep vs Stats

+2.0

+2.0

Grain-FD vs Stats+Rep

+2.5

+1.4

Grain-FD (tool) vs Stats+Rep

+3.1

+2.0

−4

−2

0

2

low-error tier

4

6

8

mid-error tier

10

12

−2

high-error tier

−1

0

1

2

all models, 95% CI

3

4

5

6

hollow = tool delivery

Figure 9: Errors avoided by the tested arm relative to its reference, in percentage points of runs (right is better): grain errors on GrainTraps (in-sample for the Grain-FD arms) and fan-out errors on BIRD-FanOut train (exact plus judged; 229 questions). Large dots: all eight models with a 95% bootstrap interval over questions (a trap question and its vague twin count as one); small markers: tiers (descriptive); hollow: tool delivery. On GrainTraps FD adds nothing over the statistics and on BIRD 1.7–2.3 points; the Grain-FD arms add most. Full tables, with accuracy, are in Appendix E. Table 2: Error rates per arm, in % of runs: grain errors on GrainTraps (1,344 runs per arm), fan-out errors on the 229 distorted BIRD-FanOut train questions (1,832) and on the 183 held-out ones (1,464), and accuracy on the 229. Bold: the best value in each column; Stats+Rep is exploratory.

Grain-FD Grain-FD (tool)

all 229 questions 2.5

exact only

GrainTraps

BIRD train

held out

BIRD acc.

exact + audit flags

3.4

17.4 12.8 10.8 12.1 13.1 8.3 7.7

18.4 17.0 15.1 15.3 14.7 13.6 13.1

16.1 15.1 13.9 13.9 12.9 12.4 12.2

60.3 61.2 62.3 62.0 62.0 63.3 63.2

0

no evidence Stats Stats+Rep FD FD (tool) Grain-FD Grain-FD (tool)

1.8

3.1 3.1 3.3

exact + judged (primary)

arm

183 held out 2.4

2.2 2.5 3.9

2 4 0 2 fan-out errors avoided vs Stats (points)

2.7 2.9

4

Figure 10: BIRD-FanOut train: fan-out errors avoided against Stats under three metrics, two of them without LLM judges. Left: all 229 questions; right: the 183 held-out questions. Hatched: tool delivery.

1.6 points in both deliveries ([0.3, 3.1] and [0.2, 3.1]; p = .03 and .04, outside the six headline tests); on held-out questions, 1.6 (p = .05) and 0.7 points (not significant). Held-out questions, models and databases. On the 183 heldout questions, the Grain-FD arms avoid 2.7 and 2.9 points more than the statistics (both p ≤ .001); on the 46 design questions, selected on FD’s outcomes, the effect is larger (6.0 and 8.2 points). GrainFD has fewer fan-out errors than the statistics for 7 of 8 models (one tie) and Grain-FD (tool) for all 8, and resampling the 46 databases instead of the questions keeps both effects (intervals [1.6, 5.3] and [1.9, 6.1] points). Against no evidence, fan-out errors fall most for Luna, Sonnet and Terra and barely change for Nemotron and Haiku (Figure 11); Haiku’s traces suggest it sees the repetition and follows the hint’s row-level formula (§6.4). With one run per question, per-model differences are descriptive. Judge-free metrics and judge reliability. Two metrics that use no judge lead to the same conclusions (Figure 10): exact fan-out errors alone, and exact ones plus other answers the audit flags as definite fan-out. The judges add over-counts that the exact match misses, but they do not create the effect: among the wrong answers

that are not exact fan-out errors, the share the judges call fan-out falls with the evidence (20.6% without evidence, 14.4% with GrainFD) just as the share the audit flags does (11.8%, 7.1%). Counting also the rare answers the judge calls grouped at the wrong grain (about 1% of runs) as grain errors gives the same result (3.1 and 3.7 points beyond the statistics, 2.4 and 2.7 on held-out questions, p ≤ .007). The first judge, Gemini 3.6 Flash, sees the question and hint, the schema, both golds with their results and the answer with its result, but not the audit’s flag. Claude Opus 5.5 agreed with it on 98% of a random sample (Cohen’s 𝜅 [16] 0.91) and settled every answer where Gemini and the audit disagreed. Five Opus agents that could query each database, not shown the labels, matched them on 47 of 50 answers (𝜅 0.88), and their few disagreements suggest that judged fan-out, if anything, slightly undercounts. These checks are not independent, because both judges saw the same prompt, which says the question was flagged for over-counting, and Opus both settles disagreements and runs the agents. The gold review (§4) raised accuracy without evidence by 11 points but moved these 9

No evidence

Stats

Grain-FD

Grain-FD (tool)

splits BIRD’s 229 distorted questions by properties of the data and of the questions. Repetition, size and noise. When an over-count is small, the evidence gives little warning. For 17% of the BIRD questions with a trap query, the over-count changes the answer by less than 10% (on GrainTraps, for 4%). In these questions few rows repeat, so the evidence reports close to one row per value; their fan-out errors are frequent, and Grain-FD removes only 19% of them, against 30% for larger over-counts. Other properties of the data matter little. BIRD’s tables are larger and messier than the trap tables (median 3,118 rows against 70, NULLs in a third of them, and in 30% a dependency that holds except for a few rows, which the trap tables never have), yet Grain-FD cuts fan-out errors by 24–27% with and without each of these. The questions. BIRD’s questions differ from GrainTraps in two ways that matter more.

Claude Sonnet 5.5 Claude Haiku 5.5 DeepSeek V4.1 Flash GPT-5.6 Luna GPT-5.6 Terra GLM-5.3-Flash Gemini 3.5 Flash-Lite Nemotron 3.5 Super 0

5

10

15

20

25

30

fan-out errors, % of the 229 distorted BIRD-FanOut train questions

Figure 11: Fan-out errors per model on BIRD-FanOut train (one run per question and arm). Tiers are separated by lines: low-, mid- and high-error. Against no evidence, the Grain-FD arms cut errors most for Luna, Sonnet and Terra; Haiku and Nemotron barely change.

1. Hints prescribe the distorted formula. Most BIRD questions come with a hint (BIRD’s “evidence” field), written by its annotators for the original gold. For 127 of the 229 distorted train questions the hint states that gold’s formula, such as “average price per car = avg(price) where country = ‘Japan’ ”. With such a hint, fan-out errors are twice as frequent (24.1% against 11.3% of runs), and Grain-FD cuts them by 20% instead of 40%. GrainTraps has no hints. A Claude agent read 40 Grain-FD runs that still made an exact fan-out error, five per model. In 21 the model saw the repetition and still chose the row-level reading, 15 of them with a hint formula (“The hint explicitly says avg(price) . . . I’ll go with the join answer”, GLM). 2. A few hard, sometimes debatable questions carry many errors. 22 of the 229 questions account for 45% of the fan-out errors without evidence and 52% with Grain-FD, while on GrainTraps no question keeps a grain error in most of its Grain-FD runs. In 11 of these 40 runs, the question or its corrected gold allows another reading.

fan-out results by at most 0.5 points. Appendix D gives the full checks. Repetition counts or FDs? (exploratory) The repetition counts alone give about half of the cut: Stats+Rep avoids 2.0 points beyond the statistics (p = .013), 58% of Grain-FD’s cut (95% interval 21–91%). The rest of the grain-aware evidence avoids 1.4 more points, and 2.0 with the tool, also on held-out questions (1.5 and 1.6 points, p = .028 and .036); plain FDs add nothing beyond the repetition counts. The tool’s increment is the firmer one, as it remains on exact fan-out errors alone and in 7 of 8 models. No test in this exploratory family survives Holm correction. Accuracy and dev. Accuracy understates these effects, because most errors on these questions are not fan-out and an avoided fanout error often becomes another error (§6.4). Against no evidence, Grain-FD and Grain-FD (tool) raise accuracy from 60.3% by 3.0 and 2.8 points (p = .003 and .009); on held-out questions the gain is 1.8 points and not significant. Against the statistics they gain about 2 points (p = .031 and .07), mostly in the low- and mid-error tiers, and 0.6 points on held-out questions (not significant), so we claim no accuracy gain of the FDs over the statistics. No arm raises the high-error models’ accuracy by more than 1.5 points, although Grain-FD (tool) cuts their fan-out errors by 5.5 points against no evidence. On dev, only the 32 questions still distorted in the cleaned release can show fan-out, and they are too few to test (fan-out errors: no evidence 38, Grain-FD (tool) 25 of 256 runs, p = .30); no accuracy comparison on dev is significant. Only 13 of 85 dev answers that reproduce an old gold’s result copy its SQL nearly verbatim, so memorization of the public old gold plays a small role.

6.4

Accuracy. A third difference explains why accuracy rises less, but not why fewer fan-out errors are avoided. On BIRD 21% of runs fail for other reasons (GrainTraps: 3%), so an avoided error often becomes another error. Of the runs that fall into the trap without evidence (an exact fan-out error on BIRD, a grain error on GrainTraps), Grain-FD turns 58% into correct answers on GrainTraps but only 36% on BIRD. The evidence itself. In 13 of the 40 runs, the evidence fell short. The needed fact was missing (one column labelled a dimension instead of an identifier lost its repetition counts), buried in over 100 lines of evidence, or stated and not used.

6.5

When repeated rows should be counted

Evidence that says rows repeat could push a model to deduplicate rows a question means to count. We test this where counting the repeated rows is right: on GrainTraps’ three control questions, which every model solves in every run and arm, and on the 191 intended questions of BIRD-FanOut (dev and train). With evidence in the prompt, no model is significantly less accurate on the intended questions than without evidence (the largest drop is 1.6 points). With the tool arms, two models do deduplicate where they should

Why does evidence help less on real data?

Grain-FD halves grain errors on GrainTraps but cuts fanout errors on BIRD by only a quarter, mostly because of the questions and because some data barely repeats. From no evidence to Grain-FD, grain errors fall from 17.4% to 8.3% of runs on GrainTraps, where nearly every error is a grain error, and fan-out errors fall from 18.4% to 13.6% on BIRD train. Figure 12 10

GrainTraps (grain errors)

−52%

wrong grain

BIRD-FanOut train, distorted (229)

−26%

misread question −19%

over-count < 10% (37) over-count ≥ 10% (175)

−30% −20%

hint states a formula (127) near-dependencies (144)

−27% −24%

25

50

75

100

125

150

175

Figure 13: Causes of the 327 distinct “other” trap answers (Opus judge; full-schema runs). Blue: causes the Opus judge counts as grain or data-model errors.

−27% −26%

all tables ≤ 100k rows (142)

−26%

0

10

20

30

40

50

error rate (%)

it goes unused: per-table facts are not combined across a join; a tool call scoped to a few columns leaves out the one that carries the measure’s grain; and a prior belief overrides the evidence (“assume each product has a single division”, written right after the tool says a product can have many).

Figure 12: Fan-out error rate without evidence (dot) and with Grain-FD (arrowhead), by question group (number of questions); top row: grain errors on GrainTraps. The arrow’s length is the drop in percentage points; the label is the relative cut, the drop as a share of the rate without evidence (18.4% → 13.6% is −26%). Over-count groups cover the 212 questions with a trap query, which is needed to measure the over-count. Over-count size and hint formulas matter; NULLs, near-dependencies and table size do not.

6.7

The audit as an offline verifier

The audit can also check a model’s answer before anyone uses it. In the full-schema runs we ran it on every distinct submitted answer (2,161 on BIRD-FanOut dev, 1,807 on 150 ordinary MiniDev questions). It catches most over-counts, flagging 70–75% of the answers that reproduce a distorted gold (a definite flag on 12–26%, an ambiguous or repeated-values flag on the rest). It rarely flags correct answers: 1% on the dev questions with fan-out and 5% on the ordinary questions, where only 0.3% get a definite flag. It cannot judge intent, though. On intended questions it flags 53% of correct answers, because a flag says that rows repeat, not whether the question meant them once, and that decision must stay with the model or the user.

not. Against the statistics arm, Nemotron 3.5 Super loses 10.5 points with Grain-FD (tool) and GPT-5.6 Luna 5.3, and the other models show no consistent loss. Against no evidence these losses are smaller and not significant, and they come from per-model comparisons, not from the six headline tests (§6), so they signal a risk of tool delivery rather than an established harm. With FD (tool), Nemotron loses 7.9 points and Luna 5.3. For the high-error tier, the losses against the statistics are 4.7 points (p = .037) and 4.2 (p = .058), not significant after correction; against no evidence they are −2.1 and −1.6 points, and before the gold review the first was −4.2, so part of it was gold error.

6.6

grain or data-model error (blue)

20

0

−24%

no NULLs (98) table > 100k rows (87)

44 43

acceptable reading 1

no near-dependencies (85) NULLs in the question's tables (131)

SQL mistake other over-count under-count (over-dedup.)

−40%

no formula in hint (102)

166 53

6.8

Cost

The tool arms add about two tool calls per run. The evidence arms read up to twice the input tokens of no evidence. The median per BIRD train run is 4.4k tokens without evidence, 4.9k with Stats, 5.4k with Stats+Rep, 7.8k with FD and FD (tool), 8.7k with Grain-FD and 7.7k with Grain-FD (tool). Grain-FD is the longest because it adds repetition counts, NULL-aware FDs and measure grains, over 100 lines for some BIRD tables. All evidence is computed once per table and cached; on BIRD train’s largest databases (up to 5 GB), the first Grain-FD profile of a table takes up to 27 minutes.

The remaining errors

In the full-schema runs, most GrainTraps answers scored “other” (§5.1) were still grain errors or other misreadings of how the tables relate, which we call data-model errors. Two judges, Claude Opus 5.5 (also a subject model in those runs) and GPT-5.6 Terra, classified each distinct “other” answer (327 distinct queries from 359 runs), seeing the question, its trap explanation and solution, the schema and both results. They agree on the cause for 81% of the answers (𝜅 = 0.72) and on whether it is a grain or data-model error for 86%. Figure 13 shows the causes the Opus judge assigns. Both judges call 210 of the 327 a grain or data-model error (Opus alone, 229), so counting grain errors alone understates how often models misread the data model. Most wrong-grain answers (158 of 166) are rank-then-attach questions, where vague wording leaves some room. Four of the five “other” answers that Opus 5.5 gave as a subject model apply DISTINCT to line rows without the line key and so merge lines that are really distinct, the mirror image of fan-out. Traces of open models given evidence show three reasons

7

DISCUSSION

Lesson 1: Gold queries need a data-grounded review of the whole query. Where BIRD’s gold is distorted, a model that avoids the trap is scored wrong. The review must also cover the hints, which BIRD’s annotators wrote for the distorted gold and which often prescribe the over-count (127 of 229 distorted train questions carry a formula hint); a model that sees the repetition and follows such a hint resolves a conflict between two instructions rather than ignoring the evidence. Fixing only the fan-out left another BIRD error in one in five of our corrected train golds, and fixing these raised measured accuracy on the same questions by 11 points (§6.3). 11

The review itself needs the data, because two reviewers can agree on a fix that returns nothing. Lesson 2: Evidence should state the grain. Per-column counts already reveal keys, repetition (4,185 lines for 1,200 orders in Figure 7) and gaps. Correct FD labels (“can have many”) add nothing beyond them on GrainTraps, or, in our exploratory control, beyond the repetition counts on BIRD. What helps is evidence that supplies the inputs of the grain condition (§2.2): the grain of each measure and how many rows a join repeats, together with where a blank breaks a dependency. MCI-SQL’s small effect for dependency labels [60], measured on accuracy, matches our accuracy results; measuring fan-out errors directly shows a clearer effect. Lesson 3: Fan-out errors should be measured directly. On real questions most errors are not fan-out, and an over-count may also differ in other ways, so accuracy and exact matches understate what evidence does. Judging each wrong answer for fan-out is feasible, since LLM judges, the audit and data-probing agents agree closely (§6.3), though not independently. Future work: facts about the model’s own query. Per-table facts leave the model to combine them across joins, which it often fails to do, while checking the query against the data catches most exact fan-out errors (§6.7). A next step reports, for each relation the model’s query uses, how its joins repeat rows and the grain of each aggregated measure, inferred from per-table dependencies by rules and computed from the data only where the rules leave it open. Unlike ontologies and semantic layers, which need someone to declare the model, such facts come from the data. Limitations.

text is not a part of Grain-FD’s, so their difference is not a clean ablation. FD and FD (tool) differ in both wording and delivery, and the arms differ in length (§6.8). • Labels. No person labelled or checked any data. Column roles and BIRD labels come from LLM judges checked by Claude agents only on samples (one role error removed a needed fact). BIRD’s fan-out errors rest on LLM judges that agree closely with each other, the audit and data-probing agents (the same model as the second judge), and the metric was chosen after the runs, once the gold review showed how many over-counts an exact match misses; the metrics that use no judge agree (Figure 10). The gold review also rests on LLM judges, two of them also subject models (Claude Haiku 5.5 in the first stage, GPT-5.6 Terra in the second). A Claude agent checked it on the 21 golds that prompted it and 5 accepted fixes (4 clearly right, 1 defensible), and every fix that returned no answer was checked on the data. The gold review left 40 questions out of BIRD-FanOut, and 17 distorted questions have no trap query, so their fan-out errors can be judged but never matched exactly. The runs were shown the tables the original golds read; no fixed gold reads any other table. The trace analysis of §6.4 is qualitative, one Claude agent’s coding pass over 40 runs.

8

CONCLUSION

Fan-out errors are silent and common in text-to-SQL, and one condition governs them: a duplicate-sensitive aggregate is correct when each entity at its measure’s grain appears once in the relation it reads. The condition’s inputs, the measure’s grain and the multiplicity that joins induce, are properties of the data that a schema does not show. Tested on the data, the condition exposes distorted gold in a few percent of BIRD’s questions. Supplied to LLM agents as grainaware FDs, its inputs cut LLM-judged fan-out errors on real questions from 18.4% of runs without evidence, and 17.0% with statistics, to 13.1–13.6%; on held-out questions, from 16.1% and 15.1% to 12.2– 12.4%. Accuracy rises by only about 3 points, because the main obstacles that remain are other errors, hints that prescribe the distorted formula, and over-counts too small to show in the data. Checking the model’s own query against the data, as the audit does, is the natural next step. BIRD-FanOut, GrainTraps, the audit and the evidence code are available at https://github.com/ahmed-mahran/misqal.

• Scope. We audited one benchmark family (BIRD dev, train and Mini-Dev), so how much fan-out other benchmarks’ gold contains is open. GrainTraps is small and synthetic, generated by a Claude agent, kept only if strong models could solve its questions, and has no held-out split. Without evidence the two Claude models make the fewest grain errors on it (3 and 5 of 168 runs, against 18 to 70 for the others), so comparisons across models may favour them; the arm effects are measured within each model. We use one dialect (SQLite; the audit uses rowid), two to four models per tier and one run per BIRD question (on GrainTraps, 14.5% of three-run cells in the six main arms have mixed outcomes), and show the model only the tables its reference queries read, which makes the task easier than in practice. • Design. The Grain-FD rules were developed on the design set (GrainTraps and 46 BIRD train questions selected on FD’s outcomes). They are generic, with no question-specific content, and the 183 held-out questions test them, but their trap results are in-sample, no new trap questions were written afterwards, and their four elements were not ablated one by one. The measure grain is a single column, so a measure repeated per pair of columns (6 of 650 BIRD measures checked) is reported as varying by row. The arms ran on different days in November 2026 with the same code, Stats+Rep last with no same-day repeat of the others, so provider-side model updates could shift comparisons between arms, in particular the split between repetition counts and FDs. Stats+Rep was not run on dev, and its

REFERENCES [1] Ziawasch Abedjan, Lukasz Golab, and Felix Naumann. 2015. Profiling Relational Data: A Survey. The VLDB Journal 24, 4 (2015), 557–581. https://doi.org/10.1007/ s00778-015-0389-y [2] Ziawasch Abedjan and Felix Naumann. 2011. Advancing the Discovery of Unique Column Combinations. In Proceedings of the 20th ACM International Conference on Information and Knowledge Management (CIKM). ACM, 1565–1570. https://doi.org/10.1145/2063576.2063801 [3] Dean Allemang and Juan Sequeda. 2024. Increasing the Accuracy of LLM Question-Answering Systems with Ontologies. In The Semantic Web – ISWC 2024, 23rd International Semantic Web Conference, Proceedings, Part III (Lecture Notes in Computer Science), Vol. 15233. Springer, 324–339. https://doi.org/10.1007/9783-031-77847-6_18 arXiv:2405.11706 Preprint: “Increasing the LLM Accuracy for Question Answering: Ontologies to the Rescue!”, arXiv:2405.11706. [4] Anthropic. 2026. System Card: Claude Haiku 5.5. https://www.anthropic.com/ claude-haiku-5-5-system-card. Dated 7 October 2026. [5] Anthropic. 2026. System Card: Claude Opus 5.5. https://www.anthropic.com/ claude-opus-5-5-system-card. Dated 22 September 2026. 12

[30] David Howe. 2001. Data Analysis for Database Design (3rd ed.). ButterworthHeinemann, Oxford. [31] Ykä Huhtala, Juha Kärkkäinen, Pasi Porkka, and Hannu Toivonen. 1999. TANE: An Efficient Algorithm for Discovering Functional and Approximate Dependencies. Comput. J. 42, 2 (1999), 100–111. https://doi.org/10.1093/comjnl/42.2.100 [32] Tengjun Jin, Yoojin Choi, Yuxuan Zhu, and Daniel Kang. 2026. Pervasive Annotation Errors Break Text-to-SQL Benchmarks and Leaderboards. Proceedings of the VLDB Endowment 19, 5 (2026), 931–944. https://doi.org/10.14778/3796195. 3796206 arXiv:2601.08778 Short version: “Text-to-SQL Benchmarks are Broken: An In-Depth Analysis of Annotation Errors”, CIDR 2026. [33] Nikos Karayannidis. 2026. Grain Theory: Type-Level Granularity Correctness in Data Pipelines. arXiv:2601.00995 [cs.DB] https://arxiv.org/abs/2601.00995 v3, 2 October 2026. [34] Ralph Kimball and Margy Ross. 2013. The Data Warehouse Toolkit: The Definitive Guide to Dimensional Modeling (3rd ed.). Wiley, Indianapolis, IN. [35] Anthony C. Klug. 1980. Calculating Constraints on Relational Expressions. ACM Transactions on Database Systems 5, 3 (Sept. 1980), 260–290. https://doi.org/10. 1145/320613.320615 [36] Henning Köhler and Sebastian Link. 2016. SQL Schema Design: Foundations, Normal Forms, and Normalization. In Proceedings of the 2016 International Conference on Management of Data (SIGMOD). ACM, 267–279. https: //doi.org/10.1145/2882903.2915239 [37] Jan Kossmann, Daniel Lindner, Felix Naumann, and Thorsten Papenbrock. 2022. Workload-driven, Lazy Discovery of Data Dependencies for Query Optimization. In 12th Conference on Innovative Data Systems Research (CIDR). Chaminade, CA, USA. https://www.vldb.org/cidrdb/papers/2022/p70-kossmann.pdf [38] Fangyu Lei, Jixuan Chen, Yuxiao Ye, Ruisheng Cao, Dongchan Shin, Hongjin Su, Zhaoqing Suo, Hongcheng Gao, Wenjing Hu, Pengcheng Yin, Victor Zhong, Caiming Xiong, Ruoxi Sun, Qian Liu, Sida Wang, and Tao Yu. 2025. Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows. In The Thirteenth International Conference on Learning Representations (ICLR). arXiv:2411.07763 https://proceedings.iclr.cc/paper_files/paper/2025/ hash/46c10f6c8ea5aa6f267bcdabcb123f97-Abstract-Conference.html [39] Hans-Joachim Lenz and Arie Shoshani. 1997. Summarizability in OLAP and Statistical Data Bases. In Proceedings of the Ninth International Conference on Scientific and Statistical Database Management (SSDBM). IEEE Computer Society, 132–143. https://doi.org/10.1109/SSDM.1997.621175 [40] Jinyang Li, Binyuan Hui, Ge Qu, Jiaxi Yang, Binhua Li, Bowen Li, Bailin Wang, Bowen Qin, Ruiying Geng, Nan Huo, Xuanhe Zhou, Chenhao Ma, Guoliang Li, Kevin C. C. Chang, Fei Huang, Reynold Cheng, and Yongbin Li. 2023. Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLs. In Advances in Neural Information Processing Systems 36 (NeurIPS 2023), Datasets and Benchmarks Track. 42330–42357. https://doi.org/ 10.52202/075280-1835 arXiv:2305.03111 [41] Nathan Mantel and William Haenszel. 1959. Statistical Aspects of the Analysis of Data From Retrospective Studies of Disease. Journal of the National Cancer Institute 22, 4 (1959), 719–748. https://doi.org/10.1093/jnci/22.4.719 [42] Toby Mao. 2026. SQLGlot: Python SQL Parser and Transpiler. GitHub repository, https://github.com/tobymao/sqlglot. Version 30.27.0 used. [43] Jose-Norberto Mazón, Jens Lechtenbörger, and Juan Trujillo. 2009. A survey on summarizability issues in multidimensional modeling. Data & Knowledge Engineering 68, 12 (2009), 1452–1469. https://doi.org/10.1016/j.datak.2009.07.010 [44] NVIDIA. 2026. Auto Ontology. GitHub repository, https://github.com/NVIDIA/ auto-ontology. BIRD evaluation harness in a companion repository, https: //github.com/NVIDIA/ontology-sql-eval. [45] NVIDIA. 2026. Nemotron 3.5 Super and Lightning: Open, Efficient Mixture-ofExperts Hybrid Mamba-Transformer Models for Agentic AI. Technical Report arXiv:2610.38095. NVIDIA. arXiv:2610.38095 [cs.CL] https://arxiv.org/abs/2610. 38095 [46] OpenAI. 2025. gpt-oss-120b & gpt-oss-20b Model Card. Model Card arXiv:2508.10925. OpenAI. arXiv:2508.10925 [cs.CL] https://arxiv.org/abs/2508. 10925 [47] OpenAI. 2026. GPT-5.5 System Card. https://deploymentsafety.openai.com/gpt5-5. Published 23 April 2026; updated 24 April and 19 August 2026. [48] OpenAI. 2026. GPT-5.6 System Card. https://deploymentsafety.openai.com/gpt5-6. Covers GPT-5.6 Sol, Terra and Luna. Published 9 July 2026; updated 3 and 19 August 2026. [49] Thorsten Papenbrock and Felix Naumann. 2016. A Hybrid Approach to Functional Dependency Discovery. In Proceedings of the 2016 International Conference on Management of Data (SIGMOD). ACM, 821–833. https://doi.org/10.1145/ 2882903.2915203 [50] Glenn Norman Paulley. 2000. Exploiting Functional Dependence in Query Optimization. Ph.D. Dissertation. University of Waterloo, Waterloo, Ontario, Canada. https://cs.uwaterloo.ca/research/tr/2000/11/CS-2000-11.thesis.pdf Also Technical Report CS-2000-11, Department of Computer Science, University of Waterloo. [51] Aravind Sasidharan Pillai. 2026. GROUND: Reducing Hallucinations in LLM-Based Enterprise Analytics Through Governed Semantic Definitions. arXiv:2608.26157 [cs.AI] https://arxiv.org/abs/2608.26157

[6] Anthropic. 2026. System Card: Claude Sonnet 5.5. https://www.anthropic.com/ claude-sonnet-5-5-system-card. Dated 28 September 2026. [7] Siegfried Bell and Peter Brockhausen. 1995. Discovery of Data Dependencies in Relational Databases. LS-8 Report 14. Universität Dortmund, Fachbereich Informatik, Lehrstuhl VIII (Künstliche Intelligenz), Dortmund, Germany. https: //d-nb.info/1103028413/34 [8] Laure Berti-Équille, Hazar Harmouch, Felix Naumann, Noël Novelli, and Saravanan Thirumuruganathan. 2018. Discovery of Genuine Functional Dependencies from Relational Data with Missing Values. Proceedings of the VLDB Endowment 11, 8 (2018), 880–892. https://doi.org/10.14778/3204028.3204032 [9] 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 (EMNLP). Association for Computational Linguistics, 7053–7074. https: //doi.org/10.18653/v1/2023.emnlp-main.436 [10] BIRD Team. 2025. BIRD-SQL Dev, cleaned release 2025-11-06 (bird_sql_dev_20251106). Hugging Face dataset, https://huggingface.co/ datasets/birdsql/bird_sql_dev_20251106. [11] BIRD Team. 2026. BIRD-SQL Mini-Dev (2026 update). GitHub repository https:// github.com/bird-bench/mini_dev and Hugging Face dataset https://huggingface. co/datasets/birdsql/bird_mini_dev. 500 questions from BIRD dev, first released 2024; 2026 update released 28 October 2026. Snowflake Cortex Analyst: Preventing Join Hal[12] Yahia Bsat. 2025. lucinations and Double Counting. Snowflake Engineering Blog, https://www.snowflake.com/en/blog/engineering/snowflake-cortex-analystintroducting-joins-complex-schemas/. Published 20 February 2025. [13] Diego Calvanese, Benjamin Cogrel, Sarah Komla-Ebri, Roman Kontchakov, Davide Lanti, Martin Rezk, Mariano Rodriguez-Muro, and Guohui Xiao. 2017. Ontop: Answering SPARQL Queries over Relational Databases. Semantic Web 8, 3 (2017), 471–487. https://doi.org/10.3233/SW-160217 [14] Surajit Chaudhuri and Kyuseok Shim. 1994. Including Group-By in Query Optimization. In Proceedings of the 20th International Conference on Very Large Data Bases (VLDB). Santiago, Chile, 354–366. https://www.vldb.org/conf/1994/ P354.PDF [15] Rohit Chaurasia. 2026. grainguard: Static Detection of Fan Out Aggregates in SQL and dbt. GitHub repository, version 0.1.0, https://github.com/rohitchaurasia195web/GRAINGUARD. [16] Jacob Cohen. 1960. A Coefficient of Agreement for Nominal Scales. Educational and Psychological Measurement 20, 1 (1960), 37–46. https://doi.org/10.1177/ 001316446002000104 [17] Thomas Connolly and Carolyn Begg. 2015. Database Systems: A Practical Approach to Design, Implementation, and Management (6th ed.). Pearson, Harlow. [18] dbt Labs. 2026. Joins. dbt Developer Hub, MetricFlow / dbt Semantic Layer documentation, https://docs.getdbt.com/docs/build/join-logic. [19] DeepSeek-AI. 2026. DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression. Technical Report arXiv:2609.19969. DeepSeek-AI. arXiv:2609.19969 [cs.CL] https://arxiv.org/abs/2609.19969 [20] Minghang Deng, Ashwin Ramachandran, Canwen Xu, Lanxiang Hu, Zhewei Yao, Anupam Datta, and Hao Zhang. 2025. ReFoRCE: A Text-to-SQL Agent with Self-Refinement, Consensus Enforcement, and Column Exploration. arXiv:2502.00675 [cs.CL] https://arxiv.org/abs/2502.00675 [21] Bradley Efron and Robert J. Tibshirani. 1993. An Introduction to the Bootstrap. Chapman & Hall, New York. https://doi.org/10.1201/9780429246593 [22] GLM-5-Team. 2026. GLM-5: from Vibe Coding to Agentic Engineering. Technical Report arXiv:2602.15763. Z.ai. arXiv:2602.15763 [cs.LG] https://arxiv.org/abs/ 2602.15763 GLM-5 series report, cited as requested by the GLM-5.3-Flash model card (https://huggingface.co/zai-org/GLM-5.3-Flash). [23] Google Cloud. 2026. relationship (for joins). Looker documentation, LookML reference, https://docs.cloud.google.com/looker/docs/reference/param-explorejoin-relationship. Declares one_to_one, many_to_one (default), one_to_many or many_to_many per join. [24] Google Cloud. 2026. Understanding Symmetric Aggregates. Looker documentation, https://docs.cloud.google.com/looker/docs/best-practices/understandingsymmetric-aggregates. [25] Google DeepMind. 2026. Gemini 3.1 Pro Model Card. https://deepmind.google/ models/model-cards/gemini-3-1-pro/. Published 19 February 2026. [26] Google DeepMind. 2026. Gemini 3.5 Flash-Lite Model Card. https://deepmind. google/models/model-cards/gemini-3-5-flash-lite/. Published 21 July 2026. [27] Google DeepMind. 2026. Gemini 3.6 Flash Model Card. https://deepmind.google/ models/model-cards/gemini-3-6-flash/. Published 21 July 2026. [28] Omer Hochman. 2026. Your Text-to-SQL Model Isn’t as Wrong as Your Benchmark Says. The Gold SQL Is. DEV Community blog post, https://dev.to/omer_hochman/your-text-to-sql-model-isnt-as-wrong-asyour-benchmark-says-the-gold-sql-is-p16. Published 7 August 2026. [29] Stephan Hoffmann. 2022. SQL Double Counting Resolver. U.S. Patent 11,416,488 B2, https://patents.google.com/patent/US11416488B2/en. Application US16/804,946, filed 28 February 2020, granted 16 August 2022; assignee insightsoftware.com International Unlimited. 13

B

[52] Anik Pramanik, Murat Kantarcioglu, Vincent Oria, and Shantanu Sharma. 2026. DexterSQL: Deep Schema Exploration and Rule-based Correction for Text-toSQL Generation. arXiv:2608.11889 [cs.DB] https://arxiv.org/abs/2608.11889 v2, 8 September 2026. [53] Diptikalyan Saha, Avrilia Floratou, Karthik Sankaranarayanan, Umar Farooq Minhas, Ashish R. Mittal, and Fatma Özcan. 2016. ATHENA: An OntologyDriven System for Natural Language Querying over Relational Data Stores. Proceedings of the VLDB Endowment 9, 12 (2016), 1209–1220. https://doi.org/10. 14778/2994509.2994536 [54] Irina Saparina and Mirella Lapata. 2024. AMBROSIA: A Benchmark for Parsing Ambiguous Questions into Database Queries. In Advances in Neural Information Processing Systems 37 (NeurIPS 2024), Datasets and Benchmarks Track. 90600– 90628. arXiv:2406.19073 [55] Juan Sequeda, Dean Allemang, and Bryon Jacob. 2024. A Benchmark to Understand the Role of Knowledge Graphs on Large Language Model’s Accuracy for Question Answering on Enterprise SQL Databases. In Proceedings of the 7th Joint Workshop on Graph Data Management Experiences & Systems (GRADES) and Network Data Analytics (NDA). ACM, 1–12. https://doi.org/10.1145/3661304.3661901 arXiv:2311.07509 [56] Vladislav Shkapenyuk, Divesh Srivastava, Theodore Johnson, and Parisa Ghane. 2025. Automatic Metadata Extraction for Text-to-SQL. arXiv:2505.19988 [cs.DB] https://arxiv.org/abs/2505.19988 [57] sqlsure. 2026. sqlsure: Semantic Inspector for SQL. GitHub repository, https: //github.com/sqlsure/sqlsure. [58] Daniel Yitian Su, Sophie Yiran Su, Qiang Sun, Yihao Ding, and Wei Liu. 2026. Disentangling Structure and Semantics: How Schema Representation Affects LLM-Based SQL Generation. arXiv:2608.20356 [cs.DB] https://arxiv.org/abs/ 2608.20356 [59] Yoga Sri Varshan Varadharajan, Ajay Yadav, Ritesh Goru, Prateek Chaudhury, Constantine Caramanis, Prateek Jain, Divyateja Pasupuleti, and Sunil Kumar Pandey. 2026. A Cost-Aware Agentic Architecture for NL-to-SQL over Nested Enterprise Schemas, with a New Benchmark. arXiv:2609.04641 [cs.AI] https: //arxiv.org/abs/2609.04641 [60] Qin Wang, Youhuan Li, Suixi Lin, Zhuo Tang, Kenli Li, Peng Peng, Quanqing Xu, and Chuanhui Yang. 2026. MCI-SQL: Text-to-SQL with Metadata-Complete Context and Intermediate Correction. arXiv:2603.13390 [cs.DB] https://arxiv. org/abs/2603.13390 [61] Niklas Wretblad, Fredrik Riseby, Rahul Biswas, Amin Ahmadi, and Oskar Holmström. 2024. Understanding the Effects of Noise in Text-to-SQL: An Examination of the BIRD-Bench Benchmark. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers). Association for Computational Linguistics, 356–369. https://doi.org/10.18653/v1/2024.aclshort.34 [62] Weipeng P. Yan and Per-Åke Larson. 1995. Eager Aggregation and Lazy Aggregation. In Proceedings of the 21st International Conference on Very Large Data Bases (VLDB). Zurich, Switzerland, 345–357. https://www.vldb.org/conf/1995/ P345.PDF [63] 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 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, 3911–3921. https://doi.org/10.18653/ v1/D18-1425 [64] Tingkai Zhang, Chaoyu Chen, Cong Liao, Jun Wang, Xudong Zhao, Hang Yu, Jianchao Wang, Jianguo Li, and Wenhui Shi. 2024. SQLfuse: Enhancing Text-to-SQL Performance through Comprehensive LLM Synergy. arXiv:2407.14568 [cs.CL] https://arxiv.org/abs/2407.14568 [65] Ruiqi Zhong, Tao Yu, and Dan Klein. 2020. Semantic Evaluation for Text-toSQL with Distilled Test Suites. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, 396–411. https://doi.org/10.18653/v1/2020.emnlp-main.29 [66] Tianxin Zhou and Ruixi Lin. 2026. ModularSQL: A Runtime Guardrail for the Multiplicity Blind Spot in Text-to-SQL. arXiv:2609.29573 [cs.CL] https://arxiv. org/abs/2609.29573

A

PROMPT (SHARED BY ALL ARMS)

Every run receives the system prompt and user message below; line breaks are reflowed. Grey text is a placeholder (Figure 7 shows the evidence blocks); the blue instruction appears only in the two tool arms. System prompt You answer questions about a SQLite database using the `execute_sql` tool. Every number you report must come from a query you ran in this turn. If a query fails, check the column and table names against the schema below and fix them. Do not assume how tables and columns relate from their names or from what seems typical: check it in the data, and treat a relationship you have not checked as unknown. Finish by calling `submit_answer` with the exact SQL whose result answers the question and a short answer in words. The submitted SQL must select exactly what the question asks for -- no extra columns (e.g. no counts or ids unless asked) -- with one value per cell (no lists or concatenated values in a column). ## Cardinality evidence (MANDATORY) Before writing your final SQL you MUST run `cardinality_matrix` on EVERY table your query reads, passing the columns your query relies on. Base every relationship between columns that your query depends on, on its result. A submission that reads a table you have not run `cardinality_matrix` on is rejected. ## Database schema <CREATE TABLE statements of the shown tables> User message <question> <evidence block of the Stats, Stats+Rep, FD and Grain-FD arms>

C

PER-MODEL RESULTS

GrainTraps, 168 non-control runs per cell, correct / grain errors (Table 3). Table 3: Per model, GrainTraps (168 non-control runs per cell): correct / grain errors. Bold: fewest grain errors in the row (ties all bold).

model Claude Sonnet 5.5 Claude Haiku 5.5 DeepSeek V4.1 Flash GPT-5.6 Luna GPT-5.6 Terra GLM-5.3-Flash Gemini 3.5 Flash-Lite Nemotron 3.5 Super

no evidence

Stats Stats+Rep

165 / 3 168 / 0 162 / 5 165 / 2 147 / 18 151 / 15 150 / 18 156 / 12 145 / 21 160 / 7 130 / 32 142 / 18 88 / 67 101 / 52 83 / 70 88 / 66

Grain-FD FD FD (tool) Grain-FD (tool)

168 / 0 164 / 4 168 / 0 165 / 1 158 / 4 165 / 2 153 / 11 159 / 8 154 / 11 152 / 14 152 / 16 148 / 18 158 / 9 153 / 13 148 / 19 147 / 12 140 / 13 129 / 24 114 / 35 112 / 44 110 / 42 89 / 63 90 / 61 95 / 60

168 / 0 166 / 0 166 / 0 161 / 5 167 / 0 157 / 7 123 / 39 95 / 61

168 / 0 165 / 0 165 / 1 163 / 3 162 / 5 142 / 15 126 / 31 106 / 49

BIRD-FanOut train, 229 distorted questions (reviewed golds), correct / exact fan-out errors (the answer reproduces the distorted gold or the agreed trap query) (Table 4). Table 4: Per model, BIRD-FanOut train (229 distorted questions): correct / exact fan-out errors. Bold: fewest exact fanout errors in the row.

A SECOND EXAMPLE OF THE EVIDENCE

Figure 7 shows the evidence for a shop question. Figure 14 shows it for a question from supply: “Which products have been ordered in a larger total quantity than the stock we hold of them?” The known tables are products, order_lines and inventory; the measures unit_price, quantity and on_hand are left out of the statistics and the dependency profiles. 14

model

no evidence

Claude Sonnet 5.5 Claude Haiku 5.5 DeepSeek V4.1 Flash GPT-5.6 Luna GPT-5.6 Terra GLM-5.3-Flash Gemini 3.5 Flash-Lite Nemotron 3.5 Super

151 / 26 162 / 18 152 / 22 138 / 31 140 / 27 138 / 28 148 / 22 158 / 15 142 / 28 153 / 22 134 / 37 133 / 33 122 / 45 120 / 48 116 / 29 120 / 30

Stats Stats+Rep

Grain-FD FD FD (tool) Grain-FD (tool)

168 / 11 159 / 20 172 / 8 134 / 32 145 / 29 145 / 29 147 / 25 144 / 23 149 / 21 168 / 8 162 / 9 160 / 13 144 / 25 153 / 20 144 / 24 137 / 21 142 / 19 129 / 30 127 / 37 125 / 46 122 / 43 116 / 32 105 / 36 114 / 30

162 / 15 149 / 29 148 / 20 171 / 5 150 / 20 145 / 21 121 / 42 114 / 27

171 / 8 150 / 28 150 / 19 164 / 7 147 / 20 130 / 24 133 / 34 112 / 29

Stats

Stats+Rep

in the prompt

in the prompt

inventory (181 rows): lot_id 181 distinct; product_id 40 distinct; warehouse_id 4 distinct. order_lines (2397 rows): line_id 2397 distinct; order_id 800 distinct; product_id 40 distinct; warehouse_id 4 distinct. products (40 rows): product_id 40 distinct; product_name 40 distinct; category 5 distinct.

Stats, plus (inventory): - product_id: 1–11 rows per value (mean 4.5); a join on it repeats each matching row that many times - warehouse_id: 39–51 rows per value (mean 45.2); a join on it repeats each matching row that many times

FD

FD (tool)

in the prompt

on request (Nemotron's call)

Table: inventory (181 total rows) Primary keys (inferred): lot_id Hierarchies (1:N chains, coarsest → finest): product_id → lot_id; warehouse_id → lot_id Tested Grains: [ok] Unique: [lot_id, product_id, warehouse_id] (181 distinct) N:1 (source determines exactly one target): lot_id: product_id, warehouse_id 1:N (source fans out to multiple targets): product_id: lot_id; warehouse_id: lot_id M:N (many-to-many — high Cartesian risk): product_id ↔ warehouse_id

cardinality_matrix(table_name='inventory', columns=['lot_id','product_id','warehouse_id','on_hand']) (Not profiled, measure columns: on_hand.) inventory (181 rows). Each row has its own lot_id. - Each product_id can have many warehouse_id. - Each warehouse_id can have many product_id.

Grain-FD

Grain-FD (tool)

in the prompt

FD, plus: Rows per value (identifiers): - product_id: 1–11 rows (mean 4.5); a join on it repeats each matching row that many times - warehouse_id: 39–51 rows (mean 45.2); a join on it repeats each matching row that many times Measures (grain): - on_hand: varies by row

on request

cardinality_matrix(table_name='inventory', columns=['lot_id','product_id','warehouse_id','on_hand']) inventory (181 rows). Each row has its own lot_id. - Each product_id appears on 1–11 rows (4.5 on average): joining another table on product_id repeats each of its matching rows that many times. - Each warehouse_id appears on 39–51 rows (45.2 on average): joining another table on warehouse_id repeats each of its matching rows that many times. - Each product_id can have many warehouse_id. - Each warehouse_id can have many product_id. - Measure on_hand varies from row to row.

Figure 14: The six evidence arms for a second GrainTraps question (“Which products have been ordered in a larger total quantity than the stock we hold of them?”, table inventory), copied from the run traces of GPT-5.6 Terra (the FD (tool) call is Nemotron 3.5 Super’s), with markdown marks dropped and the many-to-many arrow drawn as ↔. Rows: statistics, FDs and grain-aware FDs; columns: in the prompt and by tool. Blue: what an arm adds over its reference arm; grey italics: the model’s tool call. • Gold review (§4). Of the 421 train golds, 80 were fixed (56 distorted, 24 intended) and 37 were left out: 27 disputed by the judges, 10 broken or without a fan-out signal. Twelve accepted fixes returned nothing, 0 or NULL and were checked on the data: two were corrected, nine were left out (an answer of 0 or NULL cannot show fan-out, or the question was ambiguous) and one was kept. • Robustness to the gold review (§6.3). The review came after all runs but those of Stats+Rep, which were re-scored. It barely moved the fan-out results: Grain-FD cuts fan-out errors by 3.9 points beyond Stats on the original golds and by 3.4 after the review, Grain-FD (tool) by 4.1 and 3.9. It moved accuracy more, because gold errors had marked correct answers wrong: without evidence, from 49.1% to 60.3% on distorted questions and from 68.7% to 78.8% on intended ones. On the original golds, the accuracy gains over Stats were +1.9 points (p = .018) and +1.4 (p = .20). After the review, the judges still call 6.5% of runs acceptable answers that the gold does not match; we count these as wrong. • Judged fan-out (§6.3). Where Gemini and the audit disagreed, Opus mostly sided with Gemini: it confirmed 208 of the 239 answers Gemini called fan-out that the audit did not flag, and rejected 16 of the 20 flagged answers Gemini did not call fan-out. Given answers equal to the distorted gold, Gemini called 294 of 300 fan-out. Re-judging every distinct answer of all seven arms in one batch agreed with the original labels on 98.7% and changed no conclusion.

BIRD-FanOut train, fan-out errors (exact plus other answers judged to over-count; §6.3) (Table 5). Table 5: Per model, BIRD-FanOut train, fan-out errors. Bold: fewest in the row.

model Claude Sonnet 5.5 Claude Haiku 5.5 DeepSeek V4.1 Flash GPT-5.6 Luna GPT-5.6 Terra GLM-5.3-Flash Gemini 3.5 Flash-Lite Nemotron 3.5 Super

D

Grain-FD FD no evidence Stats Stats+Rep FD (tool) Grain-FD (tool) 31 32 36 37 43 46 64 48

22 42 39 20 32 47 65 45

15 42 35 12 36 36 53 47

24 39 34 15 30 26 60 52

10 37 28 18 31 37 60 49

20 33 26 8 28 30 60 45

10 35 31 11 27 39 45 42

SUPPORTING RUNS AND CHECKS • Full-schema runs (§5.2). The eight models of §5.2 ran no evidence, FD and FD (tool) with the whole database shown and measures included in the evidence. On GrainTraps, evidence cut grain errors by 5–12 points for the four smaller models and by 4–5 points for the four larger ones, almost all on NULL splits. On the 150 ordinary Mini-Dev questions it did no harm (accuracy with FD (tool) +1.0 points [−2.0, +4.2]). • Design set (§5.2). The Grain-FD rules were developed on a pilot of 350 runs: the GrainTraps questions where FD did worse than Stats, the NULL-split questions, and 49 BIRD train questions where FD changed Haiku’s or Luna’s outcome (46 remain after the gold review). The pilot runs are part of the reported results; all other Grain-FD runs came after the rules were fixed. 15

E

FULL RESULTS TABLES

These tables give the exact numbers behind Figures 8, 9, 10 and 13. Comparisons read “tested arm vs reference”; grain and fan-out errors are given as points avoided (positive is better), accuracy as points gained (Table 6). Table 6: GrainTraps without evidence: correct runs and grain errors out of 168 non-control runs per model, and the share of runs that ran a checking query (Figure 8). Bold: the best in each column. tier

model

low-error low-error mid-error mid-error mid-error mid-error high-error high-error

Claude Sonnet 5.5 Claude Haiku 5.5 DeepSeek V4.1 Flash GPT-5.6 Luna GPT-5.6 Terra GLM-5.3-Flash Gemini 3.5 Flash-Lite Nemotron 3.5 Super

correct

grain errors

runs that ran a checking query

165 162 147 150 145 130 88 83

3 5 18 18 21 32 67 70

98% 95% 67% 32% 27% 37% 21% 11%

Table 7: GrainTraps, grain errors avoided by the tested arm (points, 95% interval), then base questions with fewer / more grain errors (a question and its vague twin count as one); for all tiers, permutation 𝑝 (Figure 9, left). comparison

low-error

mid-error

high-error

all

Stats vs no evidence FD vs Stats FD (tool) vs Stats Grain-FD vs Stats Grain-FD (tool) vs Stats Stats+Rep vs Stats Grain-FD vs Stats+Rep Grain-FD (tool) vs Stats+Rep

+1.8 [+0.0, +4.5], 2/0 − 1.8 [ − 5.6, +0.0], 0/1 0.0 [ − 1.2, +1.5], 1/2 +0.6 [+0.0, +1.8], 1/0 +0.6 [+0.0, +1.8], 1/0 +0.3 [+0.0, +0.9], 1/0 +0.3 [+0.0, +0.9], 1/0 +0.3 [+0.0, +0.9], 1/0

+5.5 [+0.9, +11.5], 9/4 +0.3 [ − 5.7, +5.8], 8/2 − 3.0 [ − 8.2, +0.8], 5/8 +6.0 [+1.8, +11.8], 10/1 +4.2 [ − 0.1, +10.3], 7/5 +0.9 [ − 1.7, +3.4], 8/3 +5.1 [+0.6, +11.1], 8/2 +3.3 [ − 1.2, +9.6], 7/5

+5.7 [ − 0.6, +12.7], 13/9 +3.9 [ − 0.6, +8.0], 13/6 +4.8 [+0.0, +9.8], 13/6 +5.4 [ − 0.6, +11.5], 15/6 +11.3 [+4.5, +18.5], 16/4 +6.0 [+1.2, +10.7], 14/5 − 0.6 [ − 7.2, +5.7], 11/8 +5.4 [ − 0.6, +12.0], 11/9

+4.6 [+1.3, +8.6], 15/7, p = .015 +0.7 [ − 3.6, +4.0], 15/7, p = .78 − 0.3 [ − 3.2, +2.0], 12/8, p = .88 +4.5 [+1.3, +8.3], 15/6, p = .012 +5.1 [+1.9, +8.9], 15/5, p = .003 +2.0 [+0.6, +3.4], 15/6, p = .019 +2.5 [ − 0.6, +6.1], 14/7, p = .19 +3.1 [+0.1, +6.7], 10/6, p = .089

Table 8: GrainTraps, accuracy gain of the tested arm (points, 95% interval), then base questions with more / fewer correct runs; for all tiers, permutation 𝑝. comparison

low-error

mid-error

high-error

all

Stats vs no evidence FD vs Stats FD (tool) vs Stats Grain-FD vs Stats Grain-FD (tool) vs Stats Stats+Rep vs Stats Grain-FD vs Stats+Rep Grain-FD (tool) vs Stats+Rep

+1.8 [+0.0, +4.5], 2/0 − 3.3 [ − 7.6, − 0.6], 0/5 0.0 [ − 1.2, +1.5], 1/2 +0.3 [ − 1.2, +1.9], 2/2 0.0 [ − 1.8, +1.8], 1/1 0.0 [ − 0.9, +0.9], 1/1 +0.3 [ − 1.2, +2.0], 2/2 0.0 [ − 1.5, +1.2], 2/1

+5.5 [+1.2, +11.0], 12/5 − 0.7 [ − 6.7, +4.8], 9/7 − 4.5 [ − 9.5, − 0.4], 5/11 +6.2 [+1.8, +12.3], 11/4 +3.4 [ − 1.3, +10.0], 9/8 +0.1 [ − 2.9, +3.2], 8/9 +6.1 [+1.1, +12.4], 12/4 +3.3 [ − 1.5, +9.8], 10/9

+5.4 [ − 0.9, +12.6], 13/7 +3.9 [ − 0.6, +8.2], 13/8 +4.8 [ − 0.6, +9.9], 16/6 +8.6 [+2.3, +15.2], 15/6 +12.8 [+5.7, +20.0], 18/3 +4.2 [ − 0.6, +8.8], 14/9 +4.5 [ − 2.9, +10.9], 16/7 +8.6 [+1.8, +15.5], 14/8

+4.5 [+1.5, +8.3], 16/5, p = .011 − 0.2 [ − 4.4, +3.2], 13/12, p = .94 − 1.0 [ − 4.3, +1.5], 13/10, p = .58 +5.4 [+2.0, +9.2], 16/7, p = .006 +4.9 [+1.4, +8.9], 16/4, p = .010 +1.1 [ − 0.9, +3.1], 15/10, p = .34 +4.2 [+0.7, +8.3], 17/7, p = .045 +3.8 [+0.3, +8.0], 13/7, p = .067

Table 9: BIRD-FanOut train (229 distorted questions, 1,832 runs per arm), fan-out errors avoided by the tested arm (points; positive is better), questions with fewer / more fan-out runs; for all tiers, 95% interval and permutation 𝑝; tiers are descriptive (Figure 9, right). comparison

low-error

mid-error

high-error

all

Stats vs no evidence FD vs Stats FD (tool) vs Stats Grain-FD vs Stats Grain-FD (tool) vs Stats Stats+Rep vs Stats Grain-FD vs Stats+Rep Grain-FD (tool) vs Stats+Rep

− 0.2, 8/12 +0.2, 11/10 +3.7, 22/6 +2.4, 19/9 +4.1, 25/8 +1.5, 13/7 +0.9, 12/9 +2.6, 17/6

+2.6, 38/25 +3.6, 39/13 +2.6, 45/23 +5.0, 43/12 +3.3, 40/19 +2.1, 36/21 +2.9, 34/14 +1.2, 32/26

+0.4, 23/20 − 0.4, 22/24 +0.2, 25/24 +1.1, 26/21 +5.0, 32/11 +2.2, 26/20 − 1.1, 25/28 +2.8, 35/20

+1.4 [ − 0.1, +2.9], 49/39, p = .087 +1.7 [+0.3, +3.2], 48/30, p = .028 +2.3 [+0.8, +3.7], 58/33, p = .004 +3.4 [+1.9, +4.9], 59/26, p < .001 +3.9 [+2.2, +5.6], 67/29, p < .001 +2.0 [+0.5, +3.4], 49/35, p = .013 +1.4 [+0.3, +2.6], 54/28, p = .024 +2.0 [+0.6, +3.4], 57/29, p = .007

16

Table 10: BIRD-FanOut train, fan-out errors avoided against the statistics with and without the LLM judges, and grain errors (points), questions with fewer / more fan-out runs, permutation 𝑝; all 229 distorted questions and the 183 held-out questions (Figure 10). fan-out metric

Grain-FD vs Stats, 229

Grain-FD (tool) vs Stats, 229

Grain-FD vs Stats, 183

Grain-FD (tool) vs Stats, 183

exact only exact + audit flags exact + judged (primary) grain errors (exact + judged fan-out or wrong grain)

+2.5, 44/18, p < .001 +3.1, 57/25, p < .001 +3.4, 59/26, p < .001 +3.1, 60/31, p < .001

+3.1, 46/19, p < .001 +3.3, 59/27, p < .001 +3.9, 67/29, p < .001 +3.7, 66/34, p < .001

+1.8, 31/14, p = .008 +2.2, 42/21, p = .004 +2.7, 44/21, p < .001 +2.4, 45/25, p = .007

+2.4, 32/15, p = .002 +2.5, 43/23, p = .002 +2.9, 49/27, p = .001 +2.7, 48/30, p = .004

Table 11: BIRD-FanOut train, fan-out errors per arm on the 183 held-out questions (1,464 runs per arm; Figure 10). Bold: fewest. questions

no evidence

Stats

FD

FD (tool)

Grain-FD

Grain-FD (tool)

183 held out

236

221

204

189

181

179

Table 12: Causes of the “other” trap answers (Opus judge; full-schema runs; Figure 13). cause (Opus judge)

distinct answers

wrong grain (ranked or broken down at another grain than asked) misread question SQL mistake (20 are NULL handling) over-count not matching the naive SQL under-count: real rows removed as duplicates acceptable reading the gold rejects

166 53 44 43 20 1

17

Related documents

Record · ID 1767924 · SHA-256 fd67605484477bc3
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive