Transformers versus LSTMs for electronic trading
Authors: Paul Bilokon, Yitao Qiu
Abstract
With the rapid development of artificial intelligence, long short term memory (LSTM), one kind of recurrent neural network (RNN), has been widely applied in time series prediction. Like RNN, Transformer is designed to handle the sequential data. As Transformer achieved great success in Natural Language Processing (NLP), researchers got interested in Transformer's performance on time series prediction, and plenty of Transformer-based solutions on long time series forecasting have come out recently. However, when it comes to financial time series prediction, LSTM is still a dominant architecture. Therefore, the question this study wants to answer is: whether the Transformer-based model can be applied in financial time series prediction and beat LSTM. To answer this question, various LSTM-based and Transformer-based models are compared on multiple financial prediction tasks based on high-frequency limit order book data. A new LSTM-based model called DLSTM is built and new architecture for the Transformer-based model is designed to adapt for financial prediction. The experiment result reflects that the Transformer-based model only has the limited advantage in absolute price sequence prediction. The LSTM-based models show better and more robust performance on difference sequence prediction, such as price difference and price movement.
The papers around it, by date and closeness
Higher is closer to this paper; left is older. Lines join papers close to each other: groups of lines are sub-topics. Select a point to see why it is there. Back to the summary of this paper
Papers around this one
Ranked by how close their title and abstract are to this paper’s. Select some to read them together.
Closest papers
-
Are Transformers Effective for Time Series Forecasting?Ailing Zeng, Muxi Chen, Lei Zhang et al. · 2022 · Artificial Intelligence · cited 5,102 times · AI summary available
Are Transformers Effective for Time Series Forecasting? examines whether Transformers suit long-term time-series forecasting, motivating this paper’s comparison on financial sequences.
Abstract
Recently, there has been a surge of Transformer-based solutions for the time series forecasting (TSF) task, especially for the challenging long-term TSF problem. Transformer architecture relies on self-attention mechanisms to effectively extract the semantic correlations between paired elements in a long sequence, which is permutation-invariant and anti-ordering to some extent. However, in time series modeling, we are to extract the temporal relations among an ordering set of continuous points. Consequently, whether Transformer-based techniques are the right solutions for long-term time series forecasting is an interesting problem to investigate, despite the performance improvements shown in…
-
Exploring the Advantages of Transformers for High-Frequency TradingFazl Barez, Paul Bilokon, Arthur Gervais et al. · 2023 · Statistical Finance · cited 8 times · AI summary available
Exploring the Advantages of Transformers for High-Frequency Trading compares Transformers with LSTMs for high-frequency Bitcoin-USDT return forecasting.
Abstract
This paper explores the novel deep learning Transformers architectures for high-frequency Bitcoin-USDT log-return forecasting and compares them to the traditional Long Short-Term Memory models. A hybrid Transformer model, called \textbf{HFformer}, is then introduced for time series forecasting which incorporates a Transformer encoder, linear decoder, spiking activations, and quantile loss function, and does not use position encoding. Furthermore, possible high-frequency trading strategies for use with the HFformer model are discussed, including trade sizing, trading signal aggregation, and minimal trading threshold. Ultimately, the performance of the HFformer and Long Short-Term Memory model…
-
Financial series prediction using Attention LSTMSangyeon Kim, Myung-joo Kang · 2019 · arXiv.org · preprint, not peer reviewed · cited 70 times · Not summarized yet
Financial series prediction using Attention LSTM compares attention-based and other deep-learning models for financial time-series prediction.
Abstract
Financial time series prediction, especially with machine learning techniques, is an extensive field of study. In recent times, deep learning methods (especially time series analysis) have performed outstandingly for various industrial problems, with better prediction than machine learning methods. Moreover, many researchers have used deep learning methods to predict financial time series with various models in recent years. In this paper, we will compare various deep learning models, such as multilayer perceptron (MLP), one-dimensional convolutional neural networks (1D CNN), stacked long short-term memory (stacked LSTM), attention networks, and weighted attention networks for financial time…
-
Financial Time Series Forecasting using CNN and TransformerZhen Zeng, Rachneet Kaur, Suchetha Siddagangappa et al. · 2023 · Machine Learning · preprint, not peer reviewed · cited 72 times · AI summary available
Financial Time Series Forecasting using CNN and Transformer combines CNNs and Transformers to forecast financial series, rather than comparing Transformer and LSTM models.
Abstract
Time series forecasting is important across various domains for decision-making. In particular, financial time series such as stock prices can be hard to predict as it is difficult to model short-term and long-term temporal dependencies between data points. Convolutional Neural Networks (CNN) are good at capturing local patterns for modeling short-term dependencies. However, CNNs cannot learn long-term dependencies due to the limited receptive field. Transformers on the other hand are capable of learning global context and long-term dependencies. In this paper, we propose to harness the power of CNNs and Transformers to model both short-term and long-term dependencies within a time series, a…
-
Informer: Beyond Efficient Transformer for Long Sequence Time-Series ForecastingHaoyi Zhou, Shang-Hang Zhang, Jieqi Peng et al. · 2020 · AAAI Conference on Artificial Intelligence · cited 9,530 times · Not summarized yet
Informer develops an efficient Transformer for long-sequence time-series forecasting, a methodological line this paper adapts to financial prediction.
Abstract
Many real-world applications require the prediction of long sequence time-series, such as electricity consumption planning. Long sequence time-series forecasting (LSTF) demands a high prediction capacity of the model, which is the ability to capture precise long-range dependency coupling between output and input efficiently. Recent studies have shown the potential of Transformer to increase the prediction capacity. However, there are several severe issues with Transformer that prevent it from being directly applicable to LSTF, including quadratic time complexity, high memory usage, and inherent limitation of the encoder-decoder architecture. To address these issues, we design an efficient tr…
-
A Comparative Analysis of Forecasting Financial Time Series Using ARIMA, LSTM, and BiLSTMS. Siami-Namini, Neda Tavakoli, A. Namin · 2019 · arXiv.org · preprint, not peer reviewed · cited 161 times · Not summarized yet
A Comparative Analysis of Forecasting Financial Time Series Using ARIMA, LSTM, and BiLSTM compares recurrent models for financial forecasting without Transformers.
Abstract
Machine and deep learning-based algorithms are the emerging approaches in addressing prediction problems in time series. These techniques have been shown to produce more accurate results than conventional regression-based modeling. It has been reported that artificial Recurrent Neural Networks (RNN) with memory, such as Long Short-Term Memory (LSTM), are superior compared to Autoregressive Integrated Moving Average (ARIMA) with a large margin. The LSTM-based models incorporate additional "gates" for the purpose of memorizing longer sequences of input data. The major question is that whether the gates incorporated in the LSTM architecture already offers a good prediction and whether additiona…
-
Deep learning with long short-term memory networks for financial market predictionsThomas G. Fischer, Christopher Krauss · 2017 · European Journal of Operational Research · cited 2,746 times · Not summarized yet
Deep learning with long short-term memory networks for financial market predictions applies LSTMs to predict stock movements, rather than comparing them with Transformers.
Abstract
Long short-term memory (LSTM) networks are a state-of-the-art technique for sequence learning. They are less commonly applied to financial time series predictions, yet inherently suitable for this domain. We deploy LSTM networks for predicting out-of-sample directional movements for the constituent stocks of the S&P 500 from 1992 until 2015. With daily returns of 0.46 percent and a Sharpe ratio of 5.8 prior to transaction costs, we find LSTM networks to outperform memory-free classification methods, i.e., a random forest (RAF), a deep neural net (DNN), and a logistic regression classifier (LOG). The outperformance relative to the general market is very clear from 1992 to 2009, but as of 2010…
-
Financial time series forecasting model based on CEEMDAN and LSTMJianmei Cao, Zhi Li, Jian Li · 2019 · Physica A: Statistical Mechanics and its Applications · cited 667 times · Not summarized yet
Financial time series forecasting model based on CEEMDAN and LSTM combines decomposition with LSTM to forecast stock prices.
Abstract
Abstract In order to improve the accuracy of the stock market prices forecasting, two hybrid forecasting models are proposed in this paper which combine the two kinds of empirical mode decomposition (EMD) with the long short-term memory (LSTM). The financial time series is a kind of non-linear and non-stationary random signal, which can be decomposed into several intrinsic mode functions of different time scales by the original EMD and the complete ensemble empirical mode decomposition with adaptive noise (CEEMDAN). To ensure the effect of historical data onto the prediction result, the LSTM prediction models are established for all each characteristic series from EMD and CEEMDAN deposition.…
Prior work it builds on
-
Enhancing the Locality and Breaking the Memory Bottleneck of Transformer on Time Series ForecastingSHIYANG LI, Xiaoyong Jin, Yao Xuan et al. · 2019 · Neural Information Processing Systems · cited 2,108 times · Not summarized yet
Enhancing the Locality and Breaking the Memory Bottleneck of Transformer on Time Series Forecasting modifies Transformers to address locality and memory limits in forecasting.
Abstract
Time series forecasting is an important problem across many domains, including predictions of solar plant energy output, electricity consumption, and traffic jam situation. In this paper, we propose to tackle such forecasting problem with Transformer [1]. Although impressed by its performance in our preliminary study, we found its two major weaknesses: (1) locality-agnostics: the point-wise dot-product self-attention in canonical Transformer architecture is insensitive to local context, which can make the model prone to anomalies in time series; (2) memory bottleneck: space complexity of canonical Transformer grows quadratically with sequence length $L$, making directly modeling long time se…
-
FEDformer: Frequency Enhanced Decomposed Transformer for Long-term Series ForecastingTian Zhou, Ziqing Ma, Qingsong Wen et al. · 2022 · International Conference on Machine Learning · cited 3,964 times · Not summarized yet
FEDformer combines decomposition and Transformers for long-term forecasting, addressing time-series modeling challenges relevant to this paper’s Transformer adaptation.
Abstract
Although Transformer-based methods have significantly improved state-of-the-art results for long-term series forecasting, they are not only computationally expensive but more importantly, are unable to capture the global view of time series (e.g. overall trend). To address these problems, we propose to combine Transformer with the seasonal-trend decomposition method, in which the decomposition method captures the global profile of time series while Transformers capture more detailed structures. To further enhance the performance of Transformer for long-term prediction, we exploit the fact that most time series tend to have a sparse representation in well-known basis such as Fourier transform…
-
Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series ForecastingHaixu Wu, Jie-Hui Xu, Jian-Min Wang et al. · 2021 · Neural Information Processing Systems · cited 6,148 times · Not summarized yet
Autoformer introduces decomposition and autocorrelation for long-term time-series forecasting, extending Transformer methods relevant to this paper’s comparison.
Abstract
Extending the forecasting time is a critical demand for real applications, such as extreme weather early warning and long-term energy consumption planning. This paper studies the long-term forecasting problem of time series. Prior Transformer-based models adopt various self-attention mechanisms to discover the long-range dependencies. However, intricate temporal patterns of the long-term future prohibit the model from finding reliable dependencies. Also, Transformers have to adopt the sparse versions of point-wise self-attentions for long series efficiency, resulting in the information utilization bottleneck. Going beyond Transformers, we design Autoformer as a novel decomposition architectu…
-
Stock Price Prediction Based on Temporal Fusion TransformerXiao-Kang Hu · 2021 · 2021 3rd International Conference on Machine Learning, Big Data and Business Intelligence (MLBDBI) · cited 41 times · Not summarized yet
Stock Price Prediction Based on Temporal Fusion Transformer applies a Transformer architecture to stock-price prediction.
Abstract
Stock price prediction has been an important financial problem which receives increasing attention in the past decades. Existing literature focusing on stock markets forecasting considers the high volatility of stock prices caused by multiple factors. During past years, a number of deep neural networks have been gaining much attention, achieving more accurate results compared to the traditional linear and non-linear approaches. However, most of these neural networks only take time-series features into consideration, ignoring static metadata potentially affecting stock markets. This paper utilizes the state-of-art Temporal Fusion Transformer (TFT) for stock price prediction compared with Supp…
-
Deep order flow imbalance: Extracting alpha at multiple horizons from the limit order bookP. Kolm, J. Turiel, Nicholas Westray · 2023 · Social Science Research Network · cited 56 times · Not summarized yet
Deep order flow imbalance uses deep learning on limit-order-book data to forecast high-frequency stock returns, sharing this paper’s data setting.
Abstract
We employ deep learning in forecasting high‐frequency returns at multiple horizons for 115 stocks traded on Nasdaq using order book information at the most granular level. While raw order book states can be used as input to the forecasting models, we achieve state‐of‐the‐art predictive accuracy by training simpler “off‐the‐shelf” artificial neural networks on stationary inputs derived from the order book. Specifically, models trained on order flow significantly outperform most models trained directly on order books. Using cross‐sectional regressions, we link the forecasting performance of a long short‐term memory network to stock characteristics at the market microstructure level, suggesting…
Papers that cite it
-
Transformers and attention-based networks in quantitative trading: a comprehensive surveyLucas Coelho e Silva, Gustavo de Freitas Fonseca, Paulo Andre L. Castro · 2024 · International Conference on AI in Finance · cited 19 times · Not summarized yet
Transformers and attention-based networks in quantitative trading surveys their use in financial analysis and trading, including price-movement prediction.
Abstract
Since the advent of the transformer neural network architecture, there has been a rapid adoption and investigation of its applicability in various domains, such as computer vision, speech processing, and natural language processing, with the latter most notably exemplified by the rise of Large Language Models. These accomplishments have also led to increased interest in other network architectures that rely on attention mechanisms, one of the building blocks of transformers. Transformers and other attention-based networks are being applied to the quantitative analysis, management, and trading of financial assets, be it for price movement prediction, discovery of trading strategies, portfolio…
-
From RNNs to Transformers: benchmarking deep learning architectures for hydrologic predictionJiang-Tao Liu, Chaopeng Shen, Fearghal O'Donncha et al. · 2025 · Hydrology and Earth System Sciences · cited 51 times · Not summarized yet
From RNNs to Transformers benchmarks LSTM and attention-based models for hydrologic prediction, applying a similar comparison outside finance.
Abstract
Abstract. Recurrent Neural Networks (RNNs) such as Long Short-Term Memory (LSTM) have achieved significant success in hydrological modeling. However, the recent breakthroughs of foundation models like ChatGPT and the Segment Anything Model (SAM) in natural language processing and computer vision have raised interest in the potential of attention mechanism-based models for hydrologic predictions. In this study, we propose a deep learning framework that seamlessly integrates multi-source, multi-scale data and multi-model modules, creating an automated platform for multi-dataset benchmarking and attention-based model comparisons beyond LSTM-centered tasks. The proposed framework enables evaluat…
-
Advancing Volatility Forecasting in Financial Indices: Integrating GARCH Models, Multifractal Indicators, and Deep LearningNaima Oualla, M. Chiadmi, Youssef Lamrani Alaoui · 2026 · Statistics, Optimization & Information Computing · cited 1 time · Not summarized yet
Advancing Volatility Forecasting in Financial Indices compares LSTM, GRU, and Transformer approaches for financial volatility forecasting.
Abstract
Accurate volatility prediction is essential for effective investment strategies and risk awareness. Yet, the intricate and ever-changing characteristics of markets pose considerable challenges, motivating the use of hybrid frameworks by integrating heteroscedastic models, multifractal analysis, and deep learning techniques. While heteroscedastic models are simple and widely adopted, they often fail to reflect the inherent nonlinearities and multifractal properties of volatility. In contrast, LSTM, GRU, and Transformers, while capable of capturing complex structures, require well-chosen explanatory variables to deliver accurate forecasts. Accordingly, this study conducts a rigorous comparativ…
-
Day Trading Strategy Based on Transformer Model, Technical Indicators and Multiresolution AnalysisS. A. Mohammed · 2024 · International Journal of Advanced Computer Science and Applications · cited 1 time · Not summarized yet
Day Trading Strategy Based on Transformer Model, Technical Indicators and Multiresolution Analysis uses a Transformer in a stock-trading strategy.
Abstract
—Stock prices are very volatile because they are affected by infinite number of factors, such as economical, social, political, and human behavior. This makes finding consistently profitable day trading strategy extremely challenging and that is why an overwhelming majority of stock traders loose money over time. Professional day traders, who are very few in number, have a trading strategy that can exploit this price volatility to consistently earn profit from the market. This study proposes a consistently profitable day trading strategy based on price volatility, transformer model, time2vec, technical indicators, and multiresolution analysis. The proposed trading strategy has eight trading …
-
Forecast-Then-Optimize Deep Learning MethodsJinhang Jiang, Nan Wu, Ben Liu et al. · 2025 · arXiv.org · preprint, not peer reviewed · Not summarized yet
Forecast-Then-Optimize Deep Learning Methods surveys methods for improving forecasts through optimization, a broader topic than this paper’s model comparison.
Abstract
Time series forecasting underpins vital decision-making across various sectors, yet raw predictions from sophisticated models often harbor systematic errors and biases. We examine the Forecast-Then-Optimize (FTO) framework, pioneering its systematic synopsis. Unlike conventional Predict-Then-Optimize (PTO) methods, FTO explicitly refines forecasts through optimization techniques such as ensemble methods, meta-learners, and uncertainty adjustments. Furthermore, deep learning and large language models have established superiority over traditional parametric forecasting models for most enterprise applications. This paper surveys significant advancements from 2016 to 2025, analyzing mainstream d…
Go further
How are these papers found?
We compare the title and abstract of this paper with those of every paper summarized on this site, and with the papers Semantic Scholar recommends, those it cites and those citing it (for a much-cited paper, its most recent citations and, from OpenAlex, the most cited ones). Among the prior work and the follow-ups, the papers that use each other in depth, a method it uses and the much-cited follow-ups come a little higher. The levels (very close, close, related) come from the similarity of the texts, not from a judgment of quality; * marks a paper without an abstract, compared by its title. The sentence under a paper is written by an AI from the two abstracts: check it in the papers. A paper marked not relevant by three readers leaves the list.
Updated on 4 November 2026.