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

Blar-SQL:更快、更强、更小的 NL2SQL

Blar-SQL: Faster, Stronger, Smaller NL2SQL

Blar Spa(Blar公司)

José Manuel Domínguez, Benjamín Errázuriz, Patricio Daher

AI总结:

本研究提出 Blar-SQL 框架,通过任务分解结合微调 Llama-2 和 Code Llama 两个模型分别处理数据库理解和查询生成,并采用模式分块策略,在达到与 GPT-4 相当性能的同时大幅降低模型大小、推理时间和成本。

摘要:

大型语言模型(LLMs)在自然语言到 SQL 任务(NL2SQL)领域获得了显著的关注。在本研究中,我们展示了任务分解如何极大地帮助 LLMs 进行数据库理解和查询生成,以便用 SQL 查询回答人类问题。我们微调了开源模型,特别是 Llama-2 和 Code Llama,通过结合 2 个不同的模型,每个模型分别专注于两项任务之一,以利用每个模型的核心能力来进一步提高最终 SQL 查询的准确率。我们提出了一个新框架,将模式分块,以便在有限的上下文中容纳更多信息。我们的结果与 GPT-4 获得的结果相当,同时比 GPT-4 小 135 倍、快 90 倍且便宜 100 倍以上。

英文摘要:

Large Language Models (LLMs) have gained considerable notoriety in the field of natural language to SQL tasks (NL2SQL). In this study, we show how task decomposition can greatly benefit LLMs in database understanding and query generation in order to answer human questions with an SQL query. We fined-tuned open source models, specifically Llama-2 and Code Llama, by combining 2 different models each designated to focus on one of two tasks in order to leverage each model's core competency to further increase the accuracy of the final SQL query. We propose a new framework to divide the schema into chunks in order to fit more information into a limited context. Our results are comparable with those obtained by GPT-4 at the same time being 135 times smaller, 90 times faster and more than 100 times cheaper than GPT-4.

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

↑