Manuscript Offprint
arXiv:2610.36083FinLLM-KG: Knowledge Graph-Enhanced LLMs for Financial Sentiment Analysis in Algorithmic Trading
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
Recent advances in Generative AI have substantially improved financial sentiment analysis through post-trained financial large language models (LLMs). However, existing approaches remain confined to predicting the sentiment of each article in isolation and operate as black boxes, which limits contextual understanding and hinders deployment in high-stakes financial decision-making. To this end, we introduce FinLLM-KG, a model-agnostic framework that combines causal LLMs with a financial knowledge graph, in order to inject temporally grounded, company-level knowledge from SEC 10-K filings at inference time, without updating model weights. Within FinLLM-KG, context is supplied either as a natural-language company profile or as a small set of relevance-ranked factual triples. This enables sentiment predictions to account for broader firm-level information rather than the article alone, at almost zero computational cost and for any causal LLM. In addition, attributing each article-level sentiment score to individual sentences and to the retrieved knowledge-graph facts makes the evidence behind the prediction inspectable, thereby enhancing explainability and supporting human-in-the-loop review. Simulations demonstrate that FinLLM-KG consistently improves portfolio performance over the state-of-the-art baseline.
Index Terms— Financial sentiment analysis, Knowledge graphs, Large language models, Portfolio construction
1. INTRODUCTION
Financial sentiment analysis (FSA) refers to the quantification of opinions expressed in news and other sources of textual financial data and aims to categorize whether the overall sentiment is positive, negative, or neutral — the so-called valence. The rise of Generative AI (GenAI), and in particular large language models (LLMs), has made FSA an increasingly important component of algorithmic and event-driven trading strategies, owing to their ability to process and interpret vast amounts of unstructured data. The ability to effectively leverage these technologies to extract actionable insights from complex financial narratives, at scale, enables the identification of aggregate trends and information that may otherwise be difficult to capture. Consequently, this provides an information advantage for downstream financial applications such as stock price prediction [1] and algorithmic trading [2, 3, 4].
Despite conceptual benefits, the diverse, nuanced, and domain-specific nature of financial text makes reliable sentiment extraction challenging. Post-trained LLMs [3, 4, 5, 6, 7], specifically adapted to the language of financial markets, have recently emerged as a promising approach to FSA, due to their ability to capture complex financial semantics without incurring the computational cost of pretraining LLMs from scratch. Despite advances, current sentiment-driven trading systems exhibit two fundamental limitations.
First, they analyze articles in isolation, ignoring the interconnected structure of financial markets, where news about one firm can rapidly affect its competitors, suppliers, customers, and other economic partners. Second, they largely operate as black-box systems, producing sentiment predictions without explicitly identifying the text that contributed to them — a critical limitation in finance, where explainability and human-in-the-loop oversight are essential.
Simultaneously, knowledge graphs (KGs) have emerged as a powerful paradigm for explicitly representing financial information. Unlike LLMs, which encode knowledge implicitly in their parameters, KGs represent entities and relationships as structured, inspectable triples, each encoding a factual relationship between two entities. In finance, this is particularly suited to information extracted from SEC 10-K filings [9, 8], where factual claims can be grounded in timestamped public disclosures and traced to their sources. Importantly, LLMs and KGs are complementary: LLMs provide semantic understanding of complex financial narratives, while KGs provide explicit relational structure and provenance. Combining the two offers a pathway beyond isolated sentiment classification towards more context-aware and explainable framework for financial sentiment analysis. It is therefore natural to ask:
• Can knowledge graphs be used in conjunction with finance-specific LLMs to enhance the predictive accuracy and explainability of sentiment-driven trading strategies?
To this end, we develop FinLLM-KG, a framework that combines: i) an audited knowledge graph of facts extracted from 10-K filings, and ii) finance-specific causal LLMs, to improve the predictive power and explainability of sentiment-based alpha generation. In particular, FinLLM-KG injects explicit company-level context into the signal-generation stage at inference time, while retaining the generative capabilities of the underlying LLM. Within this framework, each article is scored alongside information drawn from the latest publicly available 10-K filing, supplied either as a natural-language company profile or as a small set of relevance-ranked factual triples (e.g., NVIDIA — PARTNERS_WITH — Microsoft). In this way, sentiment predictions can account for the broader network of relationships surrounding a firm, while the facts underlying each score remain explicit and inspectable rather than implicit in the model parameters. The main contributions of this work are as follows.
• We develop FinLLM-KG, a knowledge graph-enhanced framework that integrates audited 10-K facts with finance-specific causal LLMs for financial sentiment analysis.
• We introduce an inference-time contextualization mechanism that augments financial narratives with company profiles and relevance-ranked factual relations, enabling more context-aware and explainable sentiment predictions.
• Extensive experiments demonstrate that FinLLM-KG improves predictive and trading performance while providing explicit, inspectable evidence underlying its predictions.
(a) Company-level enhanced context
(b) Sentiment-driven Portfolio Construction Framework

