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

Open-SQL框架:增强开源大型语言模型上的Text-to-SQL

Open-SQL Framework: Enhancing Text-to-SQL on Open-source Large Language Models

Shenzhen University(深圳大学);Shenzhen Institute of Advanced Technology (SIAT), Chinese Academy of Sciences (CAS)(中国科学院深圳先进技术研究院)

Xiaojun Chen, Tianle Wang, Tianhao Qiu, Jianbin Qin, Min Yang

AI总结:

本文提出Open-SQL框架,通过开放提示、监督微调、思维链少样本示例及多种token高效模式裁剪技术,显著提升开源LLM的Text-to-SQL性能。

摘要:

尽管大型语言模型(LLM)在Text-to-SQL任务中取得了成功,但开源LLM在上下文理解和响应连贯性方面仍面临挑战。为解决这些问题,我们提出了\ours,这是一种专为使用开源LLM进行Text-to-SQL而定制的系统性方法。我们的贡献包括:全面评估开源LLM在Text-to-SQL任务中的表现;用于有效问题表示的\openprompt策略;以及用于监督微调的新颖策略。我们探索了Chain-of-Thought在逐步推理中的优势,并提出了\openexample方法以增强少样本学习。此外,我们引入了token高效技术,例如Variable-length Open DB Schema、Target Column Truncation和Example Column Truncation,以应对大规模数据库中的挑战。我们的发现强调,有必要进一步研究监督微调对上下文学习能力的影响。值得注意的是,在BIRD-Dev数据集上,我们的方法将Llama2-7B从2.54%显著提升至41.04%,将Code Llama-7B从14.54%提升至48.24%。尤其值得注意的是,Code Llama-7B在BIRD-Dev数据集上的表现超过了GPT-4(46.35%)。

英文摘要:

Despite the success of large language models (LLMs) in Text-to-SQL tasks, open-source LLMs encounter challenges in contextual understanding and response coherence. To tackle these issues, we present \ours, a systematic methodology tailored for Text-to-SQL with open-source LLMs. Our contributions include a comprehensive evaluation of open-source LLMs in Text-to-SQL tasks, the \openprompt strategy for effective question representation, and novel strategies for supervised fine-tuning. We explore the benefits of Chain-of-Thought in step-by-step inference and propose the \openexample method for enhanced few-shot learning. Additionally, we introduce token-efficient techniques, such as \textbf{Variable-length Open DB Schema}, \textbf{Target Column Truncation}, and \textbf{Example Column Truncation}, addressing challenges in large-scale databases. Our findings emphasize the need for further investigation into the impact of supervised fine-tuning on contextual learning capabilities. Remarkably, our method significantly improved Llama2-7B from 2.54\% to 41.04\% and Code Llama-7B from 14.54\% to 48.24\% on the BIRD-Dev dataset. Notably, the performance of Code Llama-7B surpassed GPT-4 (46.35\%) on the BIRD-Dev dataset.

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

↑