用结构化领域知识提升文本转SQL准确率
Retrieval and Augmentation of Domain Knowledge for Text-to-SQL Semantic Parsing
- 通过子串匹配从数据库级知识库中检索相关领域陈述
- 在11个真实数据库上提升跨领域文本转SQL准确率
- 适合需要高精度文本转SQL的数据库应用开发者
大型语言模型(LLMs)在将自然语言(NL)查询转换为SQL时,表现随数据库不同而差异显著。自然语言查询常使用特定领域术语,正确映射至SQL需理解这些术语与数据库模式结构的关系。现有基准依赖不切实际的、针对查询的文本提示来表达领域知识。本文提出一种系统性框架,在数据库层级关联结构化领域陈述。通过子串匹配检索用户查询相关的结构化领域陈述。在涵盖五个领域的11个真实数据库模式上评估,对比五种开源和专有LLM,结果表明:(1) 数据库层级的结构化领域陈述比现有查询特定的文本提示更实用且更准确;(2) 基于子串匹配的检索方法显著优于其他检索方式。
原文摘要 · Abstract (English)
The performance of Large Language Models (LLMs) for translating Natural Language (NL) queries into SQL varies significantly across databases (DBs). NL queries are often expressed using a domain specific vocabulary, and mapping these to the correct SQL requires an understanding of the embedded domain expressions, their relationship to the DB schema structure. Existing benchmarks rely on unrealistic, ad-hoc query specific textual hints for expressing domain knowledge. In this paper, we propose a systematic framework for associating structured domain statements at the database level. We present retrieval of relevant structured domain statements given a user query using sub-string level match. We evaluate on eleven realistic DB schemas covering diverse domains across five open-source and proprietary LLMs and demonstrate that (1) DB level structured domain statements are more practical and accurate than existing ad-hoc query specific textual domain statements, and (2) Our sub-string match based retrieval of relevant domain statements provides significantly higher accuracy than other retrieval approaches.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。