Fig. 1. Overview of FinLLM-KG. (a) Financial news articles are tagged and preprocessed. In parallel, fixed-relation 10-K triples from FinReflectKG [8] are restricted by a temporal alignment gate to the latest 10-K filed strictly before the article. Eligible facts are supplied either as a company profile or as the top-k retrieved triples and mixed with the article; in the baseline, the context is the article alone. (b) A frozen causal LLM performs sentiment analysis on the resulting context (prompt). The sentiment signal is used in the portfolio construction framework and, for the proposed methods only, can be decomposed into sentence-level and triple-level attributions for explainability.
Knowledge Graphs in Finance. Knowledge graphs (KGs) have been increasingly used to represent structured financial knowledge from sources including financial news and corporate filings. Notable examples include event-centric graphs such as FinDKG [10] and filing-derived graphs such as FinReflectKG [8], which extracts schema-constrained triples from SEC 10-K filings using an LLM-based critic-corrector framework. Financial KGs support question answering, retrieval, temporal analysis, and forecasting [11, 12, 13], and have been integrated with LLMs through retrieval augmentation or joint modelling [11, 14]. In this work, we use FinReflectKG to augment a finance-specific causal LLM with temporally grounded company relationships from corporate filings.
3. FINLLM-KG
Our work is designed to enhance the contextual understanding and explainability of causal LLMs for financial sentiment analysis by augmenting articles with company-level knowledge from a financial knowledge graph, rather than evaluating them in isolation. The approach is model-agnostic and requires no retraining, using the graph as external company memory at inference time. This broader firm-level context aims to improve sentiment accuracy and downstream trading performance. Sentence-level attributions, together with temporally grounded graph evidence, make predictions more transparent and suitable for human-in-the-loop applications. Figure 1 illustrates the overall framework.
3.1. Context Construction
FinLLM-KG does not extract a knowledge graph from raw filings. Instead, it adopts FinReflectKG, a published graph of schema-constrained triples derived from SEC 10-K filings for more than 700 companies over fiscal years 2014–2024, constructed using an LLM-based critic-corrector loop [8]. Each triple is a (head, relation, tail) fact tagged with a ticker and fiscal year. SEC 10-Ks are a natural source for this task: they are legally mandated, standardised, and dated, providing attributable and temporally ordered financial information [9]. The underlying filings are obtained through the SEC's EDGAR system. The resulting triples are stored in Neo4j, a graph database, and retrieved at inference time as external, company-specific memory. This company memory is provided to the sentiment LLM through two alternative representations: (i) a natural-language company profile and (ii) relevance-ranked factual triples. Given that a fiscal year is an interval rather than a timestamp, each triple is aligned to the EDGAR filing date of the corresponding 10-K. At scoring time, both forms of context are restricted to the latest 10-K filed strictly before the article date. If no such filing exists, no graph context is supplied.
3.1.1. Company Profiles
The first representation compresses a firm’s triples into a short natural-language profile, allowing the sentiment model to interpret an article in the context of the company’s broader situation rather than in isolation. For each ticker and fiscal year, triples are verbalised as (head, relation, tail) sentences, with underscores in relation names replaced by spaces, and passed to Claude Haiku 4.5. Profiles are built cumulatively: the first available year is generated from scratch under five fixed headings (Business, Financials, Momentum, Strategy, Key Risks), while each subsequent year updates the previous profile with that year's new facts, allowing multi-year trends to be stated rather than inferred from a single filing. Length is capped at 500 words for the first year and 700 words thereafter to keep the resulting prompt focused on the article. A year with no new triples carries the previous profile forward. Each completed profile is labelled with its 10-K filing date.
3.1.2. Relevance-Ranked Triples
The second representation retains the graph in fact form and, for each article, retrieves only the triples most relevant to its text. Offline, every unique triple for a ticker is verbalised as above, embedded using all-MiniLM-L12-v2 [15], and stored in a per-ticker vector index together with its fiscal year. Online, retrieval is confined to the latest 10-K filed strictly before the article date, after removing generic relations. The article is embedded with the same encoder, and the top-k triples are retrieved by cosine similarity between the resulting unit-normalised embeddings with the default set to k = 4.
3.2. Inference-time Scoring
As the FinLLM-KG framework operates with a frozen causal language model, its weights are never updated, making the framework model-agnostic and applicable to any causal LLM. In our evaluations, we compare three different conditions in the context supplied to the prompt. The baseline condition supplies the article text alone. The two knowledge-enhanced conditions prepend the company-level context generated in Section 3.1—either the latest eligible 10-K profile or the top-k retrieved triples—stamped with its filing provenance. The model is explicitly instructed to judge the article using the background context only as guidance, allowing the current news to take precedence if the two conflict. To strictly enforce the temporal gate, if no filing is yet public for a company at the time of an article, the knowledge-enhanced score is left undefined rather than silently falling back to the baseline.
Given that FinLLM-KG is built upon a causal LLM, its outputs are naturally limited to discrete sentiment labels (i.e., positive, negative, or neutral). To obtain continuous sentiment scores suitable for portfolio construction, we employed the logit-to-score converter proposed in [4], which leverages the internal output logits of the model to quantify the strength of each sentiment prediction without requiring any architectural modifications. Each article is scored via a single forward pass per condition, and this continuous score serves as the signal for portfolio construction and the target of the explainability decompositions.
4. SENTIMENT-DRIVEN PORTFOLIO CONSTRUCTION FRAMEWORK
Data Collection. Both textual and market data were collected to support the construction of long–short (L/S) portfolios. The textual dataset comprises 200,000 financial news articles published between February 2015 and June 2021. For the same period, we collected daily stock returns for the 100 companies in our investable universe (S&P 100) from Yahoo Finance, resulting in 1,672 days of return data per company.
Named Entity Recognition (NER). Since financial articles frequently discuss multiple companies, naively linking an article to a single stock can introduce substantial misalignment into the sentiment signal. To address this, we applied Named Entity Recognition (NER) to identify the organisational entities referenced within each article. Specifically, we employed the BERT-base-NER model [16], which recognises four entity types—organisation, person, location, and miscellaneous—and produces a confidence score for each detected entity. Articles were retained only when the confidence score of the target company exceeded 98%; otherwise, they were discarded. This reduced the corpus of financial articles to 160,000.
Sentiment Analysis. To assess the financial value of the proposed knowledge-enhanced context, FinLLM-KG was compared with the FinDPO configuration, a finance-specific causal LLM shown to achieve state-of-the-art portfolio-construction performance [4]. Since both configurations use the same sentiment-scoring procedure, this comparison isolates the contribution of company-level knowledge-graph context. Every article within each corpus was evaluated, with sentiment averaged when multiple articles were published for the same company on a given day.
Portfolio Construction. Once the sentiment score for each method was defined for every company, a daily long–short portfolio was constructed. We used the sentiment strength as a parameter to determine which companies should be in a long or a short position. The portfolio construction procedure is summarized below:
• Define the Investable Universe. Although the benchmark universe is based on S&P 100 constituents, the investable universe is constructed in a point-in-time and dynamic manner. On each trading day, only companies with point-in-time financial news and corresponding market data were included.
• Define the long and short positions. The sentiment signals produced by each method were used to construct independent portfolios. On each trading day, companies were ranked according to their sentiment score. Companies that did not have sentiment data on a particular day were omitted from the ranking. As the daily sentiment score for each company ranges between -1 and 1, companies with the highest positive sentiment were placed in a long position, while those with the strongest negative sentiment were placed in a short position.
• Portfolio allocation. Following [3, 4, 7], an equally weighted 35% long–short portfolio was employed, with the top 35% of ranked companies allocated to long positions and the bottom 35% allocated to short positions.
• Determine daily returns. To ensure a realistic trading setting and eliminate look-ahead bias, sentiment generated from articles published on trading day t was used to construct the portfolio at the market open of the next trading day . Positions were then held for one trading day and closed at the subsequent market open, implying that all returns were computed on a next-day open-to-open basis. For each particular day, the number of companies that were held in either a long position or a short position were equal. Consequently, the total portfolio return on a particular day is the difference between the daily long return and the daily short return.
Portfolio Evaluation. The performance of the portfolios constructed using FinLLM-KG was assessed against the FinDPO baseline. We considered (i) Profitability, measured via cumulative returns, and annualized returns and (ii) Risk-adjusted performance, evaluated using the annualized Sharpe ratio, Sortino ratio, and Calmar ratio. In line with the literature, and given the persistently low yields during the sample period [17], we set the risk-free rate, .

