Large Language Models (LLMs) have demonstrated remarkable capabilities in translating natural language to SQL, yet existing methods still falter on complex queries requiring multi-step, data-aware reasoning. We introduce DecoSearch, a training-free framework that addresses this by routing each query to the appropriate level of reasoning effort. A lightweight Schema Selector first prunes the full database schema to the relevant tables and columns. An LLM Judger then decides whether the question requires decomposition: straightforward questions follow a direct generation path and complex ones are escalated to a Directed Acyclic Graph (DAG) of atomic sub-questions, each solved by a targeted SQL generation step. A RAG component grounds the decomposer with semantically similar training examples, and a Topology Refiner restructures the reasoning plan when execution failures signal a flawed decomposition rather than a fixable SQL error. DecoSearch achieves 70.53% execution accuracy on BIRD and 88.31% on Spider with a DeepSeek backbone, surpassing all training-free baselines while consuming an order of magnitude fewer tokens than competing methods. It also functions as a model-agnostic wrapper, consistently improving fine-tuned SQL generation backbones without any modification to the pipeline.


翻译:大型语言模型(LLMs)在将自然语言转换为SQL方面展现出卓越能力,但现有方法在面对需要多步数据感知推理的复杂查询时仍存在不足。我们提出DecoSearch,一种无需训练的框架,通过将每个查询路由至适当级别的推理努力来解决该问题。轻量级模式选择器(Schema Selector)首先将完整数据库模式精简至相关表和列。LLM判断器(LLM Judger)随后判定问题是否需要分解:简单问题遵循直接生成路径,复杂问题则升级至原子子问题的有向无环图(DAG),每个子问题通过针对性的SQL生成步骤解决。RAG组件利用语义相似的训练示例为分解器提供基础,当执行失败表明是错误分解而非可修复的SQL错误时,拓扑优化器(Topology Refiner)会重构推理计划。DecoSearch在BIRD数据集上达到70.53%的执行准确率,在Spider数据集上以DeepSeek为骨干达到88.31%,超越所有无训练基线方法,同时消耗的token数量比竞品方法少一个数量级。该框架还可作为模型无关的封装器,在无需修改流程的情况下持续提升经过微调的SQL生成骨干模型。

0
下载
关闭预览

相关内容

SQL 全名是结构化查询语言,是用于数据库中的标准数据查询语言,IBM 公司最早使用在其开发的数据库系统中。
什么是后训练?大语言模型训练后优化方法综述,87页pdf
PlaNet 简介:用于强化学习的深度规划网络
谷歌开发者
13+阅读 · 2019年3月16日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
VIP会员
最新内容
定向能反无人机系统最新发展动态
专知会员服务
0+阅读 · 19分钟前
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
0+阅读 · 36分钟前
《通过小型无人机系统将情报能力“作战化”》
消耗优势:美军的“精确规模化”概念
专知会员服务
8+阅读 · 6月15日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员