[论文解读] Memo-SQL: Structured Decomposition and Experience-Driven Self-Correction for Training-Free NL2SQL
Memo-SQL 提出一种训练-free 的 NL2SQL 框架,利用结构化分解与基于经验的自我纠错,具有检索增强与错误感知能力。它在 BIRD 数据集上达到开源、零微调的最先进结果,并显著降低推理时的计算量,相较于以往的测试时扩展方法。
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.
研究动机与目标
- 推动训练-free 的 NL2SQL,利用历史错误–修正信号而不仅仅是正确演示
- 将 NL2SQL 正式化为结构化的分治任务以促进多样化推理路径
- 引入以经验驱动、检索增强的自我纠错记忆,在推理时对输出进行 refined
- 在 BIRD 上实现开源、零微调方法中的最先进执行准确度,同时提升效率
提出的方法
- 应用三种分解策略(实体级、层级、原子级顺序)以并行生成多样化子查询
- 使用 ReAct+Reflect 循环对子查询进行推理、生成子 SQL、观察执行结果并反思以纠错
- 维护一个动态错误纠正记忆(question, correct SQL, erroneous SQL, error types, correction hints),并检索相似失败来指导上下文内 refinements
- 通过 few-shot 的上下文提示生成三种端到端 SQL 候选(CTE、平面 JOIN、嵌套),并通过自一致性评分选择
- 实施两阶段内存检索以 refinement:前-k 检索的错误–纠正对,按错误类型去重;再应用 critic-refine 循环直至达成一致
- 使用 BIRD、SPIDER 和 CHESS-SDS 基准进行评估;比较训练无开源方法和基线;分析效率与准确度的权衡

实验结果
研究问题
- RQ1训练无 NL2SQL 系统是否通过显式结构化问题分解而达到有竞争力的准确性?
- RQ2利用检索增强的上下文学习中的历史错误–修正经验是否能改进自我纠错,相较静态演示?
- RQ3结构化分解与迭代纠错对 NL2SQL 的执行准确度与效率有何影响?
- RQ4Memo-SQL 在不同数据集(BIRD、Spider、CHESS-SDS)上的泛化能力如何,是否能借助来自另一数据集构建的错误纠正记忆?
主要发现
- Memo-SQL 在 BIRD dev-new 的开源、零微调 NL2SQL 方法中实现了最先进的执行准确度
- 相较于领先的 TTS 方法,其计算开销下降超过一个数量级
- 检索增强的自我纠错,结合成功与失败历史,提升了对静态演示的鲁棒性
- 三种分解策略促进多样化推理路径,并实现最佳候选的汇聚生成
- 在不同模型规模下,Memo-SQL 维持强劲准确性并显著提升效率

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。