mlsanityData to 14 Oct 2026

Beyond the Harness: End-to-End Optimization of Context Artifacts for Enterprise Text-to-SQL

arXiv 2608.22830 ↗First posted 24 Aug 2026cs.AI cs.LGcited by 0

Not on the map. Why?

Abstract (arXiv)

Deploying LLMs for enterprise Text-to-SQL is bottlenecked less by the model than by what context reaches it: business logic spans thousands of tables, and no model can ingest a full catalog at once. We argue that the most effective place to intervene is therefore the knowledge-base context the model consumes, and that this context should be constructed from historical usage rather than tuned for as a fixed input. Using a query-DAG decomposition--the same family of intermediates that enterprise benchmarks like BEAVER annotate, here recovered from production SQL--we compare the value of oracle query graphs versus retrieved knowledge-base context. In this ablation, retrieved knowledge-base context provides the largest marginal improvement when added to the full oracle graph. Building on this, we optimize a distillation procedure that turns historical query profiles into reusable SQL reference cards. On a benchmark of 5176 production queries from a major online retailer, optimizing these context artifacts yields larger gains (~12--25% AST similarity) than optimizing the retrieval harness (~3--12%). On the public BEAVER benchmark, which lacks the production-usage signals available in our internal setting, the picture is more mixed: table cards alone perform about the same as raw historical SQL. The best optimized variant retrieves both cards and raw SQL, scoring 9.00% versus 6.33% (p-value 0.12) for the comparable baseline on a held-out N=300 subset, using retrieved context and harness changes but no agentic loop.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 27 of its 31 references that are in the map. First posted on arXiv 24 Aug 2026.

Builds on

27 of 31 references.

References · 27

  1. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
  2. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  3. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
  4. 2025AlphaEvolve: A coding agent for scientific and algorithmic discoverycited by 867
  5. 2023DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelinescited by 832
  6. 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 688
  7. 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 477
  8. 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 424
  9. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 411
  10. 2024Automated Design of Agentic Systemscited by 407
  11. 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 385
  12. 2026Meta-Harness: End-to-End Optimization of Model Harnessescited by 309
15 more
  1. 2024Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programscited by 291
  2. 2024TextGrad: Automatic "Differentiation" via Textcited by 273
  3. 2024Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflowscited by 232
  4. 2019Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representationcited by 210
  5. 2023RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLcited by 195
  6. 2024LLMs Still Can't Plan; Can LRMs? A Preliminary Evaluation of OpenAI's o1 on PlanBenchcited by 94
  7. 2018Robust Text-to-SQL Generation with Execution-Guided Decodingcited by 52
  8. 2024BEAVER: An Enterprise Benchmark for Text-to-SQLcited by 42
  9. 2025ReFoRCE: A Text-to-SQL Agent with Self-Refinement, Consensus Enforcement, and Column Explorationcited by 37
  10. 2023Evaluating Cross-Domain Text-to-SQL Models and Benchmarkscited by 32
  11. 2026AgentSM: Semantic Memory for Agentic Text-to-SQLcited by 14
  12. 2024FLEX: Expert-level False-Less EXecution Metric for Reliable Text-to-SQL Benchmarkcited by 11
  13. 2025Knowledge Base Construction for Knowledge-Augmented Text-to-SQLcited by 9
  14. 2024ETM: Modern Insights into Perspective on Text-to-SQL Evaluation in the Age of Large Language Modelscited by 3
  15. 2025TailorSQL: An NL2SQL System Tailored to Your Query Workloadcited by 3

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Database Context Compression for Text-to-SQL on Real-World Large Databases
  2. 2026Knowledge Distillation for Low-Resource Open-source Text-to-SQL Model
  3. 2026GROUND: Reducing Hallucinations in LLM-Based Enterprise Analytics Through Governed Semantic Definitions
  4. 2025GenEdit: Compounding Operators and Continuous Improvement to Tackle Text-to-SQL in the Enterprise
  5. 2025ORANGE: An Online Reflection ANd GEneration framework with Domain Knowledge for Text-to-SQL
  6. 2024The Death of Schema Linking? Text-to-SQL in the Age of Well-Reasoned Language Models
  7. 2026CSR-RAG: An Efficient Retrieval System for Text-to-SQL on the Enterprise Scale
  8. 2025Text-to-SQL as Dual-State Reasoning: Integrating Adaptive Context and Progressive Generation