arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2312.03463cs.CLcs.DBcs.IR
收藏

DBCopilot:通过模式路由实现海量数据库上的自然语言查询

DBCopilot: Natural Language Querying over Massive Databases via Schema Routing

Institute of Software, CAS(中国科学院软件研究所);Hangzhou Institute for Advanced Study, UCAS(中国科学院大学杭州高等研究院);University of Chinese Academy of Sciences (UCAS)(中国科学院大学);Alibaba Cloud Intelligence Group(阿里巴巴云智能集团)

Tianshu Wang, Xiaoyang Chen, Hongyu Lin, Xianpei Han, Le Sun, Hao Wang, Zhenyu Zeng

AI总结:

针对海量数据库下模式无关NL2SQL的现实挑战,提出DBCopilot框架,将任务解耦为模式路由与SQL生成,用轻量可微索引实现关系感知联合检索,还引入反向生成范式自动适配路由,经实验验证具备可扩展性与有效性。

摘要:

大语言模型(LLM)的出现极大推动了数据库自然语言接口(NLIDB)的发展,为将自然语言(NL)问题转换为结构化查询语言(SQL)查询提供了直观方式。尽管基于LLM的NL2SQL已取得显著进展,但现有方法在海量数据库自然语言查询的真实场景中仍面临若干挑战。本文提出DBCopilot框架,通过采用紧凑灵活的copilot模型进行海量数据库路由来应对这些挑战。具体而言,DBCopilot将模式无关的NL2SQL解耦为模式路由和SQL生成两个阶段。该框架利用单个轻量级可微搜索索引为海量数据库模式构建语义映射,并以关系感知的联合检索方式将自然语言问题导航至其目标数据库和表。随后,路由得到的模式与问题被输入LLM以高效生成SQL。此外,DBCopilot引入了一种反向模式到问题的生成范式,无需人工干预即可在海量数据库上自动学习并适配路由模型。实验结果证实,DBCopilot是模式无关NL2SQL的一种可扩展且有效的解决方案,为NLIDB处理海量数据库上的自然语言查询带来了显著进展。

英文摘要:

The development of Natural Language Interfaces to Databases (NLIDBs) has been greatly advanced by the advent of large language models (LLMs), which provide an intuitive way to translate natural language (NL) questions into Structured Query Language (SQL) queries. While significant progress has been made in LLM-based NL2SQL, existing approaches face several challenges in real-world scenarios of natural language querying over massive databases. In this paper, we present DBCopilot, a framework that addresses these challenges by employing a compact and flexible copilot model for routing over massive databases. Specifically, DBCopilot decouples schema-agnostic NL2SQL into schema routing and SQL generation. This framework utilizes a single lightweight differentiable search index to construct semantic mappings for massive database schemata, and navigates natural language questions to their target databases and tables in a relation-aware joint retrieval manner. The routed schemata and questions are then fed into LLMs for effective SQL generation. Furthermore, DBCopilot introduces a reverse schema-to-question generation paradigm that can automatically learn and adapt the router over massive databases without manual intervention. Experimental results verify that DBCopilot is a scalable and effective solution for schema-agnostic NL2SQL, providing a significant advance in handling natural language querying over massive databases for NLIDBs.

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

↑