用执行反馈联合优化文本转SQL的检索与生成,提升准确率。
ACE-SQL: Adaptive Co-Optimization via Empirical Credit Assignment for Text-to-SQL

- 通过执行反馈动态调整检索目标,实现双向自适应优化。
- 在BIRD数据集上达65.3%贪心执行准确率,每查询仅用0.93k token。
- 适合需要高精度文本转SQL的工业场景与研究者使用。
文本转SQL将自然语言问题映射为可执行的SQL查询。现代数据库常含大型复杂模式,使得模式链接成为准确生成SQL的关键步骤。现有方法或依赖全模式生成,使模式链接隐含于大搜索空间中;或使用静态黄金列监督的独立检索器,其目标可能不适应当前生成策略。为此,我们提出基于经验信用分配的自适应协同优化框架ACE-SQL,该框架通过执行反馈联合优化模式检索与SQL生成。ACE-SQL从生成器回放中构建在线列集合池,并基于与执行正确回放最频繁关联的列集,推导出自适应的在线策略检索目标。这实现了双向适应:检索器向生成器能正确执行的列集演化,生成器则根据检索器动态变化的模式选择进行调整。在约3000个合成的文本转SQL问答-数据库对上进行强化学习训练,ACE-SQL在BIRD Dev上达到65.3%的贪心执行准确率,每查询仅使用0.93k输出词元。代码库见https://github.com/xbchen1/ACE-SQL。
原文摘要 · Abstract (English)
Text-to-SQL maps natural language questions to executable SQL queries. Modern databases often contain large and complex schemas, making schema linking a critical step for accurate SQL generation. Existing methods either rely on full-schema generation, which leaves schema linking implicit within a large search space, or use a separate retriever trained with static gold-column supervision, whose targets may be suboptimal for the current generator policy. To address this issue, we propose Adaptive Co-optimization via Empirical Credit Assignment for Text-to-SQL (ACE-SQL), a reinforcement learning (RL) framework that jointly optimizes schema retrieval and SQL generation under execution feedback. ACE-SQL constructs an online column-set pool from generator rollouts and derives adaptive on-policy retrieval targets from the column set most frequently associated with execution-correct rollouts. This induces bidirectional adaptation, where the retriever adapts toward column sets that the generator can execute correctly, while the generator adapts to the retriever's evolving schema selections under execution feedback. With approximately 3k synthetic Text-to-SQL question-database pairs for RL training, ACE-SQL achieves 65.3% greedy execution accuracy on BIRD Dev while using 0.93k output tokens per query. The repository is available at https://github.com/xbchen1/ACE-SQL.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。