arXiv:2607.22624cs.AI2026-07

用置信度引导的启发式搜索提升小模型文本转SQL准确率

CHS-SQL: A Text-to-SQL approach based on Confidence-Guided Heuristic Search Schema Linking process

  • 结合模型置信度与启发式搜索优化模式链接精度与召回平衡
  • 在Spider数据集上达到小模型最佳性能,超越现有方法
  • 适合追求高效安全文本转SQL且资源受限的研究者

近期多项研究在文本转SQL任务中使用小型语言模型(SLMs)进行训练,仅需单块NVIDIA RTX 4090 GPU即可达到接近大模型的生成效果,同时保障数据安全。现有方法在模式链接阶段过滤冗余表和列以提升准确率,但未考虑精确率与召回率之间的权衡。我们发现模式链接的精确率与召回率均直接影响最终SQL准确率。为此,提出CHS-SQL框架,通过置信度引导的启发式搜索实现最优精确率-召回率平衡。该机制在模式链接阶段最大化相关模式候选的精确率,抑制无关噪声;在SQL生成阶段同样应用该策略,优化候选查询并避免陷入局部最优。实验表明,该方法在基于SLMs的文本转SQL任务中达到当前最佳(SOTA)表现。

原文摘要 · Abstract (English)

Recently, there have been several works in the Text-to-SQL domain that utilize Small Language Models (SLMs) for training. These approaches achieve performance close to that of large models in generating SQL, using only the computational power of a single NVIDIA RTX 4090 GPU, while also ensuring data security. Most existing methods filter out redundant tables and columns during Schema Linking to improve Text-to-SQL accuracy. However, they do not consider the precision-recall trade-off when selecting the candidate schema subset. Our research found that both the precision and recall of Schema Linking directly affect the final SQL accuracy. Therefore, we propose a novel framework for efficiently fine-tuning SLMs on Text-to-SQL tasks, CHS-SQL, that not only balances precision and recall but also improves overall performance on Text-to-SQL tasks. Its main innovation lies in the Schema Linking phase, where a heuristic search combined with model internal confidence is employed to achieve an optimal precision-recall trade-off. This elaborated mechanism maximizes the precision of relevant schema candidates for the generated SQL queries while suppressing irrelevant noise. The same strategy is further applied during SQL generation to refine candidate queries while helping the SLM to avoid trapping in a local optimum. Our method achieves state-of-the-art (SOTA) results on Text-to-SQL tasks via SLMs.

文本转SQL小模型模式链接置信度搜索

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