Papers
Topics
Authors
Recent
2000 character limit reached

Parallel Hybrid LSTM-GNN for Stock Prediction

Updated 5 January 2026
  • The paper demonstrates the model’s superior prediction accuracy, achieving a 10.6% improvement over standalone LSTM networks.
  • It combines parallel LSTM sequence modeling with GNN-based relational encoding to fuse temporal trends and inter-stock dependencies.
  • Extensive experiments on ten large-cap stocks show robust convergence in 40–50 epochs and effective performance in real-time trading scenarios.

A parallel hybrid LSTM-GNN architecture is a composite deep learning system that simultaneously processes time-series data and relational data streams for enhanced stock price prediction accuracy. The architecture integrates Long Short-Term Memory (LSTM) networks—well-suited for modeling sequential dependencies in price movements—and Graph Neural Networks (GNNs), which encode polyadic relationships and nonlinear dependencies among stocks, as defined by correlation and association rule mining. The parallel design allows both analytic streams to operate concurrently, enabling direct fusion of temporal and relational embeddings in a downstream prediction head. Extensive experiments on historical stock datasets indicate a measurable performance advantage over both standalone LSTM networks and traditional neural benchmarks (Sonani et al., 19 Feb 2025).

1. LSTM Branch: Temporal Sequence Modeling

The LSTM component utilizes canonical gating mechanisms to learn representations of price histories per stock. Each time step tt for input xtRdx_t \in \mathbb{R}^d passes through the following update equations:

  • Input gate:

it=σ(Wixt+Uiht1+bi)i_t = \sigma(W_i x_t + U_i h_{t-1} + b_i)

  • Forget gate:

ft=σ(Wfxt+Ufht1+bf)f_t = \sigma(W_f x_t + U_f h_{t-1} + b_f)

  • Output gate:

ot=σ(Woxt+Uoht1+bo)o_t = \sigma(W_o x_t + U_o h_{t-1} + b_o)

  • Candidate update:

c~t=tanh(Wcxt+Ucht1+bc)\tilde{c}_t = \tanh(W_c x_t + U_c h_{t-1} + b_c)

  • Final cell and hidden state:

ct=ftct1+itc~tc_t = f_t \odot c_{t-1} + i_t \odot \tilde{c}_t

ht=ottanh(ct)h_t = o_t \odot \tanh(c_t)

Using daily closing prices (PtP_t) from 2005–2023 per stock, the raw time series is normalized by min–max scaling: x=xxminxmaxxminx' = \frac{x - x_{\min}}{x_{\max} - x_{\min}} Sliding windows of sequence length TT (tested: 11, 21) are extracted and fed into stacked LSTM layers (2–3 layers), followed by a dense projection layer to yield embeddings etLSTMRk\mathbf{e}_t^{\mathrm{LSTM}} \in \mathbb{R}^k.

2. GNN Branch: Relational Encoding

A stock correlation graph G=(V,E)G=(V, E) is constructed over V=10|V|=10 stocks (nodes). Edge definition uses both:

  • Pearson correlation of daily returns (ri,tr_{i,t}):

ri,t=Pi,tPi,t1Pi,t1r_{i,t} = \frac{P_{i,t} - P_{i,t-1}}{P_{i,t-1}}

ρij=t=1n(ri,trˉi)(rj,trˉj)t=1n(ri,trˉi)2t=1n(rj,trˉj)2\rho_{ij} = \frac{\sum_{t=1}^n (r_{i,t} - \bar{r}_i)(r_{j,t} - \bar{r}_j)} {\sqrt{\sum_{t=1}^n (r_{i,t}-\bar{r}_i)^2} \sqrt{\sum_{t=1}^n (r_{j,t}-\bar{r}_j)^2}}

An edge (i,j)(i, j) is added if ρij>0.7|\rho_{ij}| > 0.7.

  • Apriori association rules:
    • Edges are added if lift >1.7>1.7 with required support and confidence.

GNN propagation uses a standard Graph Convolutional Network (GCN) with symmetric normalization: H(l+1)=σ(D~1/2A~D~1/2H(l)W(l))H^{(l+1)} = \sigma(\tilde{D}^{-1/2} \tilde{A} \tilde{D}^{-1/2} H^{(l)} W^{(l)}) where A~=A+I\tilde{A}=A+I and σ\sigma denotes ReLU in hidden layers.

