Knowledge-augmented Financial Market Analysis and Report Generation (2024)

Abstract: Crafting a convincing financial market analysis report necessitates a wealth of market information and the expertise of financial analysts, posing a highly challenging task. While large language models (LLMs) have enabled the automated generation of financial market analysis text, they still face issues such as hallucinations, errors in financial knowledge, and insufficient capability to reason about complex financial problems, which limits the quality of the generation. To tackle these shortcomings, we propose a novel task and a retrieval-augmented framework grounded in a financial knowledge graph (FKG). The proposed framework is compatible with commonly used instruction-tuning methods. Experiments demonstrate that our framework, coupled with a small-scale language model fine-tuned with instructions, can significantly enhance the logical consistency and quality of the generated analysis texts, outperforming both large-scale language models and other retrieval-augmented baselines.

## introduction crafting a compelling market analysis report is a complex process that demands careful selection of indicators, extensive financial knowledge, and perceptive reasoning. this intellectually challenging task requires sophisticated analysis and is often time-consuming. automated generation techniques are urgently needed to streamline this process and reduce manual effort in financial market analysis. in this paper, we introduce a novel task: financial market analysis generation @xcite . the goal of fmag is to automate the creation of analytical reports using financial market data. the primary challenge lies in synthesizing financial knowledge from extensive market information to produce logically consistent and high-quality analyses. while large language models (llms) have demonstrated remarkable abilities in natural language understanding and generation @xcite @xcite , they still have limitations in fmag. these include hallucinations @xcite , errors in financial knowledge @xcite , and insufficient capability to reason about complex financial problems @xcite , all of which compromise the quality and reliability of generated text, see fig. 1 . in this work, we propose a two-stage retrievalaugmented generation framework grounded in a financial knowledge graph (fkg), coined two-stage fkg-based retrieval (tfr). the proposed framework consists of three key parts. first, we use llms to construct a comprehensive fkg that delineates intricate relationships among financial entities, providing a solid foundation for knowledge retrieval. second, we devise a clustering-based triple extraction algorithm designed to efficiently retrieve knowledge aligned with given queries and facts from the constructed fkg. third, we intro-duce a novel two-stage approach for knowledge retrieval and augmentation. in the first stage, the fkg serves as guidance for initial information selection. in the second stage, it facilitates reasoning based on the selected information. in addition, we developed a fine-tuning strategy for smaller models to ensure compatibility with our tfr framework and enable its integration with various llms. our experiments demonstrate that the proposed framework, even when coupled with a small-scale language model fine-tuned with instructions, can significantly enhance the logical consistency and quality of generated analysis texts, outperforming both large-scale language models and other retrieval-augmented baselines. in summary, our key contributions are as follows: ## task description in this paper, we introduce a novel task, fmag, which aims to generate analytical text by reasoning from financial market information, including the values and changes of financial indicators and government financial policy. we consider the task in the format of question answering (qa) with an explanation. specifically, the task can be defined as answering questions through analytical reasoning based on financial facts. we denote an instance of fmag with three elements:{q, f, a}, where q denotes the user question, f represents financial facts, and a refers to the analysis text, including the analysis process and conclusions. given q and f , the progress of fmag can be formulated as estimating the probability of generating reasoning steps and then deriving the conclusion p (a|q, f ). ## proposed framework we introduce a two-stage fkg-based retrievalaugmented framework shown in fig. 2 . first, we build a fkg via prompting llms. second, we propose a clusters-based retrieval method to facilitate the retrieval of triples. thirdly, we propose a two-stage rag method, in which the kg serves as guidance to conduct initial information selection in the first stage and reasoning in the second stage. ## conclusion this research introduces a novel retrievalaugmented framework, leveraging a financial knowledge graph to address the limitations of llms in generating high-quality financial market analysis reports. the proposed framework, combined with a small-scale language model finetuned with instructions, performed significantly better than large-scale language models and other retrieval-augmented baselines. the results demonstrate the potential of our method to enhance the logical consistency and quality of generated financial market analysis, thereby contributing to the automation of premium market analyses.