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

大语言模型可以成为基数估计器吗?一项实证研究

Can Large Language Models be a Cardinality Estimator? An Empirical study

Peking University(北京大学);Bytedance(字节跳动);University of Pennsylvania(宾夕法尼亚大学)

Liangzu Liu, Yiyan Wang, Yinjun Wu, Runze Su, Zhuo Chang, Peizhi Wu, Jianjun Chen, Fuxin Jiang, Rui Shi, Bin Cui, Tieying Zhang

AI总结:

本文探讨了大语言模型在基数估计中的应用,通过实验证明其在泛化能力、复杂查询支持和数据效率方面的优势,展示了其在数据库管理系统中的潜力。

摘要:

基数估计(CardEst)仍然是数据库管理系统(DBMS)中的挑战性问题。近年来,基于机器学习的基数估计器在超越传统方法方面取得了成功。然而,这些解决方案在新数据或查询分布上的泛化能力差,无法处理复杂查询,并且需要大量数据准备,从而限制了其在现实中的广泛应用。一些最近的努力试图解决其中一些问题。我们注意到,最近出现的大语言模型(LLMs)在未见过的任务上表现出色,能够理解复杂程序,并且能够进行数据高效的微调。基于此,我们提出利用LLMs来缓解上述问题。具体来说,我们精心设计提示,并在推理过程中对LLMs进行微调和自我校正,以执行CardEst任务。我们进一步评估了LLMs在分布内和分布外的泛化能力、支持复杂查询的可行性以及在微调LLMs时的数据效率。结果表明,LLMs在几乎所有设置中都优于最先进的方法,这表明其在CardEst任务中的潜力。我们进一步通过使用LLMs在某些实际设置中估计的基数来测量数据库管理系统中的端到端查询执行时间,这表明LLMs的推理开销可以被其为CardEst带来的好处所抵消。

英文摘要:

Cardinality estimation (CardEst) still remains a challenging problem for DBMS. Recent years have witnessed the success of ML-based cardinality estimators in outperforming traditional methods. However, these solutions suffer from poor generalizability to new data or query distribution, inability to handle complex queries, and substantial data preparation overhead, thus preventing their wide adoption in the real-world DBMS. Some recent efforts have been dedicated to addressing some but not all of these issues. We notice that the recent emerging Large Language Models (LLMs) have shown their remarkable generalizability to unseen tasks, capabilities to understand complex programs, and power to perform data-efficient fine-tuning. In light of this, we propose to leverage LLMs to mitigate the above issues. Specifically, we carefully craft prompts, and subsequently perform fine-tuning and self-correction during inference with LLMs for CardEst task. We then extensively evaluate LLMs' in-distribution and out-of-distribution generalizability, feasibility to support complex queries, and training data efficiency during fine-tuning LLMs on pre-training datasets. The results suggest that LLMs outperform the state-of-the-art in almost all settings, thus indicating their potential for the CardEst task. We further measure the end-to-end query execution time in DBMS by using the estimated cardinalities of LLMs in some practical settings, which suggests that the inference overhead of LLMs can be outweighed by the benefits brought by LLMs for CardEst.

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

↑