MEM-SQL: text-to-SQL that reuses memory of past queries
The paper introduces HARE, a 1,600-request benchmark for reusing verified historical SQL. MEM-SQL stores whole-query templates, reusable SQL blocks and concept-to-schema mappings, consulting the schema only on demand. Across six LLMs, execution accuracy rises…
Why it matters
A practical pattern for internal data assistants: keep verified queries as memory to raise accuracy and cut cost.
What happened
1 min readThe paper introduces HARE, a 1,600-request benchmark for reusing verified historical SQL. MEM-SQL stores whole-query templates, reusable SQL blocks and concept-to-schema mappings, consulting the schema only on demand. Across six LLMs, execution accuracy rises from 37.1% to 50.0% with 76.6% fewer input tokens and 68.8% lower latency.
Our analysis
Reusing verified queries is common in practice; this paper makes it measurable. The drop to 29.7% when several queries must be combined shows a real limit. The benchmark is the authors' own and may favor their design. Worth reading for teams building SQL assistants.