Adaptive Stock Market Prediction Using Node Transformer Architectures with Sentiment Analysis and Reinforcement Learning Control
En cours de chargement...
Date
Authors
Nom de la revue
ISSN de la revue
Titre du volume
Éditeur
Université d'Ottawa / University of Ottawa
Résumé
Stock market prediction remains a central problem in quantitative finance, complicated by non-stationary price dynamics, complex inter-stock dependencies, and the influence of investor sentiment on price formation. Traditional forecasting methods, including statistical models and standard deep learning architectures, typically treat stocks as independent time series and process all market conditions through a single model, limiting their capacity to capture cross-sectional structure and adapt to regime shifts. This thesis develops a series of progressively more capable architectures for stock price forecasting, evaluated on 20 S&P 500 equities spanning January 1982 to March 2025.
The first contribution introduces a node transformer architecture that models the stock market as a graph in which individual stocks form nodes and learnable edges encode sectoral affiliations and return correlations. A fine-tuned BERT model extracts sentiment signals from approximately 4.2 million social media posts, integrated with quantitative market features through an attention-based fusion mechanism that dynamically adjusts the relative contribution of each modality based on volatility and sentiment magnitude. This system achieves 0.80% mean absolute percentage error (MAPE) for one-day-ahead predictions and 65% directional accuracy. Ablation studies confirm that graph structure contributes a 15% relative error reduction and sentiment integration a further 10%, with the largest sentiment gains occurring during earnings announcements where error decreases by 25%.
The second contribution addresses a persistent weakness of the first system: degraded performance during volatile market periods. An autoencoder trained exclusively on stable market data identifies regime shifts through reconstruction error, gating data flow into dual node transformer pathways specialized for normal and event-driven conditions respectively. The event pathway incorporates additional context features including volatility regime embeddings, sentiment spikes, earnings proximity, and cross-asset stress indicators. A Soft Actor-Critic reinforcement learning controller learns optimal regime detection thresholds and pathway blending weights directly from prediction performance feedback, discovering useful regime boundaries without requiring manual labeling or predefined volatility rules. The complete adaptive system achieves 0.59% MAPE and 72% directional accuracy, maintaining performance below 0.85% MAPE during high-volatility episodes where the baseline single-path model exceeds 1.5%.
The third contribution proposes a framework for evaluating the behavioral quality of autonomous prediction systems using large language models as judges. Conventional metrics such as MAPE and directional accuracy describe only the final prediction output, revealing nothing about whether intermediate decisions along the pipeline were sound. The proposed framework assesses decision quality across six dimensions: regime detection accuracy, routing appropriateness, adaptation responsiveness, risk calibration, strategy coherence, and error recovery. Perturbation-based validation yields cross-model consistency up to Krippendorff's α = 0.85, and composite scores correlate with realized Sharpe ratios at ρ = 0.72. The framework closes the evaluation loop by translating LLM diagnostic outputs into auxiliary reward signals for the reinforcement learning controller, yielding further improvement to 0.54% MAPE and 74% directional accuracy.
Across all three contributions, paired t-tests confirm statistical significance of performance improvements (p < 0.05 for all comparisons), and systematic ablation studies isolate the marginal contribution of each architectural component. The progression from a single graph transformer to a regime-aware adaptive system with closed-loop behavioral evaluation demonstrates that jointly modeling inter-stock dependencies, market regime dynamics, and investor sentiment produces forecasts that are both more accurate and more robust than approaches addressing these dimensions in isolation.
Description
Mots-clés
Stock market prediction, Financial time series forecasting, Node transformer, Graph neural networks, Sentiment analysis, BERT, Reinforcement learning, Soft actor-critic, Market regime detection, Large language model evaluation

