Source-linked AI summary

InvestLM: A Large Language Model for Investment using Financial Domain Instruction Tuning

Yi Yang, Yixuan Tang, Kar Yan Tam

arXiv:2309.13064v1q-fin.GNcs.AIcs.CLcs.LG

TL;DR

Financial LLM research faces limited access to model parameters and weak generalization beyond instructed tasks. InvestLM tunes LLaMA-65B with curated financial instructions; experts rate its responses comparable to commercial models, and it generalizes to untuned financial NLP tasks.

  • Problem

    Some financial LLMs are unavailable for research, commercial models expose no parameters, and existing task-tuned financial models generalize poorly beyond their instructed tasks.

    Source: §1 · p. 1
  • Method

    InvestLM instruction-tunes LLaMA-65B using a manually curated, diverse dataset of financial and investment instructions.

    Source: §1 · p. 1, §7 · p. 8
  • Results

    Experts rate InvestLM’s responses comparable to commercial models, and it shows strong generalizability on financial NLP tasks not used in instruction tuning.

    Source: §1 · pp. 1, 3
  • Takeaways & Limitations

    The findings suggest that high-quality domain-specific instructions can tune a strong foundation model, while generic instructions can harm performance on domain tasks.

    Source: §1 · p. 3, §7 · p. 8

    InvestLM’s outputs are not definitive investment advice; decisions require consideration of individual circumstances, risk tolerance, and goals, with professional advice and multiple information sources.

    Source: Ethics Statement · p. 8

Abstract

from arXiv · show

We present a new financial domain large language model, InvestLM, tuned on LLaMA-65B (Touvron et al., 2023), using a carefully curated instruction dataset related to financial investment. Inspired by less-is-more-for-alignment (Zhou et al., 2023), we manually curate a small yet diverse instruction dataset, covering a wide range of financial related topics, from Chartered Financial Analyst (CFA) exam questions to SEC filings to Stackexchange quantitative finance discussions. InvestLM shows strong capabilities in understanding financial text and provides helpful responses to investment related questions. Financial experts, including hedge fund managers and research analysts, rate InvestLM's response as comparable to those of state-of-the-art commercial models (GPT-3.5, GPT-4 and Claude-2). Zero-shot evaluation on a set of financial NLP benchmarks demonstrates strong generalizability. From a research perspective, this work suggests that a high-quality domain specific LLM can be tuned using a small set of carefully curated instructions on a well-trained foundation model, which is consistent with the Superficial Alignment Hypothesis (Zhou et al., 2023). From a practical perspective, this work develops a state-of-the-art financial domain LLM with superior capability in understanding financial texts and providing helpful investment advice, potentially enhancing the work efficiency of financial professionals. We release the model parameters to the research community.

1 Introduction

InvestLM addresses limited access to financial LLMs by tuning LLaMA-65B on curated financial instructions and releasing its parameters. The paper reports helpful investment responses, expert comparisons with commercial models, and findings about domain-specific instruction tuning.

  • The authors identify inaccessible model parameters and weak generalization beyond instructed tasks as obstacles to financial LLM research.Source: §1 · p. 1
  • InvestLM is tuned on LLaMA-65B with curated finance instructions and released with its model parameters; experts rate its responses comparable to commercial models.Source: §1 · p. 1
  • Case studies show InvestLM mitigating hallucinations in LLaMA’s responses, and it often gives concise conclusions similar to commercial models.When commercial models give decisive answers, InvestLM typically reaches a similar logical investment conclusion.Source: §1 · p. 3
  • InvestLM generalizes to several financial NLP tasks that were not used in its instruction tuning.Source: §1 · p. 3
  • Diverse domain instructions effectively transform a strong foundation model, while generic instructions can hurt performance on domain tasks.The authors relate the first finding to the Superficial Alignment Hypothesis (Zhou et al., 2023).Source: §1 · p. 3

2 Instruction Dataset

The dataset is manually curated to cover diverse finance and investment topics, with examples drawn from finance education, research, company disclosures, and financial NLP tasks. Its construction aims to help a pretrained model respond to investment questions using domain-specific instructions.

  • The dataset reflects the premise that a pretrained model may already understand financial content, while specifically crafted instructions help it interact with investment questions.Source: §2 · p. 3
  • Sources include high-vote quantitative finance discussions, CFA questions with explanations, finance journal articles, and textbook exercises with standard answers.Source: §2 · p. 3
  • The dataset also includes questions answered from SEC filings and reformatted financial NLP tasks with manually written responses beyond the original labels.Source: §2 · p. 3
  • For brainstormed investment questions, ChatGPT and Claude-2 generate candidate answers that are manually verified and paraphrased.Source: §2 · p. 3
  • Each resource contributes several hundred instruction-input-output examples, and the dataset has longer inputs and responses than general-purpose instruction sets such as Alpaca.Table 2 reports average token lengths for instruction/input and response.Source: §2 · p. 3, Table 2 · p. 4
  • The manually curated dataset covers financial investment topics using examples from several financial resources.Source: §2 · p. 4

3 Instruction Tuning on LLaMA

InvestLM is instruction-tuned from LLaMA-65B using LoRA, with context scaling intended to support long financial texts. The paper also specifies training settings for the 65B model and a 7B model used in subsequent analysis.

  • LoRA tunes LLaMA-65B for training efficiency, using rank 16 and six targeted projection modules.The targeted modules are q_proj, k_proj, v_proj, down_proj, gate_proj, and up_proj.Source: §3 · p. 4
  • Linear Rope Scaling at scale 4 increases the context size to 8,192 to improve handling of long financial texts.Source: §3 · p. 4
  • LLaMA-65B is trained for 15 epochs at a 3e-4 learning rate and batch size 16; the subsequent LLaMA-7B analysis uses 12 epochs, 3e-3, and batch size 32.The paper denotes InvestLM-65B as InvestLM and LLaMA-65B as LLaMA.Source: §3 · p. 4

