IDEAS home Printed from https://ideas.repec.org/a/gam/jmathe/v13y2025i9p1484-d1646790.html
   My bibliography  Save this article

A Novel Hybrid Approach Using an Attention-Based Transformer + GRU Model for Predicting Cryptocurrency Prices

Author

Listed:
  • Esam Mahdi

    (School of Mathematics and Statistics, Carleton University, Ottawa, ON K1S 5B6, Canada)

  • Carlos Martin-Barreiro

    (Facultad de Ingeniería, Universidad Espíritu Santo, Samborondón 0901952, Ecuador)

  • Xavier Cabezas

    (Facultad de Ciencias Naturales y Matemáticas, Escuela Superior Politécnica del Litoral ESPOL, Guayaquil 090902, Ecuador
    Centro de Estudios e Investigaciones Estadísticas, Escuela Superior Politécnica del Litoral ESPOL, Guayaquil 090902, Ecuador)

Abstract

In this article, we introduce a novel deep learning hybrid model that integrates attention Transformer and gated recurrent unit (GRU) architectures to improve the accuracy of cryptocurrency price predictions. By combining the Transformer’s strength in capturing long-range patterns with GRU’s ability to model short-term and sequential trends, the hybrid model provides a well-rounded approach to time series forecasting. We apply the model to predict the daily closing prices of Bitcoin and Ethereum based on historical data that include past prices, trading volumes, and the Fear and Greed Index. We evaluate the performance of our proposed model by comparing it with four other machine learning models, two are non-sequential feedforward models: radial basis function network (RBFN) and general regression neural network (GRNN), and two are bidirectional sequential memory-based models: bidirectional long short-term memory (BiLSTM) and bidirectional gated recurrent unit (BiGRU). The model’s performance is assessed using several metrics, including mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE), along with statistical validation through the non-parametric Friedman test followed by a post hoc Wilcoxon signed-rank test. Results demonstrate that our hybrid model consistently achieves superior accuracy, highlighting its effectiveness for financial prediction tasks. These findings provide valuable insights for enhancing real-time decision making in cryptocurrency markets and support the growing use of hybrid deep learning models in financial analytics.

