Cloud Journey — Part 11 | LLMs in Finance using FinGPT

Chris Shayan
6 min readMar 21, 2024

--

Cloud Journey Series:

AI4Finance Foundation, recognized as a nonprofit entity, commits to the progressive enhancement of artificial intelligence within the financial sector. Their mission emphasizes the promotion of standardized practices and the development of open-source resources, benefiting both the research community and industry professionals.

Short-term Goal: Enhance core libraries’ usability, productivity, and performance. Increase adoption in open-source finance, maintain mature environments, and integrate key projects.

Long-term Goal: Develop standardized tools and APIs for finance professionals. Expand our open-source toolkit beyond foundational elements.

AI4Finance Foundation, has some popular GitHub repos which some of them are:

  1. FinNLP, Democratizing Internet-scale financial data.
  2. FinGPT, Open-Source Financial Large Language Models! They release the trained model on HuggingFace.
  3. FinRobot, An Open-Source AI Agent Platform for Financial Applications using LLMs
  4. FinRL, Financial Reinforcement Learning.
  5. FinML, A Practical Machine Learning Framework for Dynamic Stock Selection

The financial landscape is highly dynamic, making it challenging to keep up with the constant changes. Traditional methods of retraining LLMs using a mixed dataset of finance and general data sources can be costly and time-consuming. For instance, BloombergGPT, another LLM, requires approximately 1.3 million GPU hours for retraining, costing around $5 million. This makes it impractical to retrain an LLM model every month or every week. FinGPT presents a more accessible alternative. It prioritizes lightweight adaptation, leveraging the strengths of some of the best available open-source LLMs. These models are then fed with financial data and fine-tuned for financial language modeling. The cost of adaptation falls significantly, estimated at less than $300 per training, making FinGPT a cost-effective solution.

The key technology behind FinGPT is “RLHF (Reinforcement learning from human feedback)”. This technology, which is missing in BloombergGPT, enables an LLM model to learn individual preferences such as risk-aversion level, investing habits, and personalized robo-advisor. This is the “secret” ingredient of ChatGPT and GPT4, making FinGPT a powerful tool in the financial industry.

You can see some basic examples of Chinese Financial Market with ChatGLM & LoRA and American Financial Market with LLaMA and LoRA in this post.

Also, there is another comprehensive guide aimed at beginners diving into the realm of Financial Large Language Models (FinLLMs) with FinGPT. The blog post demystifies the process of training FinGPT using Low-Rank Adaptation (LoRA) with the robust base model ChatGlm2–6b.

End-to-end framework

FinGPT embraces a full-stack framework for FinLLMs with four layers:

  • Data source layer: This layer assures comprehensive market coverage, addressing the temporal sensitivity of financial data through real-time information capture. The starting point of the FinGPT pipeline is the Data Source Layer, which orchestrates the acquisition of extensive financial data from a wide array of online sources. This layer ensures comprehensive market coverage by integrating data from news websites, social media platforms, financial statements, market trends, and more. The goal is to capture every nuance of the market, thereby addressing the inherent temporal sensitivity of financial data.
  • Data engineering layer: Primed for real-time NLP data processing, this layer tackles the inherent challenges of high temporal sensitivity and low signal-to- noise ratio in financial data. This layer focuses on the real-time processing of NLP data to tackle the challenges of high temporal sensitivity and low signal-to-noise ratio inherent in financial data. It incorporates state-of-the-art NLP techniques to filter noise and highlight the most salient pieces of information.
  • LLMs layer: Focusing on a range of fine-tuning methodologies, this layer mitigates the highly dynamic nature of financial data, ensuring the model’s relevance and accuracy. Lying at the heart, it encompasses various fine-tuning methodologies, with a priority on lightweight adaptation, to keep the model updated and pertinent. By maintaining an updated model, FinGPT can deal with the highly dynamic nature of financial data, ensuring its responses are in sync with the current financial climate.
  • Application layer: Showcasing practical applications and demos, this layer highlights the potential capability of FinGPT in the financial sector. The final component of FinGPT is the Applications Layer, designed to demonstrate the practical applicability of FinGPT. It offers hands-on tutorials and demo applications for financial tasks, including robo advisory services, quantitative trading, and low-code development. These practical demonstrations not only serve as a guide to potential users but also underscore the transformative potential of LLMs in finance.

FinGPT may find wide applications in financial services, aiding professionals and individuals in making informed financial decisions. The potential applications include:

  • Robo-advisor: Offering personalized financial advice, reducing the need for regular in-person consultations.
  • Quantitative trading: Producing trading signals for informed trading decisions.
  • Portfolio optimization: Utilizing numerous economic indicators and investor profiles for optimal investment portfolio construction.
  • Financial sentiment analysis: Evaluating sentiments across different financial platforms for insightful investment guidance.
  • Risk management: Formulating effective risk strategies by analyzing various risk factors.
  • Financial Fraud detection: Identifying potential fraudulent transaction patterns for enhanced financial security.
  • Credit scoring: Predicting creditworthiness from financial data to aid lending decisions.
  • Insolvency prediction: Predicting potential insolvency or bankruptcy of companies based on financial and market data.
  • Mergers and acquisitions (M&A) forecasting: Predicting potential M&A activities by analyzing financial data and company profiles, helping investors anticipate market movements.
  • ESG (Environmental, Social, Governance) scoring: Evaluating companies’ ESG scores by analyzing public re- ports and news articles.
  • Low-code development: Facilitating software creation through user-friendly interfaces, reducing reliance on traditional programming.
  • Financial education: Serving as an AI tutor simplifying complex financial concepts for better financial literacy.

Milestone of AI Robo-Advisor: FinGPT Forecaster

Try the latest released FinGPT-Forecaster demo at HuggingFace Space

Enter the following inputs:

  1. ticker symbol (e.g. AAPL, MSFT, NVDA)
  2. the day from which you want the prediction to happen (yyyy-mm-dd)
  3. the number of past weeks where market news are retrieved
  4. whether to add the latest basic financials as additional information

Click Submit! And you’ll be responded with a well-rounded analysis of the company and a prediction for next week’s stock price movement!

For detailed and more customized implementation, please refer to FinGPT-Forecaster

--

--