From Index to Equity: Pre-Training Transformers for Stock Return Prediction

Marie Soehl Coolsaet, Roberto Gallardo, Zhen Gao
5/12/2026
q-fin.STcs.LG
transformer-attention

No confident code implementation found for this paper.

Abstract

This research aims to leverage machine learning to improve stock price prediction and support informed investment decisions related to buying, selling, and holding assets. Specifically, this work investigates transformer-based models for stock prediction and examines the impact of pre-training strategies on forecasting performance.

Show full abstract

A transformer model was first pre-trained on the Toronto Stock Exchange Index (TSX) to predict intra-day return direction and subsequently fine-tuned on individual TSX stocks. The model was further adapted for return-value regression tasks. Performance was benchmarked against Long Short-Term Memory (LSTM) and XGBoost models. Pre-training on the market index improved the binary cross-entropy loss for individual stock prediction from 0.69 to 0.64. The fine-tuned transformer regression model achieved lower mean squared error than the benchmark models, although the ensemble and XGBoost models achieved higher average daily returns. In addition, a practical application was developed to deliver real-time stock predictions for trading support. Future work will focus on increasing transformer model capacity, incorporating broader global technical indicators, and filtering out stocks with low predictability.

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{coolsaet2026from,
  title  = {From Index to Equity: Pre-Training Transformers for Stock Return Prediction},
  author = {Marie Soehl Coolsaet and Roberto Gallardo and Zhen Gao},
  year   = {2026},
  eprint = {2605.23962},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.23962v1}
}

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/2605.23962.svg)](https://codeofpaper.com/paper/2605.23962)

Discussion