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

FinSQL:面向金融分析的、基于大语言模型且与模型无关的 Text-to-SQL 框架

FinSQL: Model-Agnostic LLMs-based Text-to-SQL Framework for Financial Analysis

Zhejiang University(浙江大学);Hundsun Technologies INC.(恒生电子股份有限公司)

Chao Zhang, Yuren Mao, Yijiang Fan, Yu Mi, Yunjun Gao, Lu Chen, Dongfang Lou, Jinshu Lin

AI总结:

该研究构建真实金融 Text-to-SQL 数据集 BULL,并提出模型无关的 FinSQL 框架,通过提示构建、参数高效微调和输出校准提升金融分析查询性能。

摘要:

Text-to-SQL 为操作关系型数据库提供了零代码接口,因此在金融分析中受到广泛关注,因为金融专业人员可能并不熟练掌握 SQL 编程。然而,迄今为止尚不存在面向金融分析的实用 Text-to-SQL 基准数据集,而且现有 Text-to-SQL 方法也没有考虑金融应用中数据库的独有特征,例如普遍存在的宽表。为解决这些问题,我们收集了一个实用的 Text-to-SQL 基准数据集,并提出了一种面向金融分析、与模型无关且基于大语言模型(LLMs)的 Text-to-SQL 框架。该基准数据集 BULL 采集自恒生电子股份有限公司的实际金融分析业务,涵盖基金、股票和宏观经济数据库。此外,所提出的基于 LLMs 的 Text-to-SQL 框架 FinSQL 从提示构建、参数高效微调和输出校准三个角度,对金融 Text-to-SQL 进行了系统性处理。在 BULL 上的大量实验结果表明,FinSQL 以较小成本取得了最先进的 Text-to-SQL 性能;此外,在需要少样本跨数据库模型迁移的场景中,FinSQL 可带来最高 36.64% 的性能提升。

英文摘要:

Text-to-SQL, which provides zero-code interface for operating relational databases, has gained much attention in financial analysis; because, financial professionals may not well-skilled in SQL programming. However, until now, there is no practical Text-to-SQL benchmark dataset for financial analysis, and existing Text-to-SQL methods have not considered the unique characteristics of databases in financial applications, such as commonly existing wide tables. To address these issues, we collect a practical Text-to-SQL benchmark dataset and propose a model-agnostic Large Language Model (LLMs)-based Text-to-SQL framework for financial analysis. The benchmark dataset, BULL, is collected from the practical financial analysis business of Hundsun Technologies Inc., including databases for fund, stock, and macro economy. Besides, the proposed LLMs-based Text-to-SQL framework, FinSQL, provides a systematic treatment for financial Text-to-SQL from the perspectives of prompt construction, parameter-efficient fine-tuning and output calibration. Extensive experimental results on BULL demonstrate that FinSQL achieves the state-of-the-art Text-to-SQL performance at a small cost; furthermore, FinSQL can bring up to 36.64% performance improvement in scenarios requiring few-shot cross-database model transfer.

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

↑