IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2510.14156.html
   My bibliography  Save this paper

On Evaluating Loss Functions for Stock Ranking: An Empirical Analysis With Transformer Model

Author

Listed:
  • Jan Kwiatkowski
  • Jaros{l}aw A. Chudziak

Abstract

Quantitative trading strategies rely on accurately ranking stocks to identify profitable investments. Effective portfolio management requires models that can reliably order future stock returns. Transformer models are promising for understanding financial time series, but how different training loss functions affect their ability to rank stocks well is not yet fully understood. Financial markets are challenging due to their changing nature and complex relationships between stocks. Standard loss functions, which aim for simple prediction accuracy, often aren't enough. They don't directly teach models to learn the correct order of stock returns. While many advanced ranking losses exist from fields such as information retrieval, there hasn't been a thorough comparison to see how well they work for ranking financial returns, especially when used with modern Transformer models for stock selection. This paper addresses this gap by systematically evaluating a diverse set of advanced loss functions including pointwise, pairwise, listwise for daily stock return forecasting to facilitate rank-based portfolio selection on S&P 500 data. We focus on assessing how each loss function influences the model's ability to discern profitable relative orderings among assets. Our research contributes a comprehensive benchmark revealing how different loss functions impact a model's ability to learn cross-sectional and temporal patterns crucial for portfolio selection, thereby offering practical guidance for optimizing ranking-based trading strategies.