Fig. 2. Cumulative returns of sentiment-based 35% long–short portfolios under three conditions: Baseline (article text only), Summary (article text with the latest 10-K company profile), and Top-k Triples (article text with the top-k relevance-ranked factual relations), compared against the S&P 500 benchmark.
5. EXPERIMENTAL RESULTS
5.1. Evaluation via Real-World Financial Metrics
The results for the three sentiment-based configurations are illustrated in Figure 2 and Table 1. Despite using the same base model as FinDPO [4], which has achieved state-of-the-art performance in portfolio construction, FinLLM-KG improves upon the baseline across all evaluation metrics by incorporating company-level knowledge rather than scoring each article in isolation.
Table 1. Performance metrics of the sentiment-based portfolios at no transaction cost. For each metric, the best performance is shown in bold, and the second-best is underlined.
| Method | Cumulative Return (%) | Annualized Return (%) | Sharpe | Sortino | Calmar |
|---|---|---|---|---|---|
| S&P 500 | 94.75 | 12.77 | 0.72 | 0.90 | 0.46 |
| Baseline | 275.04 | 40.39 | 2.55 | 4.12 | 4.38 |
| Summary (Ours) | 325.06 | 47.98 | 3.07 | 4.60 | 6.07 |
| Top-k Triples (Ours) | 329.54 | 48.69 | 3.15 | 4.96 | 6.12 |
The summary and top-k triple configurations outperform the baseline, increasing cumulative returns from 275.04% to 325.06% and 329.54%, respectively. They also improve the Sharpe (2.55 to 3.07/3.15), Sortino (4.12 to 4.60/4.96), and Calmar ratios (4.38 to 6.07/6.12), indicating stronger risk-adjusted performance and improved downside-risk control. As the long–short portfolios are dollar-neutral by construction (SPY betas of -0.04 to -0.06), these returns are driven by signal alpha rather than market exposure.
Overall, these results indicate that augmenting article-level sentiment analysis with temporally grounded company context produces more informative trading signals than financial news in isolation. The superior top-k results further suggests that compact, article-specific facts offer greater utility than broader company summaries, by enabling the model to focus on the most relevant information at the given point in time.
5.2. Explainability Analysis
In addition to evaluating financial performance, we examined whether FinLLM-KG provides an interpretable account of the sentiment signals used for portfolio construction. Each article was scored as a complete document before attribution methods decompose the resulting score. The explanations therefore identify how individual sentences contribute to the full-article prediction rather than aggregating independently generated sentence scores.

