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

用于 Text-to-SQL 的抽取式模式链接

Extractive Schema Linking for Text-to-SQL

IBM Research AI(IBM研究院AI部门)

Michael Glass, Mustafa Eyceoz, Dharmashankar Subramanian, Gaetano Rossiello, Long Vu, Alfio Gliozzo

AI总结:

本文提出一种适配仅解码器LLM的抽取式模式链接新方法,通过细粒度控制精确率-召回率权衡,在提升Text-to-SQL任务计算效率和准确率的同时,解决了大数据库模式放入提示的难题。

摘要:

Text-to-SQL 正在成为真实世界数据库的一种实用接口。Text-to-SQL 的主流范式是跨数据库或模式独立的,支持训练期间未见过的应用模式。数据库的模式定义了表、列、列类型以及表之间的外键连接。真实世界的模式可能很大,包含数百个列,但对于任何特定查询,只有一小部分是相关的。将整个模式放入 LLM 的提示中,对于具有较小 token 窗口的模型来说可能无法实现,即使上下文窗口足够大允许这样做时也很昂贵。即使不考虑计算因素,通过将 SQL 生成集中在数据库的相关部分,也可以提高模型的准确性。模式链接识别对问题有用的数据库模式部分。以前关于模式链接的工作使用了图神经网络、生成式 LLM 和交叉编码器分类器。我们引入了一种新方法来适配仅解码器 LLM 进行模式链接,该方法在计算上比生成式方法更高效且更准确。此外,我们的抽取式方法允许对模式链接的精确率-召回率权衡进行细粒度控制。

英文摘要:

Text-to-SQL is emerging as a practical interface for real world databases. The dominant paradigm for Text-to-SQL is cross-database or schema-independent, supporting application schemas unseen during training. The schema of a database defines the tables, columns, column types and foreign key connections between tables. Real world schemas can be large, containing hundreds of columns, but for any particular query only a small fraction will be relevant. Placing the entire schema in the prompt for an LLM can be impossible for models with smaller token windows and expensive even when the context window is large enough to allow it. Even apart from computational considerations, the accuracy of the model can be improved by focusing the SQL generation on only the relevant portion of the database. Schema linking identifies the portion of the database schema useful for the question. Previous work on schema linking has used graph neural networks, generative LLMs, and cross encoder classifiers. We introduce a new approach to adapt decoder-only LLMs to schema linking that is both computationally more efficient and more accurate than the generative approach. Additionally our extractive approach permits fine-grained control over the precision-recall trade-off for schema linking.

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

↑