Generative AI for Finance: How to take a Concept to Product
A #bestpractices Guide for Generative AI/LLMs for Finance Datasets.
#generativeai and #chatgpt have proved to be one of the biggest Digital disruptors in the past decade [1]. Just for comparison, OpenAI’s chatGPT garnered more than 1M users globally in the first 5 days of its release, when compared to #facebook that took 10 months, Instagram 2.5 months and #netflix 41 months to get the same number of users. The key reason behind such explosive interest was the unexplained nature of the underlying #largelanguagemodels (LLM) that have been trained on billions of articles and text scoured from the web and the timeliness in following well established virtual assistants like Google, Siri, Alexa and Cortana. Since the launch of chatGPT4 in March 2023, there has been a significant push towards incorporating Generative AI capabilities into products ranging from Educational services (Duolingo), Medical chatbots [2] such as PathVQA, data visualization (Copilot for PowerBI) to Finance chatbots. In this article we review the tactical details from taking a Generative AI prototype to production stage for the #finance domain.
???????????The primary use cases of Generative AI in the Finance domain are:
?For all the use cases above LLMs need to be called in an appropriate setup to enable the custom automation or question answering tasks. The most important consideration towards building a domain specific LLM product is understanding the limitations of the existing LLMs and to build a customized architecture to minimize such limitations [3]. The three major modalities of LLM usage are defined as follows:
? It is noteworthy that an alternative to re-fashioning existing LLMs is to build homegrown LLMs for specific use-cases. For instance, the BloombergGPT with 50B parameters was developed specifically with Finance data sets and it is capable of returning CEO names, performing financial analysis, risk assessment and so on. This process is time and resource intensive due to the heavy dependence on millions of annotated data samples. ?
Due to the lower dependence of the Grounded LLM and few-shot learning approaches on new annotated data, these mechanisms are more preferred for domain adaptations. Let us now investigate the system architecture that enables grounding and few shot learning for chatbot functionalities in the Finance domain.
?2. The Generative AI Architecture and Prompt Engineering
The mechanism of asking questions in the right way to the LLMs (chatbots) by including the “relevant data” and “relevant examples” is well known as #promptengineering. So, every time the user asks a question, a custom “Prompt” gets generated that contains the following:
Thus, custom prompts hit the chatbot per user-query to return the desired responses. A typical prompt engineering process combines Grounded LLMs with one-shot/few shot learning approach to minimize training costs while returning “acceptable” responses that are attuned to the queries from the chatbots.
领英推荐
From the system architecture standpoint two major processes are invoked to enable automated custom prompt generation. First, an offline process, as shown in Fig. 1 below stores the “Finance” datasets (that may have heterogeneous sources) into accessible data chunks and defines Prompt Templates. Dividing data into smaller data chunks enables explainability as needed. Second, an online process begins whenever a user enters a query. This online process, as shown in Fig. 2 below, applies query embedding to convert the question to machine understandable format followed by finding the relevant data chunks and a custom prompt hitting the chatbot. For example, if the user queries “Which stock prices are most stable this month?”, the data chunks corresponding to the stock trends are accessed first, then the stock trends with minimal or small changes are selected, and the names for these stocks are finally returned! This level of prompt customization, also known as a Langchain framework (#langchain) can be very useful for the Finance domain, where custom jargon/terminologies are limited and query specific!
3. Productization Requirements
Although the Prompt Engineering and #langchain architectures are scalable, they need heavy customization corresponding to each use-case, input dataset and UI/UX requirements. The major considerations to take such a system to production include the following:
?
4. Conclusions and Future Directions
In this article we present scalable pathways to design Generative AI products for the Finance domain. Generative AI and LLMs have minimized the need for “annotated data '' for most use-cases, that is otherwise a standard requirement for machine learning use-cases. However, LLMs have also raised concerns around #reliability, #trustworthiness , and #responsibleai. For instance, cost optimal LLMs often suffer from “hallucinations”, or false/fake responses that can be dangerous while making financial decisions. Some benchmarks around evaluation of LLMs are getting designed such as Stanford HELM and Eleuther AI, LM Harness, to evaluate the LLMs for accuracy, robustness, calibration and efficiency. This area of #benchmarking and #evaluating LLMs is a nascent domain and requires rigorous evaluation and standardization to ensure trustworthiness in the Generative AI solutions in the near future. Therefore, designing a #hallucinations-free #generativeai framework that can not only respond accurately/fairly but also predict future trends requires grounded machine learning modules and an #expert solutioning team to realize from a concept to a product!
?Additional References
AI @ AWS ◆ Machine Learning Engineer ◆ AI Consultant, Statistician and Educator
1 年Heather M. AI For Finance!!! Thanks for sharing Sohini Roychowdhury, PhD!!!
Chief Financial Officer, The PAC Group | Optimizing Company -Wide Strategy | Automating Financial Operations | Collaboration -Focused Leadership
1 年Generative AI, led by ChatGPT, stands as a transformative digital force of the decade. As we explore applications in diverse sectors, including finance, remember that combining grounded LLMs, few-shot learning, and smart prompt engineering could usher in tailored, efficient chatbot interactions in specialized domains.
Software Development Engineer @AWS | Ex-Discover Financial Services
1 年Great article! It's exciting to see the progress being made in developing chatbots for the finance domain.
Cofounder at Okiar | Psychologist & Data Scientist | Investor & Advisor
1 年Mateus Duarte
Well written Sohini, thanks for sharing