{"paper_id":"2309.11400","title":"Transformers versus LSTMs for electronic trading","authors":["Paul Bilokon","Yitao Qiu"],"paper_date":"2023-09-20","paper_type":"empirical","paper_url":"https://arxiv.org/pdf/2309.11400v1","page_url":"https://thequant.space/flowcharts/transformers-versus-lstms-for-electronic-trading/","scores":{"empirical_rigor":8,"math_complexity":5.5,"quadrant":"Holy Grail"},"proposes":{"status":"available","statement":"The paper introduces a new LSTM-based model called DLSTM and designs a new Transformer architecture adapted for financial prediction.","quote":"A new LSTM-based model called DLSTM is built and new architecture for the Transformer-based model is designed to adapt for financial prediction.","summary":"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…","strategy":null},"assumptions":{"status":"available","items":[{"assumption":"Price difference sequences are approximately stationary and easier to predict than absolute prices.","type":"statistical","stated":"explicit","quote":"According to Ruppert [5], the absolute price information is generally non-stationary, while the price change information, such as price difference and return and approximately stationary."},{"assumption":"Mid-price movement can be approximated by a classification task using smoothed labels.","type":"model","stated":"explicit","quote":"For this reason, an easier classification task for predicting mid-price movement is introduced here."},{"assumption":"Transaction costs are a flat 0.002% per trade in the trading simulation.","type":"execution","stated":"explicit","quote":"of 0.002% to further compare the robustness among different models."},{"assumption":"Training, validation and test sets are normalized by the training set mean and standard deviation.","type":"data","stated":"explicit","quote":"test set are normalized by the mean and standard deviation of the training set."},{"assumption":"Models are trained for 10 epochs with early stopping using Adam optimizer.","type":"model","stated":"explicit","quote":"All the models are trained for 10 epochs using the Adaptive Momentum Estimation optimizer and L2 loss with early stopping."}]},"datasets":{"status":"available","items":[{"name":"BTC-USDT LOB data (one day)","provider":"Binance Exchange via cryptofeed","kind":"order-book","access":"public","period":"2022-07-15","universe":"BTC-USDT","quote":"one-day LOB data of product BTC-USDT (Bitcoin-U.S. dollar tether) on 2022.07.15 containing 863397 ticks","known_id":"binance"},{"name":"BTC-USDT LOB data (four days)","provider":"Binance Exchange via cryptofeed","kind":"order-book","access":"public","period":"2022-07-03 to 2022-07-06","universe":"BTC-USDT","quote":"four days of LOB data for the product BTC-USDT from 2022.07.03 (inclusive) to 2022.07.06 (inclusive) is used, containing 3432211 ticks","known_id":"binance"},{"name":"ETH-USDT LOB data (12 days)","provider":"Binance Exchange via cryptofeed","kind":"order-book","access":"public","period":"2022-07-03 to 2022-07-14","universe":"ETH-USDT","quote":"the whole dataset contains 12 days of LOB data of product ETH-USDT (Ethereum-U.S. dollar tether) from 2022.07.03 (inclusive) to 2022.07.14 (inclusive), containing 10255144 ticks","known_id":"binance"}],"known":[{"id":"binance","name":"Binance","provider":"Binance","kind":"market-prices","access":"public","quote":"Systematically compare Transformer-based and LSTM-based methods in different financial predic-tion tasks based on high frequency LOB data collected from Binance Exchange.","mentions":2,"used_in":1}],"sample":{"start":null,"end":null,"market":null,"asset_class":null,"frequency":null},"data_resolution":"l2-book"},"transaction_costs":{"status":"available","modeled":"partial","headline_net_of_costs":null,"detail":"A flat 0.002% commission fee is applied in the simple trading simulation.","quote":"of 0.002% to further compare the robustness among different models.","source":"front_matter","rule":"R3","candidates":{"front_matter":"partial","evidence_card":"partial","evidence_card_quoted":true},"card_detail":"A flat 0.002% commission fee is applied in the simple trading simulation.","card_quote":"of 0.002% to further compare the robustness among different models.","meaning":"costs appear only as a robustness check, a flat fee without spread or impact, or outside the headline numbers"},"results":{"status":"available","evaluation_type":"unclear","findings":[{"finding":"FEDformer and Autoformer achieve lower MSE and MAE than LSTM in mid-price prediction across all horizons.","kind":"performance","quote":"Both FEDformer and Autoformer outperform LSTM and FEDformer has the best performance in all the prediction lengths."},{"finding":"LSTM outperforms Informer, Reformer, and vanilla Transformer in mid-price prediction, showing robustness to LOB data.","kind":"performance","quote":"LSTM outperforms the other three models: Informer, Reformer, and vanilla Transformer, which indicates that LSTM is robust in handling LOB data"},{"finding":"DLSTM achieves the highest cumulative return (CPR) and Sharpe Ratio (SR) under a 0.002% transaction cost, outperforming all other models.","kind":"performance","quote":"DLSTM’s strong profitability and robustness against the risk brought by the transaction cost. LSTM-based methods’ performance is generally better than Transformer-based methods."},{"finding":"Transformer-based models’ performance degrades significantly with transaction costs, with Autoformer yielding negative CPRs at longer horizons.","kind":"negative","quote":"Interestingly, Transformer-based models’ performance drops significantly under the transaction cost. The state-of-the-art Autoformer produces even less profit than vanilla Transformer, yielding negative CPRs and SRs in prediction horizon 50 and 100"},{"finding":"In mid-price difference prediction, LSTM-based methods are more robust and achieve higher R² than Transformer-based models, which are limited by their time decomposition architecture.","kind":"performance","quote":"LSTM-based methods show their robustness in time series prediction and perform better than Transformer-based models, which reach the highest 11.5% R2 in around 10 prediction steps."}],"reported_performance":null,"out_of_sample":{"method":"holdout","headline_out_of_sample":null}},"independent_evidence":{"status":"none_found","supports":[],"contradicts":[],"qualifies":[],"compared_with":37,"citations":{"cited_by_in_corpus":0,"by_independent_authors":0,"how_cited":{"used_as_baseline":0,"uses_method_or_data":0,"extends":0,"discusses_findings":0,"mentions":0,"unclassified":0},"independent_papers":[],"scope":"Citations between papers in this corpus only; citations from outside it are not counted."}},"implementation":{"status":"available","public":true,"code_url":"https://github.com/772435284/transformers_versus_lstms_for_electronic_trading","note":null},"replication":{"status":"none_found","card":null,"note":"No replication of this paper has been run by thequant.space yet."},"extraction":{"text_source":"fulltext","model":"openai/gpt-oss-120b","version":1,"extracted_at":"2026-11-14T18:22:00Z"},"provenance":{"claims":"Everything here is what the authors state in the paper. Nothing was re-run or reproduced by the platform.","quotes":"Assumptions, datasets, cost detail and findings were extracted by a language model. Every quote is verbatim paper text. Where an item has `support`, \"full\" means every figure in it appears in the quoted sentences and \"partial\" means a figure is stated elsewhere in the paper; items with a figure found nowhere in the paper were discarded.","datasets_known":"datasets.known lists well-known vendors and public datasets by a stable id, found by a dictionary over the full text where the sentence says the data is used; it is independent of the model and covers only names in the dictionary.","flags":"transaction_costs.modeled, results.evaluation_type and results.out_of_sample.method are platform classifications (structured-decision models); see https://thequant.space/score-guide/#penalty-flags","comparisons":"supports / contradicts / qualifies are a language model's reading of two papers' quoted findings, restricted to closely related papers that share no author. They are pointers to read, not verified replications, and coverage is partial.","implementation":"code_url is a repository the paper itself presents as its own (rule-scored, ambiguous cases judged by a model), checked for liveness when it was recorded."},"docs":"https://thequant.space/agents/"}