An Effective Data Creation Pipeline to Generate High-quality Financial Instruction Data for Large Language Model

Ziao Wang, Jianning Wang, Junda Wu, Xiaofeng ZhangarXiv 2023 · DOI · arXiv

Abstract

Large Language Models (LLMs) have shown remarkable capabilities in general tasks but often struggle in specialized, high-stakes domains such as finance due to a lack of domain-specific instruction data. This paper introduces a novel pipeline designed to generate high-quality financial instruction data by grounding AI-simulated dialogues in professional brokerage research reports. The process incorporates a two-stage human expert review to ensure thematic breadth and factual quality. The resulting dataset, comprising 103,000 multi-turn dialogues, was used to fine-tune LLaMA models using Low-Rank Adaptation (LoRA). Our results indicate that this approach significantly enhances model performance on financial tasks, with the LLaMA-30B-LoRA model achieving a score of 7.36 compared to the base model's 3.18, effectively bridging the performance gap toward proprietary models like GPT-3.5.

Introduction

While general-purpose LLMs like ChatGPT demonstrate impressive reasoning, their application in "high-stakes" domains like finance is limited by the potential for hallucinations and a lack of professional nuance. In financial analysis, inaccurate or generic responses can lead to significant economic consequences. The primary challenge in adapting LLMs for finance is the "data gap"—the scarcity of high-quality, domain-specific instruction-tuning datasets. Existing datasets like Alpaca or Dolly are too general, and simple AI-generated domain data often lacks the factual grounding and professional style required for expert-level financial discourse. This research addresses the need for a massive, factually grounded, and expert-validated financial dataset produced without the prohibitive cost of manual creation.

Methodology

The researchers developed a four-step pipeline to transform general LLM capabilities into specialized financial expertise:

  1. Grounded Data Sourcing: The pipeline begins with a high-quality corpus of brokerage research reports from the Chinese financial market. These reports serve as a factual foundation, providing the professional knowledge necessary to ground the AI's responses.
  2. Simulated Dialogues: Utilizing ChatGPT’s in-context learning (ICL) capabilities, the system simulates a conversation between an "AI Investor" and a "Financial Expert." The investor asks insightful questions, and the expert provides detailed answers based strictly on the provided research reports.
  3. Two-Stage Expert Revision:
    • Stage 1 (Breadth): Questions are clustered by theme, and human experts review these clusters to identify missing topics (e.g., risk factors or specific industry trends), ensuring comprehensive coverage.
  4. Stage 2 (Quality): Experts sample and refine the generated content to eliminate irrelevant, misleading, or repetitive dialogues, maintaining a high standard of quality.
  5. Sampling and Augmentation: Refined questions are fed back into the pipeline to stimulate further diverse dialogues, eventually scaling the dataset to over 100,000 entries.
The data creation pipeline involving grounded sourcing, simulated dialogues, and expert revision.

For model training, the researchers employed LoRA (Low-Rank Adaptation), a parameter-efficient fine-tuning technique, on the LLaMA family of models (7B, 13B, and 30B parameters).

Dataset and Evaluation

The resulting dataset consists of 103,000 multi-turn chats, with an average of 4 turns per dialogue. To evaluate the effectiveness of the pipeline, the researchers used two sets of benchmarks:

  • General Benchmarks: Chinese versions of XStoryCloze, XNLI, PAWS-X, XCOPA, and XWinograd were used to ensure that domain-specific tuning did not result in "catastrophic forgetting" of general linguistic abilities.
  • Financial Evaluation: A curated set of 100 expert-level financial questions was used for a "GPT-4 as a judge" evaluation, where responses were scored on a scale of 1 to 10.

Results and Analysis

The experimental results demonstrate a substantial improvement in financial reasoning across all model sizes. As shown in the performance comparison, the instruction-tuning pipeline more than doubled the performance of the base LLaMA models.

Performance scores of various models on financial tasks, judged on a 1-10 scale by GPT-4.

Key insights from the results include:

  • Grounding Effectiveness: Using research reports as context successfully mitigated hallucinations, moving the models toward detailed, data-driven answers.
  • Expert-Driven Architecture: Human experts played a crucial role as architects of the dataset's structure, identifying thematic gaps that the AI might otherwise overlook.
  • Scaling and Efficiency: While larger models (30B) consistently outperformed smaller ones, the most significant performance gain came from the transition from base models to LoRA-tuned versions.
  • Generalization: The tuned models maintained or slightly improved their performance on general benchmarks, proving that specialized tuning can coexist with general reasoning.

Conclusion and Future Work

This research provides a scalable and effective framework for creating high-quality, domain-specific instruction data. While the LLaMA-30B-LoRA model significantly narrowed the gap with GPT-3.5, a performance deficit remains. Future work will focus on increasing dialogue complexity (e.g., multi-party discussions), incorporating real-time professional feedback during inference, and expanding the dataset to include global markets and multiple languages.

Summary updated

Abstract

At the beginning era of large language model, it is quite critical to generate a high-quality financial dataset to fine-tune a large language model for financial related tasks. Thus, this paper presents a carefully designed data creation pipeline for this purpose. Particularly, we initiate a dialogue between an AI investor and financial expert using ChatGPT and incorporate the feedback of human financial experts, leading to the refinement of the dataset. This pipeline yielded a robust instruction tuning dataset comprised of 103k multi-turn chats. Extensive experiments have been conducted on this dataset to evaluate the model's performance by adopting an external GPT-4 as the judge. The promising experimental results verify that our approach led to significant advancements in generating accurate, relevant, and financial-style responses from AI models, and thus providing a powerful tool for applications within the financial sector.
BibTeX
@misc{wang2023effective,
  author = {Ziao Wang and Jianning Wang and Junda Wu and Xiaofeng Zhang},
  title = {{An Effective Data Creation Pipeline to Generate High-quality Financial Instruction Data for Large Language Model}},
  year = {2023},
  eprint = {2308.01415},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.01415},
}
Figure