Know Your Context Bank: Repairing Inconsistency and Measuring Generalization in Context-Aware Text-to-SQL
Not on the map. Why?
Abstract (arXiv)
Text-to-SQL systems increasingly rely on context banks: curated collections of example queries, metric definitions, and domain knowledge that tell a model how an organization writes its queries. In the enterprise, a bank grows over years as many analysts add entries, checked one at a time for correctness (does the SQL answer its own question?) and rarely for consistency with one another. Yet correctness is often loosely defined: a question seldom fixes how an entity is counted or which table defines it, so two entries can each pass review yet resolve the same decision in opposite ways. We call this condition context bank rot. A second question follows: does a system that uses a bank generalize from it, or only reproduce it? Existing benchmarks cannot tell, as they do not control how far a test question sits from the context. We answer both questions by comparing queries decision by decision, with a fast scorer distilled from human-calibrated LLM judges. Turned inward, the comparison diagnoses and repairs a bank. Fine-tuning on a cleaned BIRD-train bank beats a same-size random subset at every epoch (+2.6 points on average), and 92.4% of our removals had their SQL corrected by an independent expert audit, against 45.6% of audited entries. In-context examples that follow one convention beat those following the opposite one by 13.3 points, while a mix is barely better than none. Turned outward, the comparison generates test questions at a controlled distance from a bank, a pipeline we call CAT (Context-Aware Testing). On CAT-BIRD, for retrieval and fine-tuning alike, the benefit of a bank falls step by step with distance and is largely gone once about three quarters of a question's logic is new, and on CAT-Spider the benefit of retrieval likewise shrinks with distance.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Builds on 41 of its 54 references that are in the map. Submitted 19 Nov 2026, announced 23 Nov 2026.
Builds on
41 of 54 references.
References · 41
- 2020Language Models are Few-Shot Learnerscited by 33,113
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 15,591
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,789
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,881
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,454
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,205
- 2023Teaching Large Language Models to Self-Debugcited by 1,049
- 2023Semantic Uncertainty: Linguistic Invariances for Uncertainty Estimation in Natural Language Generationcited by 884
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 747
- 2022Decomposed Prompting: A Modular Approach for Solving Complex Taskscited by 585
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 503
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 407
29 more
- 2019Measuring Compositional Generalization: A Comprehensive Method on Realistic Datacited by 297
- 2023LEVER: Learning to Verify Language-to-Code Generation with Executioncited by 247
- 2023RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLcited by 204
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 196
- 2019CoSQL: A Conversational Text-to-SQL Challenge Towards Cross-Domain Natural Language Interfaces to Databasescited by 191
- 2023MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQLcited by 184
- 2024CHESS: Contextual Harnessing for Efficient SQL Synthesiscited by 181
- 2024CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQLcited by 151
- 2020Compositional Generalization and Natural Language Variation: Can a Semantic Parsing Approach Handle Both?cited by 149
- 2020Structure-Grounded Pretraining for Text-to-SQLcited by 131
- 2021Towards Robustness of Text-to-SQL Models against Synonym Substitutioncited by 117
- 2017Learning a Neural Semantic Parser from User Feedbackcited by 102
- 2025OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scalecited by 101
- 2021Exploring Underexplored Limitations of Cross-Domain Text-to-SQL Generalizationcited by 97
- 2025SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learningcited by 78
- 2025Reasoning-SQL: Reinforcement Learning with SQL Tailored Partial Rewards for Reasoning-Enhanced Text-to-SQLcited by 67
- 2024DTS-SQL: Decomposed Text-to-SQL with Small Large Language Modelscited by 51
- 2025Arctic-Text2SQL-R1: Simple Rewards, Strong Reasoning in Text-to-SQLcited by 47
- 2025XiYan-SQL: A Novel Multi-Generator Framework For Text-to-SQLcited by 47
- 2023Benchmarking and Improving Text-to-SQL Generation under Ambiguitycited by 42
- 2024Understanding the Effects of Noise in Text-to-SQL: An Examination of the BIRD-Bench Benchmarkcited by 39
- 2023Evaluating Cross-Domain Text-to-SQL Models and Benchmarkscited by 34
- 2025Automatic Metadata Extraction for Text-to-SQLcited by 31
- 2024PRACTIQ: A Practical Conversational Text-to-SQL dataset with Ambiguous and Unanswerable Queriescited by 23
- 2022Measuring and Improving Compositional Generalization in Text-to-SQL via Component Alignmentcited by 17
- 2023SQLPrompt: In-Context Text-to-SQL with Minimal Labeled Datacited by 17
- 2025ODIN: A NL2SQL Recommender to Handle Schema Ambiguitycited by 6
- 2025Confidence Estimation for Text-to-SQL in Large Language Modelscited by 6
- 2026Human-Level Text-to-SQL via Reinforcement Learning on Verified Data, Without Pipeline Engineeringcited by 4
Built on by
Not cited yet.