Paper: arXiv 2510.14156
Authors: Jan Kwiatkowski, Jarosł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.
Complexity vs Empirical Score
- Math Complexity: 6.0/10
- Empirical Rigor: 6.0/10 (capped from 7.5: transaction costs not modelled; see penalty flags)
- Quadrant: Holy Grail — high math complexity, high empirical rigor
Why this score: The paper employs advanced deep learning (Transformers) and systematically evaluates multiple complex ranking loss functions, requiring significant mathematical formulation, yet it is grounded in a concrete empirical benchmark using S&P 500 data with a clear backtesting protocol for portfolio selection.
Research Flowchart
flowchart TD
A["Research Goal<br>How do ranking loss functions impact<br>Transformer model performance for<br>stock return forecasting & portfolio selection?"] --> B["Dataset & Inputs"]
B --> C["Model Architecture & Methodology"]
C --> D["Training & Evaluation"]
D --> E["Key Findings & Outcomes"]
subgraph B ["Data"]
B1["S&P 500 Historical Data<br>Price, Volume, Indicators"]
B2["Target Variable<br>Future Stock Returns"]
end
subgraph C ["Methodology"]
C1["Transformer Model<br>Time-series encoder"]
C2["Loss Functions Tested"]
C3["Pointwise: MSE/MAE"]
C4["Pairwise: RankNet"]
C5["Listwise: ListMLE/SoftRank"]
end
subgraph D ["Process"]
D1["Cross-Sectional Training<br>Learn patterns across assets"]
D2["Temporal Validation<br>Out-of-sample testing"]
D3["Portfolio Construction<br>Rank-based top-K selection"]
D4["Performance Metrics<br>Sharpe Ratio, NDCG, Accuracy"]
end
subgraph E ["Outcomes"]
E1["Listwise losses outperform<br>others for ranking tasks"]
E2["ListMLE yields highest<br>portfolio Sharpe ratio"]
E3["Listwise captures cross-sectional<br>patterns better than pointwise"]
E4["Practical guidance for<br>loss function selection in finance"]
end
B1 --> C1
B2 --> C3
B2 --> C4
B2 --> C5
C1 --> C2
C2 --> C3 & C4 & C5
C3 & C4 & C5 --> D1
D1 --> D2
D2 --> D3
D3 --> D4
D4 --> E1
D4 --> E2
D4 --> E3
D4 --> E4
Cited References (68)
- Evaluating Ranking Loss Functions in Performance Predictor for NAS (2024) — link
- Forecasting Economics and Financial Time Series: ARIMA vs. LSTM (2018) — link
- Ranking Measures and Loss Functions in Learning to Rank (2009) — link
- Analysis of financial time series (2005) — link
- Advances in Financial Machine Learning (2018)
- Learning to Rank for Information Retrieval (2009) — link
- A Short Introduction to Learning to Rank (2011) — link
- Subset ranking using regression (2006) — link
and 60 more
- Learning to rank using gradient descent (2005) — link
- Large margin rank boundaries for ordinal regression (2000)
- BPR: Bayesian Personalized Ranking from Implicit Feedback (2012) — link
- Learning to rank: from pairwise approach to listwise approach (2007) — link
- Listwise approach to learning to rank - Theory and algorithm (2008) — link
- WSABIE: scaling up to large vocabulary image annotation (2011)
- The LambdaLoss Framework for Ranking Metric Optimization (2018) — link
- Deep learning for event-driven stock prediction (2015)
- Relation-aware transformer for portfolio policy learning (2021)
- Adaptive Long-Short Pattern Transformer for Stock Investment Selection (2022) — link
- CI-STHPAN: Pre-trained Attention Network for Stock Selection with Channel-Independent Spatio-Temporal Hypergraph (2024) — link
- Quantformer: from attention to profit with a quantitative transformer trading strategy (2024) — link
- Transformers and attention-based networks in quantitative trading: a comprehensive survey ({2024})
- Stock Market Prediction via Deep Learning Techniques: A Survey (2023) — link
- Deep Time Series Forecasting Models: A Comprehensive Survey (2024) — link
- Are Transformers Effective for Time Series Forecasting? (2022) — link
- Attention Is All You Need (2023) — link
- Crossformer: Transformer Utilizing Cross-Dimension Dependency for Multivariate Time Series Forecasting (2023) — link
- MASTER: Market-Guided Stock Transformer for Stock Price Forecasting (2023) — link
- iTransformer: Inverted Transformers Are Effective for Time Series Forecasting (2024) — link
- Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting (2021) — link
- StockMixer: a simple yet strong MLP-based architecture for stock price forecasting (2024) — link
- Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting (2020) — link
- Multi-Modal Temporal Dynamic Graph Construction for Stock Rank Prediction (2025) — link
- Enhancing Multi-Output Time Series Forecasting with Encoder-Decoder Networks (2023) — link
- Portfolio Transformer for Attention-Based Asset Allocation (2022) — link
- Hedge Fund Portfolio Construction Using PolyModel Theory and iTransformer (2025) — link
- Transformer Multivariate Forecasting: Less is More? (2024) — link
- Applying Informer for Option Pricing: A Transformer-Based Approach (2025) — link
- Integrating Traditional Technical Analysis with AI: A Multi-Agent LLM-Based Approach to Stock Market Forecasting (2025) — link
- Toward Predictive Stock Trading with Hidformer Integrated into Reinforcement Learning Strategy (2024) — link
- Hidformer: Transformer-Style Neural Network in Stock Price Forecasting (2024) — link
- TEAFormers: TEnsor-Augmented Transformers for Multi-Dimensional Time Series Forecasting (2024) — link
- Enhancing Stock Movement Prediction with Adversarial Training (2019) — link
- Accurate Multivariate Stock Movement Prediction via Data-Axis Transformer with Multi-Level Contexts (2021) — link
- Transformer-based attention network for stock movement prediction (2022) — link
- Modal decomposition-based hybrid model for stock index prediction (2022) — link
- Hierarchical multi-scale Gaussian transformer for stock movement prediction (2021)
- Classification of intraday S&P500 returns with a Random Forest (2019) — link
- Investigation of market efficiency and Financial Stability between S&P 500 and London Stock Exchange: Monthly and yearly Forecasting of Time Series Stock Returns using ARMA model (2016) — link
- MiniBert24: A Lightweight Transformer-Based Model for Stock Market Movement Prediction (2024) — link
- Temporal Relational Ranking for Stock Prediction (2019) — link
- Quantitative Day Trading from Natural Language using Reinforcement Learning (2021) — link
- A hybrid deep learning model for cryptocurrency returns forecasting: Comparison of the performance of financial markets and impact of external variables (2025) — link
- Deep learning with long short-term memory networks for financial market predictions (2018) — link
- Robust Bayesian portfolio optimization (2025) — link
- Optimization-based spectral end-to-end deep reinforcement learning for equity portfolio management (2025) — link
- Time Series Forecasting with Transformer Models and Application to Asset Management (2023) — link
- A Comparative Analysis of Forecasting Financial Time Series Using ARIMA, LSTM, and BiLSTM (2019) — link
- DeltaHedge: A Multi-Agent Framework for Portfolio Options Optimization (2025) — link
- ElliottAgents: A Natural Language-Driven Multi-Agent System for Stock Market Analysis and Prediction (2025) — link
- Lamformer: LSTM-enhanced agent attention and mixture-of-experts transformer for efficient stock price prediction (2025) — link
- Galformer: a transformer with generative decoding and a hybrid loss function for multi-step stock market index prediction (2024) — link
- Machine Learning Approaches in Stock Price Prediction: A Systematic Review (2022) — link
- A CNN-BiLSTM-AM method for stock price prediction (2021) — link
- Diffusion model based on stochastic differential equation with transformer for stock price prediction (2025) — link
- Stock Ranking Prediction Using List-Wise Approach and Node Embedding Technique (2021) — link
- Stock Ranking with Multi-Task Learning (2022) — link
- A Comprehensive Survey of Loss Functions in Machine Learning (2022) — link
- Machine Learning Optimization Algorithms and Portfolio Allocation (2019) — link
0 of 68 cited works are in the corpus; resolved via arXiv source bundles, Semantic Scholar and OpenAlex. Corpus-wide: 2518 linked papers.