mlsanityData to 24 Nov 2026

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

arXiv 2611.29009 ↗Submitted 21 Nov 2026Announced 24 Nov 2026cs.DB cs.AI cs.CLcited by 0

Not on the map. Why?

Abstract (arXiv)

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

Key facts. No citing papers in the map yet (data through 24 Nov 2026). Builds on 19 of its 66 references that are in the map. Submitted 21 Nov 2026, announced 24 Nov 2026.

Builds on

19 of 66 references.

References · 19

  1. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,205
  2. 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 747
  3. 2026GLM-5: from Vibe Coding to Agentic Engineeringcited by 740
  4. 2020Semantic Evaluation for Text-to-SQL with Distilled Test Suitescited by 137
  5. 2024AMBROSIA: A Benchmark for Parsing Ambiguous Questions into Database Queriescited by 43
  6. 2023Benchmarking and Improving Text-to-SQL Generation under Ambiguitycited by 42
  7. 2025ReFoRCE: A Text-to-SQL Agent with Self-Refinement, Consensus Enforcement, and Column Explorationcited by 42
  8. 2024Understanding the Effects of Noise in Text-to-SQL: An Examination of the BIRD-Bench Benchmarkcited by 39
  9. 2025Automatic Metadata Extraction for Text-to-SQLcited by 31
  10. 2023A Benchmark to Understand the Role of Knowledge Graphs on Large Language Model's Accuracy for Question Answering on Enterprise SQL Databasescited by 30
  11. 2026Pervasive Annotation Errors Break Text-to-SQL Benchmarks and Leaderboardscited by 20
  12. 2024SQLfuse: Enhancing Text-to-SQL Performance through Comprehensive LLM Synergycited by 8
7 more
  1. 2026Grain Theory: Type-Level Granularity Correctness in Data Pipelinescited by 2
  2. 2026GROUND: Reducing Hallucinations in LLM-Based Enterprise Analytics Through Governed Semantic Definitionscited by 2
  3. 2026MCI-SQL: Text-to-SQL with Metadata-Complete Context and Intermediate Correctioncited by 1
  4. 2026DexterSQL: Deep Schema Exploration and Rule-based Correction for Text-to-SQL Generationcited by 1
  5. 2026Disentangling Structure and Semantics: How Schema Representation Affects LLM-Based SQL Generationcited by 1
  6. 2026A Cost-Aware Agentic Architecture for NL-to-SQL over Nested Enterprise Schemas, with a New Benchmarkcited by 1
  7. 2026ModularSQL: A Runtime Guardrail for the Multiplicity Blind Spot in Text-to-SQLcited by 1

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2024Lucy: Think and Reason to Solve Text-to-SQL
  2. 2025SQLForge: Synthesizing Reliable and Diverse Data to Enhance Text-to-SQL Reasoning in LLMs
  3. 2024From Natural Language to SQL: Review of LLM-based Text-to-SQL Systems
  4. 2024BEAVER: An Enterprise Benchmark for Text-to-SQL
  5. 2026BatchDAG: LLM-Planned Execution Graphs for Scalable Ad-Hoc Analysis Over Enterprise Data
  6. 2025Weaver: Interweaving SQL and LLM for Table Reasoning
  7. 2025BAPPA: Benchmarking Agents, Plans, and Pipelines for Automated Text-to-SQL Generation
  8. 2026Integrating Reasoning and Generalization in Text-to-SQL via Self-Enhanced Fine-Tuning