[Paper Review] Memo-SQL: Structured Decomposition and Experience-Driven Self-Correction for Training-Free NL2SQL
Memo-SQL proposes a training-free NL2SQL framework using structured decomposition and retrieval-augmented, error-aware self-correction. It achieves state-of-the-art open, zero-fine-tuning results on BIRD with notably lower compute than prior test-time scaling methods.
Existing NL2SQL systems face two critical limitations: (1) they rely on in-context learning with only correct examples, overlooking the rich signal in historical error-fix pairs that could guide more robust self-correction; and (2) test-time scaling approaches often decompose questions arbitrarily, producing near-identical SQL candidates across runs and diminishing ensemble gains. Moreover, these methods suffer from a stark accuracy-efficiency trade-off: high performance demands excessive computation, while fast variants compromise quality. We present Memo-SQL, a training-free framework that addresses these issues through two simple ideas: structured decomposition and experience-aware self-correction. Instead of leaving decomposition to chance, we apply three clear strategies, entity-wise, hierarchical, and atomic sequential, to encourage diverse reasoning. For correction, we build a dynamic memory of both successful queries and historical error-fix pairs, and use retrieval-augmented prompting to bring relevant examples into context at inference time, no fine-tuning or external APIs required. On BIRD, Memo-SQL achieves 68.5% execution accuracy, setting a new state of the art among open, zero-fine-tuning methods, while using over 10 times fewer resources than prior TTS approaches.
Motivation & Objective
- Motivate training-free NL2SQL that leverages historical error–fix signals rather than only correct demonstrations.
- Formalize NL2SQL as a structured divide-and-conquer task to promote diverse reasoning paths.
- Introduce an experience-driven, retrieval-augmented self-correction memory to refine outputs at inference time.
- Demonstrate state-of-the-art execution accuracy on BIRD among open, zero-fine-tuning methods with improved efficiency.
Proposed method
- Apply three decomposition strategies (entity-wise, hierarchical, atomic sequential) to generate diverse sub-queries in parallel.
- Use a ReAct+Reflect loop to reason about sub-queries, generate sub-SQLs, observe execution results, and reflect to correct errors.
- Maintain a dynamic error-correction memory of (question, correct SQL, erroneous SQL, error types, correction hints) and retrieve similar failures to guide in-context refinements.
- Generate three end-to-end SQL candidates (CTE, flat JOIN, nested) via few-shot in-context prompts and select via self-consistency scoring.
- Implement a two-stage memory retrieval for refinement: top-k retrieved error–correction pairs, deduplicate by error types, then apply a critic-refine loop until agreement.
- Evaluate using BIRD, SPIDER, and CHESS-SDS benchmarks; compare training-free open methods and baselines; analyze efficiency vs. accuracy.

Experimental results
Research questions
- RQ1Can a training-free NL2SQL system achieve competitive accuracy by explicitly structuring the decomposition of questions?
- RQ2Does leveraging historical error–correction experiences via retrieval-augmented in-context learning improve self-correction beyond static demonstrations?
- RQ3What is the impact of structured decomposition and iterative correction on execution accuracy and efficiency in NL2SQL?
- RQ4How well does memo-SQL generalize across datasets (BIRD, Spider, CHESS-SDS) using an error-correction memory built from another dataset?
Key findings
- Memo-SQL achieves state-of-the-art execution accuracy on open, zero-fine-tuning NL2SQL methods on BIRD dev-new.
- It reduces computational overhead by over an order of magnitude versus leading TTS approaches.
- Retrieval-augmented self-correction using both successful and failed histories improves robustness over static demonstrations.
- Three decomposition strategies promote diverse reasoning paths and enable a best-of-N candidate synthesis.
- Across model scales, Memo-SQL maintains strong accuracy and substantially improves efficiency.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.