Suggested Citation

  • Jan Kwiatkowski & Jaros{l}aw A. Chudziak, 2025. "On Evaluating Loss Functions for Stock Ranking: An Empirical Analysis With Transformer Model," Papers 2510.14156, arXiv.org.
  • Handle: RePEc:arx:papers:2510.14156
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2510.14156
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Siqiao Zhao & Zhikang Dong & Zeyu Cao & Raphael Douady, 2024. "Hedge Fund Portfolio Construction Using PolyModel Theory and iTransformer," Papers 2408.03320, arXiv.org, revised Feb 2025.
    2. Sarah Perrin & Thierry Roncalli, 2019. "Machine Learning Optimization Algorithms & Portfolio Allocation," Papers 1909.10233, arXiv.org.
    3. Sima Siami-Namini & Akbar Siami Namin, 2018. "Forecasting Economics and Financial Time Series: ARIMA vs. LSTM," Papers 1803.06386, arXiv.org.
    4. Xinhe Liu & Wenmin Wang, 2024. "Deep Time Series Forecasting Models: A Comprehensive Survey," Mathematics, MDPI, vol. 12(10), pages 1-33, May.
    5. Fischer, Thomas & Krauss, Christopher, 2018. "Deep learning with long short-term memory networks for financial market predictions," European Journal of Operational Research, Elsevier, vol. 270(2), pages 654-669.
    6. Kamil {L}. Szyd{l}owski & Jaros{l}aw A. Chudziak, 2024. "Hidformer: Transformer-Style Neural Network in Stock Price Forecasting," Papers 2412.19932, arXiv.org.
    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. Wang, Yijun & Andreeva, Galina & Martin-Barragan, Belen, 2023. "Machine learning approaches to forecasting cryptocurrency volatility: Considering internal and external determinants," International Review of Financial Analysis, Elsevier, vol. 90(C).
    2. Pushpendu Ghosh & Ariel Neufeld & Jajati Keshari Sahoo, 2020. "Forecasting directional movements of stock prices for intraday trading using LSTM and random forests," Papers 2004.10178, arXiv.org, revised Jun 2021.
    3. Mourad Mroua & Ahlem Lamine, 2023. "Financial time series prediction under Covid-19 pandemic crisis with Long Short-Term Memory (LSTM) network," Humanities and Social Sciences Communications, Palgrave Macmillan, vol. 10(1), pages 1-15, December.
    4. Won Joong Kim & Gunho Jung & Sun-Yong Choi, 2020. "Forecasting CDS Term Structure Based on Nelson–Siegel Model and Machine Learning," Complexity, Hindawi, vol. 2020, pages 1-23, July.
    5. Omer Berat Sezer & Mehmet Ugur Gudelek & Ahmet Murat Ozbayoglu, 2019. "Financial Time Series Forecasting with Deep Learning : A Systematic Literature Review: 2005-2019," Papers 1911.13288, arXiv.org.
    6. Montserrat Reyna Miranda & Ricardo Massa Roldán & Vicente Gómez Salcido, 2022. "Neuro-wavelet Model for price prediction in high-frequency data in the Mexican Stock market," Remef - Revista Mexicana de Economía y Finanzas Nueva Época REMEF (The Mexican Journal of Economics and Finance), Instituto Mexicano de Ejecutivos de Finanzas, IMEF, vol. 17(1), pages 1-23, Enero - M.
    7. Ghosh, Pushpendu & Neufeld, Ariel & Sahoo, Jajati Keshari, 2022. "Forecasting directional movements of stock prices for intraday trading using LSTM and random forests," Finance Research Letters, Elsevier, vol. 46(PA).
    8. Wei Dai & Yuan An & Wen Long, 2021. "Price change prediction of ultra high frequency financial data based on temporal convolutional network," Papers 2107.00261, arXiv.org.
    9. Shao, Zhen & Zheng, Qingru & Yang, Shanlin & Gao, Fei & Cheng, Manli & Zhang, Qiang & Liu, Chen, 2020. "Modeling and forecasting the electricity clearing price: A novel BELM based pattern classification framework and a comparative analytic study on multi-layer BELM and LSTM," Energy Economics, Elsevier, vol. 86(C).
    10. Kamaladdin Fataliyev & Aneesh Chivukula & Mukesh Prasad & Wei Liu, 2021. "Stock Market Analysis with Text Data: A Review," Papers 2106.12985, arXiv.org, revised Jul 2021.
    11. Giacomo di Tollo & Joseph Andria & Gianni Filograsso, 2023. "The Predictive Power of Social Media Sentiment: Evidence from Cryptocurrencies and Stock Markets Using NLP and Stochastic ANNs," Mathematics, MDPI, vol. 11(16), pages 1-18, August.
    12. Hu, Xiao & Kang, Siqin & Ren, Long & Zhu, Shaokeng, 2024. "Interactive preference analysis: A reinforcement learning framework," European Journal of Operational Research, Elsevier, vol. 319(3), pages 983-998.
    13. Wang, Jianzhou & Lv, Mengzheng & Wang, Shuai & Gao, Jialu & Zhao, Yang & Wang, Qiangqiang, 2024. "Can multi-period auto-portfolio systems improve returns? Evidence from Chinese and U.S. stock markets," International Review of Financial Analysis, Elsevier, vol. 95(PB).
    14. Ghosh, Indranil & Chaudhuri, Tamal Datta & Alfaro-Cortés, Esteban & Gámez, Matías & García, Noelia, 2022. "A hybrid approach to forecasting futures prices with simultaneous consideration of optimality in ensemble feature selection and advanced artificial intelligence," Technological Forecasting and Social Change, Elsevier, vol. 181(C).
    15. Gergana Taneva-Angelova & Stefan Raychev & Galina Ilieva, 2025. "A Framework for Gold Price Prediction Combining Classical and Intelligent Methods with Financial, Economic, and Sentiment Data Fusion," IJFS, MDPI, vol. 13(2), pages 1-25, June.
    16. Pedro Reis & Ana Paula Serra & Jo~ao Gama, 2025. "The Role of Deep Learning in Financial Asset Management: A Systematic Review," Papers 2503.01591, arXiv.org.
    17. Masum, Mohammad & Masud, M.A. & Adnan, Muhaiminul Islam & Shahriar, Hossain & Kim, Sangil, 2022. "Comparative study of a mathematical epidemic model, statistical modeling, and deep learning for COVID-19 forecasting and management," Socio-Economic Planning Sciences, Elsevier, vol. 80(C).
    18. Sina Montazeri & Akram Mirzaeinia & Haseebullah Jumakhan & Amir Mirzaeinia, 2024. "CNN-DRL for Scalable Actions in Finance," Papers 2401.06179, arXiv.org.
    19. Nosratabadi, Saeed & Mosavi, Amir & Duan, Puhong & Ghamisi, Pedram & Filip, Ferdinand & Band, Shahab S. & Reuter, Uwe & Gama, Joao & Gandomi, Amir H., 2020. "Data science in economics: comprehensive review of advanced machine learning and deep learning methods," FrenXiv e75gc_v1, Center for Open Science.
    20. Alameer, Zakaria & Elaziz, Mohamed Abd & Ewees, Ahmed A. & Ye, Haiwang & Jianhua, Zhang, 2019. "Forecasting gold price fluctuations using improved multilayer perceptron neural network and whale optimization algorithm," Resources Policy, Elsevier, vol. 61(C), pages 250-260.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    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:arx:papers:2510.14156. 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: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    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.