Tracing Recurrent and Emergent Hallucination Patterns in Decomposed Text-to-SQL Generation
Organizations: The Pennsylvania State University · Microsoft
Abstract
Large language models can achieve strong Text-to-SQL benchmark performance while still producing schema and query-logic errors. Most evaluations characterize such failures only in the final generated query, making it difficult to determine whether a related error was also observed in an earlier, simpler step or appears only at the final stage. We present a drill-down evaluation framework that decomposes Text-to-SQL queries into progressively more complex executable sub-queries and corresponding natural-language questions, allowing rule-based hallucination categories to be examined across a generation path. We distinguish recurrent hallucinations, in which the same rule-based category is observed in an earlier step and again in the final query, from emergent hallucinations, in which the category is observed at the final step without an earlier detection in the same path. Across five LLMs evaluated on an expanded BIRD-mini benchmark, several categories show appreciable recurrence probabilities, while clause abuse shows comparatively higher conditional emergence. Under the conversational-history condition, recurrence probabilities are generally higher and emergence probabilities are generally lower. These observations indicate that the two conditional measures do not move uniformly in the same direction under additional context and motivate trajectory-level analysis in addition to final-output evaluation. Code and evaluation artifacts are available in the project repository. https://github.com/HaydenMM/bird-mini-drilldown
Figures & tables
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Category | Description |
|---|---|
| Schema-Based: Schema Contradiction | The rule flags predicted tables, columns, or aliases not supported by the database schema, together with selected wildcard or backtick patterns handled by the implementation. |
| Schema-Based: Attribute Overanalysis | The rule flags additional valid tables or columns that appear in the prediction but not in the reference SQL, serving as an operational indicator of possible over-specification. |
| Schema-Based: Value Misrepresentation | The rule flags selected differences in literal values or type-casting behavior between the prediction and reference SQL. |
| Logic-Based: Join Redundancy | The rule flags predictions containing more JOIN operations than the reference SQL, indicating additional relational structure under this operational definition. |
| Logic-Based: Clause Abuse | The rule flags selected structural SQL clauses (e.g., GROUP BY , LIMIT , ORDER BY ) or logical operators (e.g., AND , OR ) that appear in the prediction but not in the reference SQL. |
| Logic-Based: Mathematical Delusion | The rule flags selected mathematical or operator patterns, including division without casting, use of % , selected uses of BETWEEN , or parser-detected malformed arithmetic structures. |
| Category | Description |
|---|---|
| Recurrent Hallucination | A rule-based hallucination category detected in at least one earlier step and again in the final step. |
| Emergent Hallucination | A rule-based hallucination category detected in the final step with no earlier detection of that category in the same path. |
| Model | Simple | Moderate | Challenging | Total |
|---|---|---|---|---|
| Count | 148 | 250 | 102 | 500 |
| Claude-3.5-Sonnet | 56.08 | 35.20 | 23.53 | 39.00 (EX) |
| 59.39 | 38.61 | 31.15 | 43.24 (F1) | |
| Claude-3.5-Sonnet (+ History) | 50.00 | 34.40 | 20.59 | 36.20 (EX) |
| 56.93 | 37.84 | 29.01 | 41.69 (F1) | |
| Claude-3.7-Sonnet | 51.35 | 38.40 | 21.57 | 38.80 (EX) |
Hallucination in Language Models
Hallucination in language models studies how systems produce unsupported or false claims and how to detect, explain, and reduce them.
See all 253 papers