titleMEM-SQL: Memory-Empowered Text-to-SQL
authorsXiaoqi Wang, Wenqi Pei, Shizheng Hou, Yilai Liu, Han Chen, Boyan Li, Yuyu Luo, Hongyang Du
date2026-11-13
venuearXiv (preprint, not peer reviewed)
idarXiv:2611.18338
affiliationThe University of Hong Kong
upvotes17 (Hugging Face Daily Papers, 2026-11-18)
linksabs pdf hf
cite
relatedRecursive Game Creator: An Agentic Product-Level Experience-Oriented Game Harness
PlayWorld: Benchmarking World Models with Agent Players over Long-Horizon Objectives
OScaR: The Occam's Razor for Extreme KV Cache Quantization in LLMs and Beyond
UniClawBench: A Universal Benchmark for Proactive Agents on Real-World Tasks
Execution Before Memory: Diagnosing Memory Failures in Video World Models
abstractText-to-SQL systems translate natural language questions into SQL queries over increasingly complex databases. However, widely used benchmarks evaluate questions independently, overlooking settings where earlier queries over the same database can supply joins or calculations for a new question. We introduce HARE (History-AwaRe Text-to-SQL BEnchmark) to measure the accuracy and cost of adapting historical SQL. HARE comprises 1,600 requests derived from a fixed pool of 823 verified queries across four datasets. Annotations record which components each request preserves and which edits it requires, distinguishing whole-query adaptation from partial reuse. Our method, MEM-SQL (Memory-EMpowered Text-to-SQL), stores whole-query templates, reusable SQL blocks, and mappings from domain concepts to schema elements. MEM-SQL uses a layer only if every requirement assigned to it has a match above that layer's threshold. With On-demand Schema Linking (OSL), MEM-SQL consults the schema only when no layer qualifies or the generator judges retrieved evidence insufficient. Across six language models on HARE, mean execution accuracy rises from 37.1% for Direct Generation without history to 50.0% for MEM-SQL, with 76.6% fewer input tokens and 68.8% lower latency on average. Further analysis shows that requests reusing several verified queries remain a bottleneck, with accuracy falling from 56.7% to 29.7%, most sharply when reused components must be placed in a new query structure or combined with a shared join. Applying OSL to three other memory designs consistently reduces generation cost, while its accuracy benefit depends on the memory design. Verified history can thus make generation both more accurate and cheaper, but its value depends on the evidence retained and when the system consults the schema.

bibtex

@misc{wang2026mem,
  title={MEM-SQL: Memory-Empowered Text-to-SQL},
  author={Xiaoqi Wang and Wenqi Pei and Shizheng Hou and Yilai Liu and Han Chen and Boyan Li and Yuyu Luo and Hongyang Du},
  year={2026},
  eprint={2611.18338},
  archivePrefix={arXiv},
  url={https://arxiv.org/abs/2611.18338}
}