Beyond sentiment: knowledge graph-driven financial market forecasting with large language models-extracted enterprise relations and adaptive residual networks
摘要
Financial markets exhibit high volatility driven by multi-factor coupling; yet traditional forecasting methods have the following limitations: insufficient integration of heterogeneous data, a lack of explicit modeling for dynamic relationships between enterprises, and hence generating ambiguous or even incorrect sentiment polarity, leading to inferior forecasting results. To address these issues, this paper proposes a knowledge graph (KG)-driven financial market forecasting framework that integrates large language models (LLMs) and an adaptive deep learning model. First, it combines technical indicators, specifically including the Fibonacci indicator, and news sentiment to enhance the market perception. Second, an LLM-based extraction module parses unstructured corporate news to construct a lightweight KG, defined by a simplified schema that focuses exclusively on dynamic competitive/cooperative binary relationships without redundant attributes. This structure enables efficient automated construction through prompt engineering with no reliance on complex ontologies or extensive manual annotation. Third, the T5-Relation-Aware Attention (T5-RAA) sentiment model incorporates KG-derived relationship bias into the attention mechanism, enabling distinction between “cooperative positive events” and “competitive negative events”. Finally, the Bidirectional Long Short-Term Memory (BiLSTM) with Attention and Layer-wise Residual Connections (BA-LRC) prediction model takes the sentiment result from the T5-RAA model and employs residual blocks to preserve temporal features and stabilize training. Experiments on nine stocks in various markets demonstrate that the integration of the KG improves the F1-score of sentiment classification by 16%; the BA-LRC model achieves state-of-the-art prediction performance, with an average coefficient of determination (R2) of 0.9695 and a root mean square error (RMSE) of 2.0861, outperforming baseline models in continuous price forecasting tasks. While maintaining competitive trend direction accuracy comparable to top baselines, our model significantly reduces regression error, demonstrating superior capability in capturing precise market valuations. The trading simulation based on the model’s predictions demonstrates robust practical application value. This study has established a knowledge-driven forecasting paradigm, deeply integrating the relational semantics of the KG into sentiment analysis and time-series prediction, solving the problem of sentiment polarity bias caused by the lack of relational context; meanwhile, it provides a low-cost and adaptive solution for the construction of dynamic KGs in the financial field and enhances the model’s generalization ability across different markets and high-frequency scenarios.