用数据驱动方法提升大模型在金融问答中调用API的能力
Data-Driven Function Calling Improvements in Large Language Model for Online Financial QA
- 构建金融场景专用数据集并动态更新,增强模型对真实用户查询的适应性
- 引入参数增广技术AugFC,显著提升函数调用输入的多样性与覆盖率
- 已在腾讯元宝平台上线,支持海量在线金融问答需求
大型语言模型(LLM)已广泛应用于工业场景,而金融领域存在大量分散的API资源。在线金融问答系统可通过结合LLM与私有API实现实时分析。关键在于为LLM赋予面向金融场景的函数调用能力。然而通用模型难以适配金融领域,且在线用户查询常包含分布外参数,导致调用失败。本文提出一个数据驱动的函数调用增强流水线,包括数据集构建、数据增强(AugFC)和模型训练。基于已有研究构建并周期性更新数据集,引入用户查询相关样本以挖掘金融工具潜力,AugFC通过探索可能的参数值提升数据多样性。采用两步训练法,使模型有效调用金融函数。在多个离线数据集及线上部署中验证了其优越性。该方案已应用于中国最大聊天平台之一——腾讯元宝(YuanBao)的金融问答系统。
原文摘要 · Abstract (English)
Large language models (LLMs) have been incorporated into numerous industrial applications. Meanwhile, a vast array of API assets is scattered across various functions in the financial domain. An online financial question-answering system can leverage both LLMs and private APIs to provide timely financial analysis and information. The key is equipping the LLM model with function calling capability tailored to a financial scenario. However, a generic LLM requires customized financial APIs to call and struggles to adapt to the financial domain. Additionally, online user queries are diverse and contain out-of-distribution parameters compared with the required function input parameters, which makes it more difficult for a generic LLM to serve online users. In this paper, we propose a data-driven pipeline to enhance function calling in LLM for our online, deployed financial QA, comprising dataset construction, data augmentation, and model training. Specifically, we construct a dataset based on a previous study and update it periodically, incorporating queries and an augmentation method named AugFC. The addition of user query-related samples will \textit{exploit} our financial toolset in a data-driven manner, and AugFC explores the possible parameter values to enhance the diversity of our updated dataset. Then, we train an LLM with a two-step method, which enables the use of our financial functions. Extensive experiments on existing offline datasets, as well as the deployment of an online scenario, illustrate the superiority of our pipeline. The related pipeline has been adopted in the financial QA of YuanBao\footnote{https://yuanbao.tencent.com/chat/}, one of the largest chat platforms in China.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。