arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.04319cs.DBcs.AIcs.LG
收藏

面向SQL生成的LLM路由优化

Towards Optimizing SQL Generation via LLM Routing

Polytechnique Montréal(蒙特利尔理工学院)

Mohammadhossein Malekpour, Nour Shaheen, Foutse Khomh, Amine Mhedhbi

AI总结:

本文首次提出针对Text-to-SQL的LLM路由方法,通过动态选择成本效益最高的模型,在保持准确率的同时降低成本,并在BIRD数据集上验证了可解释的准确率-成本权衡。

摘要:

Text-to-SQL使用户能够通过自然语言与数据库交互,简化了对结构化数据的访问。尽管高能力的大语言模型(LLMs)在复杂查询上取得了较高的准确率,但对于较简单的查询,它们会带来不必要的延迟和美元成本。在本文中,我们首次提出了针对Text-to-SQL的LLM路由方法,该方法动态地为每个查询选择最具成本效益且能够生成准确SQL的LLM。我们提出了两种路由策略(基于评分和基于分类),在降低成本的同时,实现了与最强LLM相当的准确率。我们设计的路由器易于训练且推理高效。在实验中,我们在BIRD数据集上展示了一个实用且可解释的准确率-成本权衡。

英文摘要:

Text-to-SQL enables users to interact with databases through natural language, simplifying access to structured data. Although highly capable large language models (LLMs) achieve strong accuracy for complex queries, they incur unnecessary latency and dollar cost for simpler ones. In this paper, we introduce the first LLM routing approach for Text-to-SQL, which dynamically selects the most cost-effective LLM capable of generating accurate SQL for each query. We present two routing strategies (score- and classification-based) that achieve accuracy comparable to the most capable LLM while reducing costs. We design the routers for ease of training and efficient inference. In our experiments, we highlight a practical and explainable accuracy-cost trade-off on the BIRD dataset.

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

↑