Suggested Citation

  • Esam Mahdi & Carlos Martin-Barreiro & Xavier Cabezas, 2025. "A Novel Hybrid Approach Using an Attention-Based Transformer + GRU Model for Predicting Cryptocurrency Prices," Mathematics, MDPI, vol. 13(9), pages 1-19, April.
  • Handle: RePEc:gam:jmathe:v:13:y:2025:i:9:p:1484-:d:1646790
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2227-7390/13/9/1484/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2227-7390/13/9/1484/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Aniruddha Dutta & Saket Kumar & Meheli Basu, 2020. "A Gated Recurrent Unit Approach to Bitcoin Price Prediction," JRFM, MDPI, vol. 13(2), pages 1-16, February.
    2. Moiz Qureshi & Hasnain Iftikhar & Paulo Canas Rodrigues & Mohd Ziaur Rehman & S. A. Atif Salar, 2024. "Statistical Modeling to Improve Time Series Forecasting Using Machine Learning, Time Series, and Hybrid Models: A Case Study of Bitcoin Price Forecasting," Mathematics, MDPI, vol. 12(23), pages 1-15, November.
    3. Erdinc Akyildirim & Ahmet Goncu & Ahmet Sensoy, 2021. "Prediction of cryptocurrency returns using machine learning," Annals of Operations Research, Springer, vol. 297(1), pages 3-36, February.
    4. Zi Ye & Yinxu Wu & Hui Chen & Yi Pan & Qingshan Jiang, 2022. "A Stacking Ensemble Deep Learning Model for Bitcoin Price Prediction Using Twitter Comments on Bitcoin," Mathematics, MDPI, vol. 10(8), pages 1-21, April.
    5. E, Jianwei & Ye, Jimin & Jin, Haihong, 2019. "A novel hybrid model on the prediction of time series and its application for the gold price analysis and forecasting," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 527(C).
    6. Suhwan Ji & Jongmin Kim & Hyeonseung Im, 2019. "A Comparative Study of Bitcoin Price Prediction Using Deep Learning," Mathematics, MDPI, vol. 7(10), pages 1-20, September.
    7. Lahmiri, Salim & Bekiros, Stelios, 2019. "Cryptocurrency forecasting with deep learning chaotic neural networks," Chaos, Solitons & Fractals, Elsevier, vol. 118(C), pages 35-40.
    8. Gyana Ranjan Patra & Mihir Narayan Mohanty, 2023. "Price Prediction of Cryptocurrency Using a Multi-Layer Gated Recurrent Unit Network with Multi Features," Computational Economics, Springer;Society for Computational Economics, vol. 62(4), pages 1525-1544, December.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Nagula, Pavan Kumar & Alexakis, Christos, 2022. "A new hybrid machine learning model for predicting the bitcoin (BTC-USD) price," Journal of Behavioral and Experimental Finance, Elsevier, vol. 36(C).
    2. Ren, Yi-Shuai & Ma, Chao-Qun & Kong, Xiao-Lin & Baltas, Konstantinos & Zureigat, Qasim, 2022. "Past, present, and future of the application of machine learning in cryptocurrency research," Research in International Business and Finance, Elsevier, vol. 63(C).
    3. Rico-Peña, Juan Jesús & Arguedas-Sanz, Raquel & López-Martin, Carmen, 2023. "Models used to characterise blockchain features. A systematic literature review and bibliometric analysis," Technovation, Elsevier, vol. 123(C).
    4. Laszlo Vancsura & Tibor Tatay & Tibor Bareith, 2024. "Investigating the Role of Activation Functions in Predicting the Price of Cryptocurrencies during Critical Economic Periods," Virtual Economics, The London Academy of Science and Business, vol. 7(4), pages 64-91, December.
    5. Gyana Ranjan Patra & Mihir Narayan Mohanty, 2023. "Price Prediction of Cryptocurrency Using a Multi-Layer Gated Recurrent Unit Network with Multi Features," Computational Economics, Springer;Society for Computational Economics, vol. 62(4), pages 1525-1544, December.
    6. Isabela Ruiz Roque da Silva & Eli Hadad Junior & Pedro Paulo Balbi, 2022. "Cryptocurrencies trading algorithms: A review," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 41(8), pages 1661-1668, December.
    7. Sudersan Behera & Sarat Chandra Nayak & A. V. S. Pavan Kumar, 2024. "Evaluating the Performance of Metaheuristic Based Artificial Neural Networks for Cryptocurrency Forecasting," Computational Economics, Springer;Society for Computational Economics, vol. 64(2), pages 1219-1258, August.
    8. Rasoul Amirzadeh & Dhananjay Thiruvady & Asef Nazari & Mong Shan Ee, 2023. "Dynamic Bayesian Networks for Predicting Cryptocurrency Price Directions: Uncovering Causal Relationships," Papers 2306.08157, arXiv.org, revised Oct 2024.
    9. Hakan Pabuccu & Adrian Barbu, 2023. "Feature Selection with Annealing for Forecasting Financial Time Series," Papers 2303.02223, arXiv.org, revised Feb 2024.
    10. Mingzhe Wei & Georgios Sermpinis & Charalampos Stasinakis, 2023. "Forecasting and trading Bitcoin with machine learning techniques and a hybrid volatility/sentiment leverage," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 42(4), pages 852-871, July.
    11. Zied Ftiti & Wael Louhichi & Hachmi Ben Ameur, 2023. "Cryptocurrency volatility forecasting: What can we learn from the first wave of the COVID-19 outbreak?," Annals of Operations Research, Springer, vol. 330(1), pages 665-690, November.
    12. Hanyao Gao & Gang Kou & Haiming Liang & Hengjie Zhang & Xiangrui Chao & Cong-Cong Li & Yucheng Dong, 2024. "Machine learning in business and finance: a literature review and research opportunities," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 10(1), pages 1-35, December.
    13. Aidin Zehtab-Salmasi & Ali-Reza Feizi-Derakhshi & Narjes Nikzad-Khasmakhi & Meysam Asgari-Chenaghlu & Saeideh Nabipour, 2023. "Multimodal Price Prediction," Annals of Data Science, Springer, vol. 10(3), pages 619-635, June.
    14. Hakan Pabuccu & Adrian Barbu, 2024. "Feature selection with annealing for forecasting financial time series," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 10(1), pages 1-26, December.
    15. Yue, Yao & Li, Xuerong & Zhang, Dingxuan & Wang, Shouyang, 2021. "How cryptocurrency affects economy? A network analysis using bibliometric methods," International Review of Financial Analysis, Elsevier, vol. 77(C).
    16. Francesco Puoti & Fabrizio Pittorino & Manuel Roveri, 2025. "Quantifying Cryptocurrency Unpredictability: A Comprehensive Study of Complexity and Forecasting," Papers 2502.09079, arXiv.org.
    17. Cohen, Gil & Aiche, Avishay, 2023. "Forecasting gold price using machine learning methodologies," Chaos, Solitons & Fractals, Elsevier, vol. 175(P2).
    18. Oluwadamilare Omole & David Enke, 2024. "Deep learning for Bitcoin price direction prediction: models and trading strategies empirically compared," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 10(1), pages 1-26, December.
    19. Liu, Yujun & Li, Zhongfei & Nekhili, Ramzi & Sultan, Jahangir, 2023. "Forecasting cryptocurrency returns with machine learning," Research in International Business and Finance, Elsevier, vol. 64(C).
    20. Bouteska, Ahmed & Abedin, Mohammad Zoynul & Hajek, Petr & Yuan, Kunpeng, 2024. "Cryptocurrency price forecasting – A comparative analysis of ensemble learning and deep learning methods," International Review of Financial Analysis, Elsevier, vol. 92(C).

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jmathe:v:13:y:2025:i:9:p:1484-:d:1646790. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.