FinAI Data Assistant:基于大语言模型并使用OpenAI Function Calling API的金融数据库查询处理
FinAI Data Assistant: LLM-based Financial Database Query Processing with the OpenAI Function Calling API
AI总结:
本研究提出结合LLM与OpenAI Function Calling API的FinAI Data Assistant金融数据库查询方案,通过路由参数化查询提升可靠性与效率,实验验证其在延迟、成本和可靠性上优于text-to-SQL基线。
摘要:
我们提出FinAI Data Assistant,这是一种结合大语言模型(LLM)与OpenAI Function Calling API的金融数据库自然语言查询实用方法。该系统并非通过text-to-SQL生成完整SQL,而是将用户请求路由到一小部分经过验证的参数化查询库,以生成灵活性换取可靠性、低延迟与成本效率。我们通过实证研究三个问题:(RQ1)仅靠LLM能否在无外部检索的情况下可靠回忆或推断时间相关金融数据;(RQ2)LLM将公司名称映射为股票代码的效果如何;(RQ3)在端到端数据库查询处理中,函数调用是否优于text-to-SQL。在价格与基本面的对照实验中,纯LLM预测存在不可忽略的误差,且相对于模型知识截止日期,主要在股价方面表现出未来信息偏差。纳斯达克100成分股的代码映射准确率近乎完美,标普500公司的准确率也较高。最终,在我们的任务集上,FinAI Data Assistant相比text-to-SQL基线实现了更低的延迟与成本,以及更高的可靠性。我们还讨论了设计权衡、局限性与部署方向。
英文摘要:
We present FinAI Data Assistant, a practical approach for natural-language querying over financial databases that combines large language models (LLMs) with the OpenAI Function Calling API. Rather than synthesizing complete SQL via text-to-SQL, our system routes user requests to a small library of vetted, parameterized queries, trading generative flexibility for reliability, low latency, and cost efficiency. We empirically study three questions: (RQ1) whether LLMs alone can reliably recall or extrapolate time-dependent financial data without external retrieval; (RQ2) how well LLMs map company names to stock ticker symbols; and (RQ3) whether function calling outperforms text-to-SQL for end-to-end database query processing. Across controlled experiments on prices and fundamentals, LLM-only predictions exhibit non-negligible error and show look-ahead bias primarily for stock prices relative to model knowledge cutoffs. Ticker-mapping accuracy is near-perfect for NASDAQ-100 constituents and high for S\&P~500 firms. Finally, FinAI Data Assistant achieves lower latency and cost and higher reliability than a text-to-SQL baseline on our task suite. We discuss design trade-offs, limitations, and avenues for deployment.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。