Explainable Text-Driven Neural Network for Stock Prediction

Linyi Yang, Zheng Zhang, Su Xiong, Lirui Wei, James Ng, Lina Xu, Ruihai Dong

Introduction

Predicting stock market movements remains a central challenge in financial engineering. While the Efficient Market Hypothesis posits that stock prices reflect all available information, extracting actionable insights from the vast volume of financial news is complex. Traditional approaches often suffer from two primary limitations: the propagation of errors from natural language processing (NLP) tools and a lack of interpretability, often referred to as the "black box" problem. This paper presents GRU-2ATT, a dual-layer attention-based neural network designed to address these issues by providing explainable predictions based on financial news analysis.

Methodology

The GRU-2ATT architecture integrates Gated Recurrent Units (GRUs) with a two-stage attention mechanism to capture both intra-day and inter-day news influences.

The GRU-2ATT architecture featuring dual attention layers for intra-day and inter-day news weighting.

Knowledge-Graph Enrichment

To mitigate information loss, the model utilizes knowledge bases like Wikipedia to identify entities related to a target company. For instance, news regarding a subsidiary like YouTube is linked to its parent company, Google, ensuring the model captures a broader context of market-moving events. This prevents the model from missing crucial news that doesn't explicitly mention the target ticker.

Model Components

  1. Vector Representation: News titles are transformed into 300-dimensional sentence embeddings. A "Day Embedding" is also learned to account for temporal variations.
  2. Intra-day Attention: This layer assigns weights to individual news events within a single day, allowing the model to prioritize significant headlines over irrelevant "noise."
  3. Temporal Processing: A GRU layer processes the sequence of daily news representations over a 7-day window to capture temporal patterns.
  4. Inter-day Attention: This second attention layer identifies which specific days within the look-back period had the greatest impact on the predicted price movement.
  5. Classification: A Softmax classifier generates a binary prediction indicating whether the stock price will rise or fall.

Experimental Setup

The model was evaluated using financial news from Reuters and Bloomberg spanning from October 2006 to November 2013. The dataset focused on three major stocks: 3M (MMM), Google (GOOG), and Apple (AAPL), comprising over 680,000 news items in total. Data was partitioned into a Training Set (1480 days), a Testing Set (180 days), and a Validation Set (180 days).

Results and Analysis

The proposed GRU-2ATT model consistently outperformed baseline models, including standard neural networks (EB-NN) and convolutional neural networks (EB-CNN), across all tested companies.

Performance comparison of GRU-2ATT against baseline models across three target stocks, showing superior Accuracy (ACC) and MCC scores.

Beyond quantitative performance, the model offers qualitative interpretability. In a specific case study for Google, the model correctly predicted a price drop and pointed to a news headline about a copyright lawsuit against YouTube as the primary driver, assigning it a high attention weight of 0.514. This demonstrates the model's ability to serve as an analytical tool for traders, providing the "why" behind the prediction.

Conclusion

The GRU-2ATT framework successfully bridges the gap between high-accuracy deep learning and human-understandable financial analysis. By leveraging knowledge graphs and dual-layer attention, the model filters noise and highlights critical market drivers. While currently limited to binary direction prediction and a fixed 7-day window, it represents a significant step toward explainable AI in finance.

Summary updated

BibTeX
@inproceedings{yang2018explainable,
  author = {Linyi Yang and Zheng Zhang and Su Xiong and Lirui Wei and James Ng and Lina Xu and Ruihai Dong},
  title = {{Explainable Text-Driven Neural Network for Stock Prediction}},
  booktitle = {CCIS},
  year = {2018},
  url = {https://openreview.net/forum?id=44nTEHaCUjZ},
}
Figure