[Paper Review] A Comparison of LSTMs and Attention Mechanisms for Forecasting Financial Time Series
This paper proposes and evaluates an LSTM with self-attention mechanisms for financial time series forecasting using Kaggle's Two Sigma dataset. It demonstrates that the attention-augmented LSTM outperforms a standard LSTM, achieving up to 60% accuracy on five stocks, though with higher variability, confirming that attention improves performance on long-term dependencies in FTS.
While LSTMs show increasingly promising results for forecasting Financial Time Series (FTS), this paper seeks to assess if attention mechanisms can further improve performance. The hypothesis is that attention can help prevent long-term dependencies experienced by LSTM models. To test this hypothesis, the main contribution of this paper is the implementation of an LSTM with attention. Both the benchmark LSTM and the LSTM with attention were compared and both achieved reasonable performances of up to 60% on five stocks from Kaggle's Two Sigma dataset. This comparative analysis demonstrates that an LSTM with attention can indeed outperform standalone LSTMs but further investigation is required as issues do arise with such model architectures.
Motivation & Objective
- To evaluate whether attention mechanisms can improve long short-term memory (LSTM) models for financial time series (FTS) forecasting.
- To implement and benchmark an LSTM with self-attention against a standard LSTM on real-world financial data.
- To investigate the impact of data preprocessing and evaluation strategies such as rolling window and rolling origin recalibration on model performance.
- To explore the limitations of single-step forecasting and the potential of sequence-to-sequence (seq2seq) modeling for multi-step predictions.
- To identify key challenges in confidence interval integration and hyperparameter tuning for attention-enhanced FTS models.
Proposed method
- The model architecture combines a unidirectional LSTM with a scaled dot-product attention mechanism to dynamically weigh input features across time steps.
- Attention weights are computed using query, key, and value matrices derived from the LSTM’s hidden states, enabling context-aware feature focusing.
- The final prediction is computed by applying a weighted sum of values, where weights are determined by the compatibility between query and key vectors.
- The model is trained end-to-end on five stocks from Kaggle’s Two Sigma dataset using mean squared error loss and Adam optimization.
- Performance is evaluated using up-down accuracy on price direction prediction, with confidence scores output via a tanh activation to normalize between -1 and 1.
- Evaluation strategies include rolling window and rolling origin recalibration to assess robustness under market volatility.
Experimental results
Research questions
- RQ1Can attention mechanisms improve the performance of LSTMs in forecasting financial time series?
- RQ2How does the attention-augmented LSTM compare to a standard LSTM in terms of predictive accuracy across multiple stocks?
- RQ3What impact do different data preprocessing and evaluation strategies (e.g., rolling origin) have on model performance and stability?
- RQ4To what extent does the attention mechanism mitigate the long-term dependency problem in LSTMs for FTS forecasting?
- RQ5How do confidence scores and hyperparameter tuning affect the practical utility of attention-enhanced models in FTS applications?
Key findings
- The standard LSTM achieved consistent performance in the 58% accuracy range across five stocks, aligning with state-of-the-art models.
- The LSTM with attention achieved up to 60% accuracy, demonstrating a measurable improvement over the baseline model.
- The attention-augmented model showed higher variability in performance across stocks compared to the standard LSTM.
- The model's ability to perform sequence-to-sequence forecasting mitigates error cascade issues common in iterative multi-step prediction.
- Confidence scores were not integrated into the primary accuracy metric, highlighting a gap in model deployment for real-world trading.
- Hyperparameter sensitivity differed between the two models, suggesting that Bayesian optimization is essential for optimal tuning in future work.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.