IDEAS home Printed from https://ideas.repec.org/a/eee/finlet/v86y2025ipfs1544612325020379.html

Machine learning for stock return prediction: Transformers or simple neural networks

Author

Listed:
  • Wang, Zhiguang

Abstract

We study whether a transformer improves stock return forecasts over simple neural networks. Using all U.S. stocks from 1957 to 2021, we train an Autoformer with 920 features that cover firm characteristics, industry dummies, and macro variables. We compare it with DLinear and simple neural networks. We predict excess returns at 1-, 3-, and 12-month horizons. We evaluate probabilistic forecasts using mean squared error (MSE). Autoformer consistently outperforms the simple neural networks advocated by Gu et al. (2020), markedly at longer horizons. Feature-importance tests repeatedly highlight net equity expansion and a technology-industry dummy. These tests also emphasize fundamentals such as return on assets, sales-to-price, earnings volatility, and sales-to-receivables. Overall, transformer architectures appear better at encoding fundamental information than shallow networks.

Suggested Citation

  • Wang, Zhiguang, 2025. "Machine learning for stock return prediction: Transformers or simple neural networks," Finance Research Letters, Elsevier, vol. 86(PF).
  • Handle: RePEc:eee:finlet:v:86:y:2025:i:pf:s1544612325020379
    DOI: 10.1016/j.frl.2025.108783
    as

    Download full text from publisher

    File URL: http://www.sciencedirect.com/science/article/pii/S1544612325020379
    Download Restriction: Full text for ScienceDirect subscribers only

    File URL: https://libkey.io/10.1016/j.frl.2025.108783?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to

    for a different version of it.

    References listed on IDEAS

    as
    1. Lubo? P?tor & Pietro Veronesi, 2009. "Technological Revolutions and Stock Prices," American Economic Review, American Economic Association, vol. 99(4), pages 1451-1483, September.
    2. John Y. Campbell & Martin Lettau & Burton G. Malkiel & Yexiao Xu, 2001. "Have Individual Stocks Become More Volatile? An Empirical Exploration of Idiosyncratic Risk," Journal of Finance, American Finance Association, vol. 56(1), pages 1-43, February.
    3. Shihao Gu & Bryan Kelly & Dacheng Xiu, 2020. "Empirical Asset Pricing via Machine Learning," Review of Finance, European Finance Association, vol. 33(5), pages 2223-2273.
    4. Ivo Welch & Amit Goyal, 2008. "A Comprehensive Look at The Empirical Performance of Equity Premium Prediction," The Review of Financial Studies, Society for Financial Studies, vol. 21(4), pages 1455-1508, July.
    5. Andrew Ang & Robert J. Hodrick & Yuhang Xing & Xiaoyan Zhang, 2006. "The Cross‐Section of Volatility and Expected Returns," Journal of Finance, American Finance Association, vol. 61(1), pages 259-299, February.
    6. Jacob Boudoukh & Roni Michaely & Matthew Richardson & Michael R. Roberts, 2007. "On the Importance of Measuring Payout Yield: Implications for Empirical Asset Pricing," Journal of Finance, American Finance Association, vol. 62(2), pages 877-915, April.
    7. Heston, Steven L. & Sadka, Ronnie, 2008. "Seasonality in the cross-section of stock returns," Journal of Financial Economics, Elsevier, vol. 87(2), pages 418-445, February.
    8. Hirshleifer, David & Hsu, Po-Hsuan & Li, Dongmei, 2013. "Innovative efficiency and stock returns," Journal of Financial Economics, Elsevier, vol. 107(3), pages 632-654.
    9. Malcolm Baker & Jeffrey Wurgler, 2000. "The Equity Share in New Issues and Aggregate Stock Returns," Journal of Finance, American Finance Association, vol. 55(5), pages 2219-2257, October.
    10. Bali, Turan G. & Cakici, Nusret, 2008. "Idiosyncratic Volatility and the Cross Section of Expected Returns," Journal of Financial and Quantitative Analysis, Cambridge University Press, vol. 43(1), pages 29-58, March.
    11. Jonathan Lewellen, 2002. "Momentum and Autocorrelation in Stock Returns," The Review of Financial Studies, Society for Financial Studies, vol. 15(2), pages 533-564, March.
    12. Gu, Shihao & Kelly, Bryan & Xiu, Dacheng, 2021. "Autoencoder asset pricing models," Journal of Econometrics, Elsevier, vol. 222(1), pages 429-450.
    13. Jeremiah Green & John R. M. Hand & X. Frank Zhang, 2017. "The Characteristics that Provide Independent Information about Average U.S. Monthly Stock Returns," The Review of Financial Studies, Society for Financial Studies, vol. 30(12), pages 4389-4436.
    14. Ian Martin, 2021. "On the Autocorrelation of the Stock Market [X-CAPM: An Extrapolative Capital Asset Pricing Model]," Journal of Financial Econometrics, Oxford University Press, vol. 19(1), pages 39-52.
    15. Shihao Gu & Bryan Kelly & Dacheng Xiu, 2020. "Empirical Asset Pricing via Machine Learning," The Review of Financial Studies, Society for Financial Studies, vol. 33(5), pages 2223-2273.
    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. Tobek, Ondrej & Hronec, Martin, 2021. "Does it pay to follow anomalies research? Machine learning approach with international evidence," Journal of Financial Markets, Elsevier, vol. 56(C).
    2. Xi Dong & Yan Li & David E. Rapach & Guofu Zhou, 2022. "Anomalies and the Expected Market Return," Journal of Finance, American Finance Association, vol. 77(1), pages 639-681, February.
    3. Adam Zaremba & Jacob Koby Shemer, 2018. "Price-Based Investment Strategies," Springer Books, Springer, number 978-3-319-91530-2, January.
    4. Smith, Simon C., 2021. "International stock return predictability," International Review of Financial Analysis, Elsevier, vol. 78(C).
    5. Doron Avramov & Si Cheng & Lior Metzker, 2023. "Machine Learning vs. Economic Restrictions: Evidence from Stock Return Predictability," Management Science, INFORMS, vol. 69(5), pages 2587-2619, May.
    6. Li, Xiao-Xin & Xie, Chi & Wang, Gang-Jin & Zhu, You & Li, Zhao-Chen & Zhang, Zhi-Yu, 2025. "Enhancing stock market return predictability by using a novel autoencoder-based aggregate EPU index," Pacific-Basin Finance Journal, Elsevier, vol. 93(C).
    7. Bui, Dien Giau & Kong, De-Rong & Lin, Chih-Yung & Lin, Tse-Chun, 2023. "Momentum in machine learning: Evidence from the Taiwan stock market," Pacific-Basin Finance Journal, Elsevier, vol. 82(C).
    8. Cakici, Nusret & Zaremba, Adam & Bianchi, Robert J. & Pham, Nga, 2021. "False discoveries in the anomaly research: New insights from the Stock Exchange of Melbourne (1927–1987)," Pacific-Basin Finance Journal, Elsevier, vol. 70(C).
    9. Hou, Kewei & Xue, Chen & Zhang, Lu, 2017. "Replicating Anomalies," Working Paper Series 2017-10, Ohio State University, Charles A. Dice Center for Research in Financial Economics.
    10. Huei-Wen Teng & Yu-Hsien Li, 2023. "Can deep neural networks outperform Fama-MacBeth regression and other supervised learning approaches in stock returns prediction with asset-pricing factors?," Digital Finance, Springer, vol. 5(1), pages 149-182, March.
    11. Wang, Jianqiu & Wang, Zhuo & Wu, Ke, 2025. "Forecasting stock market return with anomalies: Evidence from China," International Journal of Forecasting, Elsevier, vol. 41(3), pages 1278-1295.
    12. Changeun Kim & Younwoo Jeong & Bong-Gyu Jang, 2025. "Interpretable Deep Learning for Stock Returns: A Consensus-Bottleneck Asset Pricing Model," Papers 2512.16251, arXiv.org, revised Apr 2026.
    13. Jozef Barunik & Martin Hronec & Ondrej Tobek, 2024. "Forecasting stock return distributions around the globe with quantile neural networks," Papers 2408.07497, arXiv.org, revised Aug 2025.
    14. Nektarios Aslanidis & Charlotte Christiansen & Neophytos Lambertides & Christos S. Savva, 2019. "Idiosyncratic volatility puzzle: influence of macro-finance factors," Review of Quantitative Finance and Accounting, Springer, vol. 52(2), pages 381-401, February.
    15. Zhu, Haibin & Bai, Lu & He, Lidan & Liu, Zhi, 2023. "Forecasting realized volatility with machine learning: Panel data perspective," Journal of Empirical Finance, Elsevier, vol. 73(C), pages 251-271.
    16. Cederburg, Scott & O’Doherty, Michael S. & Wang, Feifei & Yan, Xuemin (Sterling), 2020. "On the performance of volatility-managed portfolios," Journal of Financial Economics, Elsevier, vol. 138(1), pages 95-117.
    17. Christian Fieberg & Daniel Metko & Thorsten Poddig & Thomas Loy, 2023. "Machine learning techniques for cross-sectional equity returns’ prediction," OR Spectrum: Quantitative Approaches in Management, Springer;Gesellschaft für Operations Research e.V., vol. 45(1), pages 289-323, March.
    18. Wu, Hongxu & Wang, Qiao & Li, Jianping & Deng, Zhibin, 2025. "Enhancing stock return prediction in the Chinese market: A GAN-based approach," Research in International Business and Finance, Elsevier, vol. 75(C).
    19. Zhao, Albert Bo & Cheng, Tingting, 2022. "Stock return prediction: Stacking a variety of models," Journal of Empirical Finance, Elsevier, vol. 67(C), pages 288-317.
    20. Chulwoo Han, 2022. "Bimodal Characteristic Returns and Predictability Enhancement via Machine Learning," Management Science, INFORMS, vol. 68(10), pages 7701-7741, October.

    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:eee:finlet:v:86:y:2025:i:pf:s1544612325020379. 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: Catherine Liu (email available below). General contact details of provider: http://www.elsevier.com/locate/frl .

    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.