Data-Driven Function Calling Improvements in Large Language Model for Online Financial QA
Organizations: Shenzhen Technology University Shenzhen, China · FiT, Tencent Shenzhen, China · Huazhong University of Science and Technology Wuhan, China · McGill University Montreal, Canada ·
Abstract
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 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.
Figures & tables
| Model Size | Training dataset | API-Bank L1 | API-Bank L2 | Tool-Alpaca | Seal-Tools | Nexus Raven | xLAM-small | Avg |
| Qwen2.5-1.5B | vanilla | 0.6525 | 0.4293 | 0.4290 | 0.7491 | 0.4988 | 0.5577 | 0.5527 |
| src-only | 0.7826 | 0.6533 | 0.6084 | 0.8865 | 0.5348 | 0.5934 | 0.6765 | |
| aug-only | 0.6973 | 0.4992 | 0.4242 | 0.8551 | 0.7500 | 0.6857 | 0.6519 | |
| src+aug | 0.7226 | 0.6648 | 0.6233 | 0.8898 | 0.7840 | 0.7288 | 0.7256 | |
| Qwen2.5-7B | vanilla | 0.6985 | 0.6036 | 0.6158 | 0.8083 | 0.7283 | 0.5914 | 0.6743 |
| src-only | 0.8295 | 0.6529 | 0.6745 | 0.9426 | 0.7892 | 0.7428 | 0.7719 |
| Model | AugFC | w/o blind spots | w/o designed prompt | w/o multi-round |
| Qwen2.5-1.5B | 0.726 | 0.689 | 0.672 | 0.695 |
| Qwen2.5-7B | 0.786 | 0.742 | 0.738 | 0.752 |
| Qwen2.5-32B | 0.806 | 0.765 | 0.772 | 0.780 |
| Model Size | Model Type | API-Bank L1 | API-Bank L2 | Tool-Alpaca | Seal-Tools | Nexus Raven | xLAM-small | Avg |
| 1.5B | Qwen2.5-1.5B | 0.6525 | 0.4293 | 0.4290 | 0.7491 | 0.4988 | 0.5577 | 0.5527 |
| xLAM-1.3B-fc | 0.8370 | 0.6432 | 0.5058 | 0.8043 | 0.5480 | 0.5368 | 0.6459 | |
| Hammer-1.5B | 0.7230 | 0.5971 | 0.5348 | 0.8865 | 0.5688 | 0.5192 | 0.6382 | |
| ours | 0.7226 | 0.6048 | 0.6233 | 0.8898 | 0.7840 | 0.7288 | 0.7256 | |
| 7B | Qwen2.5-7B | 0.6985 | 0.6036 | 0.6158 | 0.8083 | 0.7283 | 0.5914 | 0.6743 |
| xLAM-7B-fc | 0.8069 | 0.6424 | 0.5896 | 0.7687 | 0.5409 | 0.6378 | 0.6644 |
LLM Tool Use
Large language model tool use studies how models select, call, and coordinate external tools to extend their reasoning and take actions.
See all 295 papers