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

Jan Kwiatkowski, Jarosław A. Chudziak
10/15/2025
cs.LGq-fin.PM

No confident code implementation found for this paper.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kwiatkowski2025evaluating,
  title  = {On Evaluating Loss Functions for Stock Ranking: An Empirical Analysis With Transformer Model},
  author = {Jan Kwiatkowski and Jarosław A. Chudziak},
  year   = {2025},
  eprint = {2510.14156},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.14156v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.14156.svg)](https://codeofpaper.com/paper/2510.14156)

Discussion