arXiv:2606.15598cs.AI2026-06

用自增强方法提升大模型文本转SQL的推理与泛化能力

Integrating Reasoning and Generalization in Text-to-SQL via Self-Enhanced Fine-Tuning

论文配图:Integrating Reasoning and Generalization in Text-to-SQL via Self-Enhanced Fine-Tuning
图 1 · 摘自论文原文
  • 通过无标注自动生成推理路径,避免人工标注依赖
  • 在Bird数据集上达53.39%执行准确率,复杂查询效果显著
  • 适合需要高精度文本转数据库查询的研究与应用

文本转SQL任务旨在将自然语言问题转化为可执行的SQL查询,使非专业用户能直观访问结构化数据。尽管大语言模型(LLMs)在此任务上展现出潜力,但现有方法常难以兼顾强推理能力和良好泛化性。为此,我们提出CoTE-SQL,包含三项关键创新:(i) 无需人工标注即可从LLM中提炼自增强推理轨迹;(ii) 采用模块化分解与示例检索的结构化思维链提示;(iii) 基于SQL执行反馈的错误感知修正。在Spider和Bird基准上的大量实验表明,CoTE-SQL在开源LLM中达到新最优性能,在Bird上取得53.39%执行准确率(EX)和59.02%验证准确率(VES),在Spider上实现79.60% EX和77.19% VES,尤其在复杂查询上提升明显。结果验证了在LLM框架内结合自增强、结构化推理与执行反馈的有效性。

原文摘要 · Abstract (English)

Text-to-SQL aims to translate natural language questions into executable SQL queries over structured databases, enabling non-expert users to access data intuitively. While recent advances in large language models (LLMs) have shown promise in this task, existing LLM-based approaches often struggle to strike a balance between strong reasoning capabilities and robust generalization. To address these limitations, we propose CoTE-SQL to enhance the LLM-based text-to-SQL generation with three key innovations: (i) self-enhanced reasoning traces distilled from LLMs without human annotation, (ii) structured chain-of-thought (CoT) prompting with modular decomposition and examples retrieval, and (iii) error-aware revision based on SQL execution feedback. Extensive experiments on the Spider and Bird benchmarks demonstrate that CoTE-SQL achieves new state-of-the-art performance among methods built on open-source LLMs with comparable model sizes on Bird (53.39% EX / 59.02 VES) and strong results on Spider (79.60% EX / 77.19 VES), with especially significant gains on complex queries. Results highlight the effectiveness of combining self-enhancement, structured reasoning, and execution-time feedback within an LLM-based framework for text-to-SQL design.

文本转SQL大模型推理增强数据库查询

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