arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.04691cs.CLcs.AIcs.DB
收藏

合成SQL列描述及其对Text-to-SQL性能的影响

Synthetic SQL Column Descriptions and Their Impact on Text-to-SQL Performance

Linköping University(林雪平大学)

Niklas Wretblad, Oskar Holmström, Erik Larsson, Axel Wiksäter, Oscar Söderlund, Hjalmar Öhman, Ture Pontén, Martin Forsberg, Martin Sörme, Fredrik Heintz

AI总结:

本研究利用LLM自动生成SQL列描述,基于BIRD-Bench构建数据集并评估多种模型,发现生成描述能提升text-to-SQL性能,尤其对大型模型有效,且更详细的元数据优于人工金标准。

摘要:

关系数据库常常因表内容的描述性信息不足而受到影响,例如存在歧义的列和难以解释的值,这既影响了人类用户,也影响了text-to-SQL模型。在本文中,我们探索使用大型语言模型(LLMs)自动为SQL数据库列生成详细的自然语言描述,旨在提升text-to-SQL性能并实现元数据创建的自动化。我们基于BIRD-Bench基准创建了一个金标准列描述数据集,手动完善其列描述,并构建了一个用于对列难度进行分类的分类体系。随后,我们评估了多种不同的LLM在数据集中的各列及不同难度级别上生成列描述的能力,发现模型在存在固有歧义的列上表现困难,这并不令人意外,凸显了人工专家输入的必要性。我们还发现,将此类生成的列描述纳入模型后,能持续提升text-to-SQL模型的性能,尤其是对于GPT-4o、Qwen2 72B和Mixtral 22Bx8等较大模型。值得注意的是,Qwen2生成的描述(包含注释者认为多余的信息)优于人工策划的金标准描述,这表明模型受益于比人类预期更详细的元数据。未来工作将研究这些高性能描述的具体特征,并探索其他类型的元数据,如数值推理和同义词,以进一步改进text-to-SQL系统。数据集、注释和代码将全部公开提供。

英文摘要:

Relational databases often suffer from uninformative descriptors of table contents, such as ambiguous columns and hard-to-interpret values, impacting both human users and text-to-SQL models. In this paper, we explore the use of large language models (LLMs) to automatically generate detailed natural language descriptions for SQL database columns, aiming to improve text-to-SQL performance and automate metadata creation. We create a dataset of gold column descriptions based on the BIRD-Bench benchmark, manually refining its column descriptions and creating a taxonomy for categorizing column difficulty. We then evaluate several different LLMs in generating column descriptions across the columns and different difficulties in the dataset, finding that models unsurprisingly struggle with columns that exhibit inherent ambiguity, highlighting the need for manual expert input. We also find that incorporating such generated column descriptions consistently enhances text-to-SQL model performance, particularly for larger models like GPT-4o, Qwen2 72B and Mixtral 22Bx8. Notably, Qwen2-generated descriptions, containing by annotators deemed superfluous information, outperform manually curated gold descriptions, suggesting that models benefit from more detailed metadata than humans expect. Future work will investigate the specific features of these high-performing descriptions and explore other types of metadata, such as numerical reasoning and synonyms, to further improve text-to-SQL systems. The dataset, annotations and code will all be made available.

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

↑