Fundamental Challenges in Evaluating Text2SQL Solutions and Detecting Their Limitations

Cedric Renggli, Ihab Francis Ilyas, Theo RekatsinasMar 2025

Problem

Teams that build or buy a text-to-SQL assistant usually trust one aggregate benchmark accuracy. That number mixes four sources of error: the model, the prompt input, wrong or ambiguous reference queries, and a match function that only approximates SQL equivalence. If they are not separated, nobody knows what to fix, and a higher score may just mean a more lenient scorer. The paper names two largely unaddressed limitations of open benchmarks: data quality problems from ambiguity in natural language, and bias from the match function.

Example from the article: a university table has a column "rank" whose meaning is unclear. The correct filter is "rank >= 5", but models predict "rank <= 5" (per the paper).

Solution in brief

The authors propose one taxonomy of causes of prediction errors and evaluation errors, in three groups: the text-to-SQL solution, the evaluation data and the evaluation metric. Each category has real examples and a mitigation. Use it as a checklist for error analysis, not as an automatic detector.

Questions this case answers
  • How to attribute errors of a natural-language-to-query system to the model, the input preparation, the reference labels or the scoring rule, when a single aggregate score hides all four
  • How to evaluate generated queries against a single reference when several different queries are equally valid answers
  • How to find out why a text-to-SQL system fails: the model, the prompt pipeline, the benchmark labels or the scoring function?
  • How to check whether an aggregate benchmark accuracy for text-to-SQL can be trusted?

Tools and methods

  • Limitation taxonomy — checklist for assigning each wrong or missing prediction to a cause.
  • Match functions (semantic match, execution match) — approximations of SQL equivalence, each with a known error direction.
  • Multi-LLM noisy-sample detector — several LLMs propose alternative SQL for each question to flag suspicious reference queries for human review.
Continue reading — it's free

Google or a one-time email code. No password.