Research Papers 论文研究 3h ago Updated 1h ago 更新于 1小时前 52

Learning When to Reason for Text-to-SQL via SFT and DPO 通过SFT和DPO学习何时对文本到SQL进行推理

The paper proposes AutoThinkSQL, a framework that integrates an auto-thinking mechanism into both Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO) for Text-to-SQL tasks. This approach allows the model to dynamically bypass reasoning for simple queries while invoking deep Chain-of-Thought (CoT) for complex queries, improving efficiency without sacrificing performance. On Qwen3-Coder-30B-A3B, the method achieves consistent gains on Spider and BIRD benchmarks, reducing average 本文提出了一种名为 AutoThinkSQL 的框架,该框架将自动思考机制整合到文本到 SQL(Text-to-SQL)任务的监督微调(SFT)和直接偏好优化(DPO)中。这种方法使模型能够在处理简单查询时动态跳过推理过程,而在面对复杂查询时则调用深度思维链(CoT),从而在不牺牲性能的前提下提升效率。在 Qwen3-Coder-30B-A3B 上,该方法在 Spider 和 BIRD 基准测试中均取得了稳定提升:与仅使用 CoT 生成相比,平均输出令牌数减少了 24.6% 和 18.3%,延迟降低了 17.1% 和 11.5%。模型学会根据查询难度调整其推理决策,展现出针对输入查询复杂性自适

75
Hot 热度
80
Quality 质量
70
Impact 影响力

Analysis 深度分析

TL;DR

  • The paper proposes AutoThinkSQL, a framework that integrates an auto-thinking mechanism into both Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO) for Text-to-SQL tasks.
  • This approach allows the model to dynamically bypass reasoning for simple queries while invoking deep Chain-of-Thought (CoT) for complex queries, improving efficiency without sacrificing performance.
  • On Qwen3-Coder-30B-A3B, the method achieves consistent gains on Spider and BIRD benchmarks, reducing average output tokens by 24.6% and 18.3%, and latency by 17.1% and 11.5% compared to CoT-only generation.
  • The model learns to align its reasoning decisions with query difficulty, demonstrating adaptive behavior tailored to the complexity of input queries.

Why It Matters

This work is highly relevant to AI practitioners and researchers working on natural language processing and database interaction systems, as it addresses the trade-off between accuracy and computational efficiency in Text-to-SQL models. By enabling dynamic reasoning based on query complexity, AutoThinkSQL offers a practical solution for real-world applications where low-latency responses are critical without compromising performance on challenging queries.

Technical Details

  • The core innovation lies in integrating an auto-thinking mechanism into SFT and DPO pipelines, allowing the model to decide whether to engage in multi-step reasoning or directly generate SQL based on query simplicity.
  • Experiments were conducted using Qwen3-Coder-30B-A3B as the base model, evaluated on two prominent Text-to-SQL benchmarks: Spider and BIRD.
  • Performance metrics include accuracy improvements over baselines alongside significant reductions in token count and inference time, highlighting both efficacy and efficiency gains.
  • Analysis shows that the model effectively learns to match its reasoning strategy with varying levels of query difficulty, indicating successful adaptation during training phases involving preference optimization techniques like DPO.

Industry Insight

Adopting frameworks like AutoThinkSQL could lead to more efficient deployment of AI-driven database querying tools in enterprise settings, particularly where quick response times are essential for user satisfaction or operational continuity. Additionally, this adaptive reasoning paradigm may inspire similar approaches across other domains requiring conditional depth-of-processing strategies, potentially revolutionizing how large-scale language models interact with structured data sources under diverse workload conditions.

摘要

本文提出了一种名为 AutoThinkSQL 的框架,该框架将自动思考机制整合到文本到 SQL(Text-to-SQL)任务的监督微调(SFT)和直接偏好优化(DPO)中。这种方法使模型能够在处理简单查询时动态跳过推理过程,而在面对复杂查询时则调用深度思维链(CoT),从而在不牺牲性能的前提下提升效率。在 Qwen3-Coder-30B-A3B 上,该方法在 Spider 和 BIRD 基准测试中均取得了稳定提升:与仅使用 CoT 生成相比,平均输出令牌数减少了 24.6% 和 18.3%,延迟降低了 17.1% 和 11.5%。模型学会根据查询难度调整其推理决策,展现出针对输入查询复杂性自适应的行为模式。

深度分析

TL;DR

  • 本文提出 AutoThinkSQL 框架,将自动思考机制引入文本到 SQL 任务的监督微调(SFT)和直接偏好优化(DPO)。
  • 该方法允许模型对简单查询跳过推理、对复杂查询启用深度思维链(CoT),在保持性能的同时提高效率。
  • 基于 Qwen3-Coder-30B-A3B 的实验显示,在 Spider 和 BIRD 基准上,相比纯 CoT 方法,平均输出 tokens 分别减少 24.6% 和 18.3%,延迟降低 17.1% 和 11.5%。
  • 模型能够依据查询复杂度自适应地调整推理策略,实现精准匹配。

重要性

本工作对从事自然语言处理及数据库交互系统的 AI 从业者与研究人员具有重要意义,因为它有效解决了文本到 SQL 模型中准确率与计算效率之间的权衡问题。通过根据查询复杂度动态选择推理路径,AutoThinkSQL 为需要低延迟响应且不能牺牲复杂查询表现的实际应用场景提供了切实可行的解决方案。

技术细节

  • 核心创新在于将自动思考机制嵌入 SFT 与 DPO 流程,使模型能自主判断是否进行多步推理或直接生成 SQL。
  • 实验以 Qwen3-Coder-30B-A3B 为基础模型,在两个主流文本到 SQL 基准——Spider 和 BIRD 上进行评估。
  • 性能指标包括相对于基线方法的准确率显著提升,以及输出长度和响应时间的显著缩减。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

LLM 大模型 Fine-tuning 微调 Training 训练 Evaluation 评测 Dataset 数据集