NumLLM: Numeric-Sensitive Large Language Model for Chinese Finance

Huan-Yi Su, Ke Wu, Yu-Hao Huang, Wu-Jun LiarXiv 2024

Abstract

Recently, many works have proposed various financial large language models (FinLLMs) by pre-training from scratch or fine-tuning open-sourced LLMs on financial corpora. However, existing FinLLMs exhibit unsatisfactory performance in understanding financial text when numeric variables are involved in questions. In this paper, we propose a novel LLM, called numeric-sensitive large language model (NumLLM), for Chinese finance. We first construct a financial corpus from financial textbooks which is essential for improving numeric capability of LLMs during fine-tuning. After that, we train two individual low-rank adaptation (LoRA) modules by fine-tuning on our constructed financial corpus. One module is for adapting general-purpose LLMs to financial domain, and the other module is for enhancing the ability of NumLLM to understand financial text with numeric variables. Lastly, we merge the two LoRA modules into the foundation model to obtain NumLLM for inference. Experiments on financial question-answering benchmark show that NumLLM can boost the performance of the foundation model and can achieve the best overall performance compared to all baselines, on both numeric and non-numeric questions.

Introduction

While Large Language Models (LLMs) excel at general language tasks, the financial domain demands a level of numeric precision that standard models often lack. Existing financial LLMs (FinLLMs) frequently struggle when questions involve complex numeric variables. This deficiency stems from the standard auto-regressive training objective, which predicts tokens based only on preceding context, and a reliance on noisy web data rather than structured academic sources. Consequently, current models often lack "numeric sensitivity"—the ability to understand how specific values function within a broader financial logic.

Methodology

To address these challenges, we developed NumLLM using a three-stage pipeline based on the Qwen-7B foundation model.

  1. Fin-Textbooks Corpus: We curated a high-quality dataset from 24 authoritative Chinese financial textbooks covering 34 subjects. Unlike messy web data, textbooks provide the structured, formulaic knowledge essential for numeric reasoning.
  2. Dual-LoRA Training: We trained two separate Low-Rank Adaptation (LoRA) modules:
  3. Continual Pre-Training (CP): Adapts the model to the general language and terminology of the financial domain.
  4. Numeric-Sensitive Choice Tuning (NumCT): This novel method involves masking numbers in text segments and converting them into multiple-choice questions. This forces the model to attend to the surrounding context to "solve" for the missing value.
  5. SVD-based Mixing and Merging: To combine these specialized modules, we employed Singular Value Decomposition (SVD). By decomposing the weight matrices and retaining only the most significant singular values, we effectively merged the "signal" from both modules while discarding conflicting "noise."
The overall framework of NumLLM, detailing the data preparation, NumCT instruction construction, and the dual-LoRA merging process.

Data and Evaluation

The model was evaluated using FinEval, a comprehensive benchmark for Chinese financial knowledge consisting of 1,151 multiple-choice questions across Accounting, Certificate, Economy, and Finance. To specifically test numeric capability, we categorized these questions into "numeric" and "non-numeric" types to assess the model's specialized capabilities.

Comparison of numeric and non-numeric questions from the FinEval benchmark, illustrating the different reasoning requirements.

Results and Key Insights

NumLLM achieved the best overall performance on the FinEval benchmark compared to all baselines, including general models and specialized ones like DISC-FinLLM and FinGPT-v3.

  • Overall Accuracy: NumLLM reached 59.25%, surpassing the base Qwen model (58.21%) and the second-best financial model, Qwen-Yayi (52.65%).
  • Numeric Superiority: On numeric-specific questions, NumLLM showed significant gains, particularly in the Finance (up 5.00%) and Economy (up 2.38%) sub-domains compared to the base model.
  • Ablation Success: Our SVD merging method proved superior to simple weight averaging or summation, which can introduce noise and decrease performance in certain categories.

Conclusion and Future Work

NumLLM demonstrates that high-quality textbook data combined with targeted numeric-sensitive training can significantly improve LLM performance in specialized domains like finance. While currently focused on Chinese finance, the underlying techniques are transferable. Future research will explore adapting this method to other languages and more complex numeric reasoning tasks beyond multiple-choice selection.

Reference: Su, H.-Y., et al. (2024). NumLLM: Numeric-Sensitive Large Language Model for Chinese Finance. arXiv:2405.00566v1 [cs.CE].

Summary updated

BibTeX
@misc{su2024numllm,
  author = {Huan-Yi Su and Ke Wu and Yu-Hao Huang and Wu-Jun Li},
  title = {{NumLLM: Numeric-Sensitive Large Language Model for Chinese Finance}},
  year = {2024},
  eprint = {2405.00566},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.00566},
}
Figure