arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.10011cs.AI
收藏

Memo-SQL: 结构化分解与经验驱动的自我修正以实现无训练的NL2SQL

Memo-SQL: Structured Decomposition and Experience-Driven Self-Correction for Training-Free NL2SQL

City University of Hong Kong(香港城市大学);Huawei Technologies Ltd.(华为技术有限公司)

Zerui Yang, Weichuan Wang, Yanwei Xu, Linqi Song, Yudai Matsuda, Wei Han, Bo Bai

AI总结:

Memo-SQL通过结构化分解和经验驱动的自我修正,实现了无训练的NL2SQL系统,在BIRD数据集上达到68.5%的执行准确率,同时资源消耗显著降低。

摘要:

现有的NL2SQL系统面临两个关键限制:(1) 它们依赖上下文学习,仅使用正确的示例,忽略了历史错误修复对中包含的丰富信号,这些信号可以指导更稳健的自我修正;(2) 测试时的扩展方法往往任意分解问题,产生跨运行几乎相同的SQL候选方案,从而降低集成收益。此外,这些方法在准确性和效率之间存在明显的权衡:高性能需要大量计算,而快速变体则牺牲质量。我们提出了Memo-SQL,一种无训练框架,通过两个简单理念解决这些问题:结构化分解和经验感知自我修正。我们不将分解交给偶然,而是应用三种明确策略,按实体、层次和原子顺序进行分解,以促进多样化的推理。在修正方面,我们构建了一个动态记忆,记录成功查询和历史错误修复对,并利用检索增强提示法,在推理时将相关示例引入上下文,无需微调或外部API。在BIRD数据集上,Memo-SQL实现了68.5%的执行准确率,设定了开放、无微调方法的新状态,同时比先前的TTS方法使用超过10倍的资源少。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