Researchers flag hidden double-counting in Text-to-SQL queries and benchmarks
An arXiv paper shows how joins can silently inflate SUM and COUNT results in LLM-based database systems, and offers a fix that cuts these errors on the BIRD benchmark.
In plain words
Text-to-SQL systems turn questions into database queries. When a query joins tables where one record matches many rows, totals can count the same thing several times, yet the result still looks believable. The authors propose telling models the 'grain' of each measure so queries avoid this trap.
What was announced
The paper, posted on arXiv, describes 'fan-out' errors: when a join repeats an entity across rows, aggregates such as SUM or COUNT tally it multiple times while the query still returns a plausible figure. The authors say a schema alone does not reveal the two facts needed to spot the problem, namely each measure's grain and how often each key repeats. Their audit, which tests the condition directly on data, found distorted gold answers for 4.2% of BIRD's development questions, a widely used benchmark. BIRD's later independent revision changed 44% of answers the audit marked as definite fan-out, versus 16% of unflagged ones.
Across seven other benchmarks, distorted gold answers were no more frequent than in BIRD on public data, but reached 9-24% of golds in two enterprise databases. The team released BIRD-FanOut, 486 BIRD questions with reviewed gold answers, plus GrainTraps, synthetic questions built around this trap. In tests over eight LLM agents, ordinary functional dependencies derived from data helped no more than per-column statistics, but grain-aware FDs, which also state each measure's grain and per-key repetition, cut fan-out errors on BIRD from 18.4% of runs to roughly 13%, including on held-out questions and without LLM judges. Overall accuracy improved less, since most remaining errors were not fan-out and BIRD's hints often prescribed the over-count.
What it does not show
- The source is the paper's abstract only, so methods, evaluation details and full results cannot be verified from the supplied text.
- Reported error rates and improvements come from the authors' own tests and have not been independently confirmed.
- The abstract does not state which LLM agents or model versions were tested beyond their number.
For security and IT teams
- Scope
- The findings cover Text-to-SQL aggregation over one-to-many and many-to-many joins, with released artifacts including BIRD-FanOut, GrainTraps and code on GitHub.
Sources
Source-support review completed 5 Dec 2026. This story was drafted with AI assistance and checked against retained source passages. Automated checking is not independent verification.
Coverage: arXiv: abstract.
Updates and corrections
No corrections so far.
First published 5 Dec 2026
New to the subject? AI from the Ground Up starts from the beginning.