Fig. 3. Sentence- and triple-level attributions for a top-k triple prediction ( ). (a) Selected sentence-level Kernel SHAP attributions. (b) Exact Shapley values for the four retrieved 10-K facts relative to the company-anchored prompt. Green and red indicate positive and negative contributions, respectively.
We focus on the top-k configuration because it provides explanations at both sentence and knowledge-graph levels. Figure 3 shows sentence-level Kernel SHAP [18] attributions computed while retaining the full retrieved context. Subsets of sentences are removed and rescored, with an empty article assigned a score of zero as the reference. Positive and negative attributions indicate how each sentence within an article shifts the sentiment score. Kernel SHAP is preferred to LIME [19] because its weighted regression directly estimates Shapley values and produces additive attributions that satisfy completeness relative to the chosen baseline. In contrast, LIME fits a local surrogate model without a completeness guarantee.
The retrieved triples are attributed separately using exact Shapley values, computed over all subsets while holding the article fixed. The company-anchored prompt without triples provides the reference, so the attributions sum to the difference between the top- and anchored scores, isolating the effect of the retrieved facts. In this example, the triple attributions sum to , shifting the anchored score from to the final top- score of . Together, the sentence- and triple-level explanations show how the model interpreted the article and which retrieved facts changed its prediction, enabling transparent human review of the resulting trading signal.
6. CONCLUSION
We have introduced FinLLM-KG, a novel framework for improving financial sentiment analysis by grounding a frozen causal language model in temporally dated, company-level knowledge. Different from post-training approaches, FinLLM-KG does not update the weights of the underlying LLM, but injects the latest already-public 10-K information at inference time, either as a natural-language company profile or as a small set of relevance-ranked factual relations. This allows any causal LLM to score news against explicit firm-level context rather than in isolation, while the facts underlying each prediction remain inspectable. FinLLM-KG has demonstrated consistent improvements in sentiment-driven portfolio performance over the FinDPO baseline, with the strongest gains obtained from compact, article-specific triples. Further, sentence- and triple-level attributions of the sentiment prediction enhance explainability and support human-in-the-loop review.
7. COMPLIANCE WITH ETHICAL STANDARDS
This is a numerical simulation study for which no ethical approval was required.
8. REFERENCES
[1] Yangtuo Peng and Hui Jiang, “Leverage financial news to predict stock price movements using word embeddings and deep neural networks,” in Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. June 2016, pp. 374–379, Association for Computational Linguistics.
[2] Wenbin Zhang and Steven Skiena, “Trading strategies to exploit blog and news sentiment,” Proceedings of the International AAAI Conference on Web and Social Media, vol. 4, no. 1, pp. 375–378, May 2010.
[3] Giorgos Iacovides, Thanos Konstantinidis, Mingxue Xu, and Danilo Mandic, “FinLlama: LLM-based financial sentiment analysis for algorithmic trading,” in Proceedings of the 5th ACM International Conference on AI in Finance, 2024, pp. 134–141.
[4] Giorgos Iacovides, Wuyang Zhou, and Danilo Mandic, "FinDPO: Financial sentiment analysis for algorithmic trading through preference optimization of llms," in Proceedings of the 6th ACM International Conference on AI in Finance, New York, NY, USA, 2025, ICAIF '25, p. 647–655, Association for Computing Machinery.
[5] Neng Wang, Hongyang Yang, and Christina Dan Wang, “FinGPT: Instruction tuning benchmark for open-source large language models in financial datasets,” in NeurIPS Workshop on Instruction Tuning and Instruction Following, 2023.
[6] Boyu Zhang, Hongyang Yang, and Xiao-Yang Liu, “Instruct-FinGPT: Financial sentiment analysis by instruction tuning of general-purpose large language models,” ArXiv, vol. abs/2306.12659, 2023.
[7] Giorgos Iacovides, Wuyang Zhou, and Danilo P. Mandic, "FinSMART: Financial sentiment analysis for algorithmic trading through market-aligned reinforcement learning," ArXiv, vol. abs/2607.28127, 2026.
[8] Abhinav Arun, Fabrizio Dimino, Tejas Prakash Agarwal, Bhaskarjit Sarmah, and Stefano Pasquali, “FinReflectKG: Agentic construction and evaluation of financial knowledge graphs,” in Proceedings of the 6th ACM International Conference on AI in Finance, New York, NY, USA, 2025, ICAIF '25, p. 283–290.
[9] U.S. Securities and Exchange Commission, “Form 10-k,” 2024.
[10] Xiaohui Victor Li and Francesco Sanna Passino, “FinDKG: Dynamic knowledge graphs with large language models for detecting global trends in financial markets,” in Proceedings of the 5th ACM International Conference on AI in Finance, New York, NY, USA, 2024, ICAIF '24, p. 573–581.
[11] Hanieh Khorashadizadeh, Fatima Zahra Amara, Morteza Ezzabady, Frédéric Ieng, Sanju Tiwari, Nandana Mihindukulasooriya, Jinghua Groppe, Soror Sahri, Farah Benamara, and Sven Groppe, “Research trends for the interplay between large language models and knowledge graphs,” arXiv preprint arXiv:2406.08223, 2024.
[12] Amanda Kau, Xuzeng He, Aishwarya Nambissan, Aland As-tudillo, Hui Yin, and Amir Aryani, “Combining knowledge graphs and large language models,” arXiv preprint arXiv:2407.06564, 2024.
[13] Weisi Chen, Jiaxin Zheng, Yuan Li, Xu Zhang, Hang Wang, and Islam Al-Qudah, “Beyond sentiment: Knowledge graph-driven financial market forecasting with large language models-extracted enterprise relations and adaptive residual networks,” International Journal of Data Science and Analytics, vol. 22, 2026.
[14] Shirui Pan, Linhao Luo, Yufei Wang, Chen Chen, Jiapu Wang, and Xindong Wu, “Unifying large language models and knowledge graphs: A roadmap,” IEEE Transactions on Knowledge and Data Engineering, vol. 36, no. 7, pp. 3580–3599, 2024.
[15] Sentence Transformers, “all-MiniLM-L12-v2,” https://huggingface.co/sentence-transformers/all-MiniLM-L12-v2, 2024.
[16] David S. Lim, “BERT-base-NER,” https://huggingface.co/dslim/bert-base-NER, 2021.
[17] Yahoo Finance, “Treasury yield 10 years historical data.”, 2023.
[18] Scott M. Lundberg and Su-In Lee, “A unified approach to interpreting model predictions,” in Proceedings of the 31st International Conference on Neural Information Processing Systems, Red Hook, NY, USA, 2017, NIPS’17, p. 4768–4777.
[19] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin, "Why should I trust you?: Explaining the predictions of any classifier," in Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, New York, NY, USA, 2016, KDD '16, p. 1135–1144.