4 Expert Evaluation

Financial experts rated InvestLM’s responses as comparable to or better than GPT-3.5 and GPT-4, while generally favoring Claude-2. A case study contrasts InvestLM’s grounded, risk-aware answer with LLaMA’s hallucinated figures.

4 Expert Evaluation

  • Six financial experts compared responses to 30 manually written questions from InvestLM and GPT-3.5, GPT-4, and Claude-2; GPT-4 also evaluated responses using the same protocol.The commercial-model responses were sampled throughout August 2023.Source: §4 · p. 4
  • Experts rated InvestLM as comparable to or better than GPT-3.5 and GPT-4, while usually favoring Claude-2; GPT-4 instead preferred InvestLM.The expert and GPT-4 evaluations are presented in Figures 1 and 2.Source: §4 · p. 4, Figure 1 · p. 5, Figure 2 · p. 5
  • Expert–expert agreement was 72.5% under a tie-discounted accuracy measure, which assigns half credit when one annotator labels a response a tie.The authors describe this as a reasonable level of agreement despite the subjectivity of response classification.Source: §4 · p. 5

4.1 InvestLM vs. LLaMA response

  • In a rate-news example, LLaMA introduced unsupported market figures, while InvestLM gave a reasoned answer that acknowledged uncertainty and investment risks.InvestLM noted that a recommendation depends on the individual’s situation and risk tolerance.Source: §4.1 · p. 5

5 How does InvestLM generalize to financial NLP tasks?

InvestLM is evaluated across financial NLP benchmarks, where it generally improves on its LLaMA foundation model despite limited task-specific instruction data. The section also finds larger relative gains for the 7B model and poorer benchmark generalizability when generic instructions are added.

5 How does InvestLM generalize to financial NLP tasks?

  • Financial sentiment, document classification, numerical reasoning, and summarization benchmarks comprise the evaluation; four datasets were developed by the authors.The author-developed datasets are FinSent, ESG, FLS, and QA; the other listed datasets are publicly available.Source: §5 · pp. 5–6

5.1 Generalizability on financial NLP tasks

  • InvestLM outperforms LLaMA-65B on 8 of 9 tasks, while GPT-4 leads on 6 and InvestLM on 2.InvestLM was not explicitly tuned on these tasks; its instruction dataset contains around 1,300 examples.Source: §5.1 · p. 6, Table 3 · p. 6

5.2 The benefit of domain instruction tuning

  • 138.4% average improvement for LLaMA-7B contrasts with 28.2% for LLaMA-65B after domain instruction tuning.The authors say tuning the smaller model is valuable when computational constraints prevent deploying a 65B model.Source: §5.2 · p. 6, Table 4 · p. 6

5.3 Do generic instructions help?

  • InvestLM-7B trained with domain instructions consistently outperforms its variant augmented with 52K Alpaca instructions across all benchmark tasks.The authors interpret this as evidence for carefully curated, high-quality domain instructions over a larger volume of generic instructions.Source: §5.3 · p. 7, Table 5 · p. 7

6 Related Work

Related work spans earlier financial language models and newer financial LLMs, alongside broader instruction-tuning efforts. InvestLM is distinguished by instruction-tuning LLaMA with manually curated financial instructions across a wider range of topics.

Financial Domain LLMs

  • Earlier financial-domain language models such as FinBERT used BERT architecture before ChatGPT’s release.Source: §6 · p. 7
  • BloombergGPT is a 50B foundation model trained on Bloomberg internal corpora but is not publicly accessible (Wu et al., 2023).FinMA instruction-tunes LLaMA using public NLP benchmarks, while FinGPT was fine-tuned on news and tweets sentiment data (Xie et al., 2023; Yang et al., 2023).Source: §6 · p. 7
  • InvestLM’s manually curated financial instructions cover a wider range of topics than FinMA’s benchmark-formatted data and FinGPT’s sentiment-focused data (Xie et al., 2023; Yang et al., 2023).The authors describe InvestLM as, to their knowledge, the first open-source financial domain LLM providing insightful investment-related responses.Source: §6 · p. 7

Instruction Tuning

7 Conclusion

InvestLM is an instruction-tuned LLaMA-65B model built with manually crafted instructions spanning financial and investment topics. The paper reports helpful investment responses and expert ratings comparable to commercial LLMs, and presents small, high-quality instruction datasets as a promising approach to domain-specific models.

  • InvestLM instruction-tunes LLaMA-65B with manually crafted instructions covering diverse financial and investment topics.Experts rate its responses as comparable to state-of-the-art commercial LLMs.Source: §7 · p. 8

Ethics Statement

InvestLM’s outputs should not be treated as definitive investment advice. The authors advise considering personal circumstances and consulting professional advisors before making investment decisions.

  • InvestLM responses are not definitive investment advice; users should consider their financial situation, risk tolerance, and goals, consult advisors, and use multiple sources.Source: Ethics Statement · p. 8

A Appendix A: Training Format

Appendix A presents instruction-tuning prompts that ask the model to complete a request, with or without accompanying input. The training format follows the instruction-and-input-to-output setup described in the paper.

A Appendix A: Training Format

B Appendix B: Expert Evaluation Interface and GPT-4 Evaluation Prompt

Appendix B presents the interface used to collect expert preference judgments and the prompt used for GPT-4 evaluation. Experts received scenario simulations and moderate guidance, while GPT-4 was asked to compare responses.

B Appendix B: Expert Evaluation Interface and GPT-4 Evaluation Prompt

Loading 2309.13064v1…