ALFFLLM·FINANCE

The List / RAG, Search, and Knowledge Systems / paper

FinDKG: Dynamic Knowledge Graphs with Large Language Models for Detecting Global Trends in Financial Markets

Xiaohu Li; Francesco Sanna Passino

2024International Conference on AI in Financecites 26P1arXiv ↗DOI ↗Semantic Scholar ↗Source ↗

Abstract

Dynamic knowledge graphs (DKGs) are popular structures to express different types of connections between objects over time. They can also serve as an efficient mathematical tool to represent information extracted from complex unstructured data sources, such as text or images. Within financial applications, DKGs could be used to detect trends for strategic thematic investing, based on information obtained from financial news articles. In this work, we explore the properties of large language models (LLMs) as dynamic knowledge graph generators, proposing a novel open-source fine-tuned LLM for this purpose, called the Integrated Contextual Knowledge Graph Generator (ICKG). We use ICKG to produce a novel open-source DKG from a corpus of financial news articles, called FinDKG, and we propose an attention-based GNN architecture for analysing it, called KGTransformer. We test the performance of the proposed model on benchmark datasets and FinDKG, demonstrating superior performance on link prediction tasks. Additionally, we evaluate the performance of the KGTransformer on FinDKG for thematic investing, showing it can outperform existing thematic ETFs.

In one sentence

The paper introduces ICKG, a fine-tuned LLM for generating dynamic knowledge graphs from financial news, and KGTransformer, an attention-based GNN that leverages meta-entities to outperform baselines in link prediction and thematic AI investing.

Summary

This paper addresses the challenge of extracting structured, temporal financial insights from unstructured news text by proposing a pipeline that combines Large Language Models with Graph Neural Networks. The authors argue that static knowledge graphs fail to capture the dynamic nature of financial markets and that existing LLM applications often lack the structural reasoning capabilities required for complex trend detection. By integrating meta-entity information into dynamic knowledge graph learning, the work aims to improve the accuracy of link prediction and enable more robust thematic investing strategies based on evolving corporate and macroeconomic relationships. The methodology centers on two main contributions: the Integrated Contextual Knowledge Graph Generator (ICKG) and the KGTransformer architecture. ICKG is a Mistral-7B model fine-tuned via supervised learning on GPT-4-generated quadruples from 400,000 Wall Street Journal articles to extract entities, relations, and timestamps. The resulting FinDKG dataset is analyzed using KGTransformer, a graph attention network that incorporates meta-entities (e.g., Company, Person, Sector) to enhance embedding quality. The model uses recurrent neural networks to handle temporal dynamics and is evaluated on link prediction tasks across benchmark datasets and FinDKG. For application, the authors construct a monthly-rebalanced AI-themed portfolio using predicted link probabilities from the model. Experimental results demonstrate that KGTransformer significantly outperforms static and temporal baselines, particularly on FinDKG where meta-entities provide a ~10% improvement in MRR. In thematic investing, the FinDKG-AI portfolio achieved a 39.6% annualized return and a Sharpe ratio of 1.81, surpassing major AI ETFs like ARKK and the S&P 500 benchmark during the 2022-2023 period. The paper highlights the utility of graph centrality measures for tracking global trends, such as the COVID-19 pandemic. Limitations include the reliance on news text which may introduce noise, the computational cost of LLM-based extraction, and the specific focus on AI themes which may not generalize to all market conditions without further validation.

Research problem

The paper addresses the difficulty of extracting dynamic, structured financial insights from unstructured news text using static models. It aims to improve link prediction and thematic investing by integrating meta-entity information into dynamic knowledge graph learning, leveraging LLMs for extraction and Graph Neural Networks for analysis.

Core contributions

  • Proposes ICKG, an open-source fine-tuned LLM for automated dynamic knowledge graph construction from financial news.
  • Introduces KGTransformer, an attention-based GNN that incorporates meta-entities to enhance link prediction performance.
  • Creates FinDKG, a large-scale open-source dynamic knowledge graph dataset derived from 400,000 WSJ articles.
  • Demonstrates superior thematic investing performance using KGTransformer predictions compared to existing AI ETFs.

Method

  • ICKG Pipeline: GPT-4 generates quadruples from news, filtered for quality, used to fine-tune Mistral-7B.
  • Entity Disambiguation: Sentence-BERT used to resolve entity references in FinDKG.
  • KGTransformer Architecture: Multi-head graph attention with meta-entity tensors for heterogeneous nodes.
  • Temporal Modeling: RNNs applied to KGTransformer embeddings to capture time-evolving structural and temporal dynamics.
  • Link Prediction: MLPs estimate conditional probabilities of entity-relation triplets given graph history.
  • Portfolio Construction: Monthly rebalancing based on predicted likelihood of stock-AI impact links.

Results & findings

  • KGTransformer outperforms baselines on YAGO and WIKI, with ~10% MRR improvement on FinDKG due to meta-entities.
  • FinDKG-AI portfolio achieved 39.6% annualized return vs. 18.6% for SPY and 20.6% for ARKK.
  • FinDKG-AI Sharpe ratio of 1.81 significantly exceeded ARKK's 0.431 and SPY's 1.084.
  • Graph centrality metrics effectively tracked the COVID-19 pandemic timeline in financial news.
  • ICKG fine-tuning on GPT-4 generated data improved extraction quality over raw GPT-4 outputs.
  • EvoKG baseline underperformed KGTransformer, validating the attention mechanism's efficacy.

Data & experiments

  • FinDKG dataset: 400,000 WSJ articles (1999-2023) processed into dynamic knowledge graph quintuples.
  • Benchmark datasets: YAGO, WIKI, and ICEWS14 for general link prediction evaluation.
  • Link prediction metrics: Mean Reciprocal Rank (MRR) and Hits@3/10 on temporal graph tasks.
  • Thematic investing backtest: Monthly-rebalanced AI-focused long-only portfolio on S&P 500 stocks (2022-2023).
  • Comparison against baselines: R-GCN, RE-Net, EvoKG, and existing AI-themed ETFs (ARKK, QQQ, etc.).

Limitations & caveats

  • Relies on news text which may contain noise or bias not present in fundamental data.
  • Computational cost of LLM-based extraction and GNN training may limit scalability.
  • Thematic investing results are specific to the AI trend and may not generalize to other sectors.
  • Entity disambiguation via Sentence-BERT may struggle with ambiguous financial entities.
  • Backtest period (2022-2023) covers a specific market regime with high AI volatility.

Curator notes

Discovery status: specific_domain_round2_promoted. Source links: FinKario: Event-Enhanced Automated Construction of Financial Knowledge Graph