Initial node features combine normalized closing price, moving averages (50/200 day), recent daily returns, and normalized trading volume. After two GCN layers with 0.5 dropout, final node embeddings eiGNN\mathbf{e}_i^{\mathrm{GNN}} are generated.

3. Fusion Strategy: Embedding Concatenation and Prediction

The hybrid model maintains parallel branches:

  • Branch 1: LSTM encodes the temporal trajectory for each stock, producing ei,tLSTM\mathbf{e}_{i,t}^{\mathrm{LSTM}}.
  • Branch 2: GNN encodes the stock graph, resulting in ei,tGNN\mathbf{e}_{i,t}^{\mathrm{GNN}}.

Fusion occurs via vector concatenation: zi,t=[ei,tLSTMei,tGNN]R2k\mathbf{z}_{i,t} = [\mathbf{e}_{i,t}^{\mathrm{LSTM}} \Vert \mathbf{e}_{i,t}^{\mathrm{GNN}}] \in \mathbb{R}^{2k} This fused representation passes through two fully connected layers with ReLU, then a linear readout layer for next-day price prediction y^i,t+1\hat{y}_{i, t+1}. Gradient flow from MSE loss is propagated through both branches simultaneously, ensuring end-to-end learning.

4. Training Protocol and Optimization

An expanding window validation protocol is employed:

  • Initial training uses two years of data.
  • Prediction is conducted one day at a time for a subsequent 50-day out-of-sample period.
  • After each prediction, the observed price is appended to the training set and the model is retrained or fine-tuned before the next prediction. This approach emulates a real-time trading environment and prevents data leakage.

Key training specifications:

  • Loss function: Mean Squared Error (MSE)

L=1Ni=1N(y^iyi)2\mathcal{L} = \frac{1}{N}\sum_{i=1}^{N}(\hat{y}_i - y_i)^2

  • LSTM batch size: 11
  • Optimizer: Adam, learning rate 0.005
  • Epochs: 10–50, early stopping (patience 5, min δ\delta improvement)

Implementation utilizes PyTorch and PyTorch Geometric on a single NVIDIA GTX1080 GPU and Intel i7 CPU, without explicit multi-GPU or model/data parallelism. Computations for both LSTM and GNN branches run in parallel per minibatch.

5. Empirical Performance and Comparative Analysis

Experimental results on ten large-cap stocks (2005–2023) reveal the hybrid model's performance advantage:

Model MSE Relative Reduction
Hybrid LSTM–GNN 0.00144
Standalone LSTM 0.00161 10.6% worse
Linear Regression 0.00224
CNN 0.00302
DNN 0.00335

Convergence is typically achieved in 40–50 epochs. Early stopping mitigates overfitting and computational waste. The hybrid architecture demonstrates robustness with exception to specific volatile dates (Nov 10 and Nov 30, 2022).

Figures in (Sonani et al., 19 Feb 2025) substantiate accuracy improvements across all monitored stocks, with bar charts and heatmaps illustrating prediction precision.

6. Parallelism and Scalability Considerations

Although the described implementation does not utilize explicit multi-GPU parallelism, the separation of LSTM and GNN into distinct analytic branches naturally facilitates model-parallel strategies. In a scalable setting, LSTM and GNN computations could be assigned to separate GPUs, with embedding fusion performed via cross-device communication. End-to-end training remains feasible and may benefit from increased resource allocation. This suggests practical extensibility to larger stock universes and continual learning scenarios.

7. Significance and Applicability

The parallel hybrid LSTM-GNN architecture, as rigorously evaluated in (Sonani et al., 19 Feb 2025), demonstrates empirically improved accuracy and robustness in next-day stock price prediction over established baselines. By fusing temporal and relational analysis, the model addresses both per-stock sequential dynamics and nonlinear inter-stock dependencies, offering an adaptable tool for real-time financial analytics. A plausible implication is that similar architectures may generalize to other domains where temporal and relational phenomena are coupled, such as traffic forecasting and resource optimization.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Whiteboard

Topic to Video (Beta)

Follow Topic

Get notified by email when new papers are published related to Parallel Hybrid LSTM-GNN.