arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.17305cs.AI
收藏

基于迭代重试工作流的资源受限场景下小型大语言模型实现可靠的文本转SQL

Reliable Text-to-SQL in Resource-Constrained Settings with Small LLMs via Iterative Retry Workflows

Data Lab, Generix Group(Generix集团数据实验室)

Bilel Abderrahmane Benziane, Xavier Schepler

AI总结:

本文针对资源受限场景下小型大语言模型的文本转SQL任务,提出含可选语法修正的迭代重试工作流,提升了SQL专用小模型的端到端成功率,为该任务提供了实用方案。

摘要:

大语言模型(LLMs)近期在文本转SQL生成任务上取得了性能提升,但其计算成本可能阻碍在资源受限场景中的部署。本文在受控推理预算下评估了1B至8B参数的中小型开源LLMs的文本转SQL能力,重点关注模型专业化和提示词构建对性能的影响。使用Spider基准,我们比较了多种提示词表示并评估了生成查询的准确率。结果显示,在小模型规模下,SQL专用模型始终比通用模型和面向对话的模型更可靠,且性能会因所用提示词的不同而产生显著差异。为在不使用更大模型的情况下降低这种性能波动,我们提出了三种轻量级推理工作流,当生成失败时,会自动使用替代提示词和/或模型进行重试,其中包含可选的语法修正步骤。这些工作流显著提升了端到端成功率,但需以增加推理调用次数为代价。这些结果表明,通过用适度增加的推理成本换取更高的可靠性,小型LLMs可实现更强的文本转SQL性能,为相关任务提供了实用路径。

英文摘要:

Large Language Models (LLMs) have recently improved Text-to-SQL generation, but their computational cost can hinder deployment in resource-constrained settings. This paper evaluates the Text-to-SQL capabilities of small and medium open-source LLMs (1B-8B parameters) under a controlled inference budget, focusing on how model specialization and prompt formulation affect performance. Using the Spider benchmark, we compare multiple prompt representations and assess the accuracy of generated queries. Our results show that SQL-specialized models are consistently more reliable than general-purpose and chat-oriented models at small scales, and that performance can vary substantially depending on the prompt used. To reduce this variability without resorting to larger models, we introduce three lightweight inference workflows that automatically retry with alternative prompts and/or models when failures occur, including an optional syntax-correction step. These workflows significantly improve end-to-end success rates, with a trade-off in additional inference calls. These results demonstrate a practical path to stronger Text-to-SQL performance with small LLMs, by trading modest additional inference cost for higher reliability.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