arXiv:2606.17821cs.AI2026-06

让大模型按复杂度自动选择推理路径,提升文本转SQL准确率

DecoSearch: Complexity-Aware Routing and Plan-Level Repair for Text-to-SQL

论文配图:DecoSearch: Complexity-Aware Routing and Plan-Level Repair for Text-to-SQL
图 1 · 摘自论文原文
  • 根据问题复杂度动态分配直接生成或分步分解策略
  • 在BIRD数据集上达70.53%执行准确率,比无训练基线更高
  • 无需修改模型即可提升各类细调模型性能,适合实际部署

大型语言模型在自然语言转SQL方面表现优异,但在需要多步、数据感知推理的复杂查询上仍存在缺陷。本文提出DecoSearch,一种无需训练的框架,通过路由机制将每个查询分配到合适的推理层级。轻量级模式选择器先筛选出相关表和列;语言模型判断器决定是否需分解:简单问题走直接生成路径,复杂问题则升级为由原子子问题组成的有向无环图(DAG),每一步由特定的SQL生成模块解决。检索增强生成(RAG)组件用语义相似的训练样例支撑分解过程,拓扑重构器在执行失败时修正推理计划,区分错误来源。DecoSearch在BIRD上实现70.53%的执行准确率,在Spider上达到88.31%,使用DeepSeek骨干模型,优于所有无训练基线,且消耗的令牌数少一个数量级。该框架具有模型无关性,无需修改即可一致提升微调的SQL生成模型性能。

原文摘要 · Abstract (English)

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.

文本转SQL推理路由大模型应用数据库

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。