Pre-training Time Series Models with Stock Data Customization

Mengyu Wang, Tiejun Ma, Shay B. Cohen

Introduction

In deep learning, pre-training is a cornerstone for success in domains like Natural Language Processing (NLP) and Computer Vision (CV). However, applying generic pre-training techniques—such as Masked Value Prediction—to financial time series often leads to overfitting due to the non-stationary and volatile nature of stock data. Traditional methods frequently treat price series as anonymous numerical sequences, ignoring the inherent "context" of the underlying assets.

The SSPT Framework

To address these challenges, researchers from the University of Edinburgh introduced the Stock Specialized Pre-trained Transformer (SSPT). This framework shifts the focus from generic reconstruction tasks to domain-specific objectives that capture the unique behavioral signatures of stocks.

The SSPT framework architecture, illustrating the transition from data preparation to specialized pre-training and final stock selection fine-tuning.

The SSPT architecture utilizes a two-layer transformer and introduces three customized pre-training tasks:

  1. Stock Code Classification (SCC): The model identifies the specific stock from a price slice, forcing it to learn company-specific "fingerprints."
  2. Stock Sector Classification (SSC): The model identifies the industry sector, capturing broader market correlations.
  3. Moving Average Prediction (MAP): By predicting the average price over a period rather than a single point, the model filters out short-term noise and focuses on underlying trends.

Experimental Setup and Key Insights

The model was evaluated across five diverse datasets, including NASDAQ, NYSE, and TOPIX-100, spanning periods of both stability and high volatility (e.g., the COVID-19 pandemic).

A critical insight from the study is the "Fingerprint Hypothesis": training a model to recognize a stock's identity significantly enhances its predictive power for future returns. Furthermore, the MAP task demonstrates that denoising via moving averages is more effective for financial forecasting than raw price prediction.

Comparison of Cumulative IRR across different pre-training tasks (SCC, SSC, MAP) and parameter freezing strategies during fine-tuning.

As shown in the ablation studies, the choice of pre-training task and the fine-tuning strategy (e.g., freezing vs. unfreezing parameters) significantly impact the final Investment Return Ratio (IRR). Generally, unfreezing more parameters during fine-tuning allows the model to better adapt its learned representations to the target task of stock selection.

Performance Results

SSPT consistently outperformed market benchmarks and state-of-the-art (SOTA) models. On the NASDAQ dataset, SSPT achieved a Sharpe Ratio of 2.25, surpassing the market baseline (1.53) and the previous SOTA, CI-STHPAN (2.01). The combined model (SSPT-comb) reached an IRR of 0.82 on NASDAQ, nearly doubling the performance of traditional regression and reinforcement learning baselines.

Conclusion and Future Directions

The SSPT framework demonstrates that domain-specific pre-training is vital for financial time series. While effective, future work could explore multi-task optimization to resolve potential conflicts between pre-training objectives and incorporate external data sources like sentiment analysis or macroeconomic indicators to further refine predictions.

Summary updated

BibTeX
@inproceedings{wang2025pre,
  author = {Mengyu Wang and Tiejun Ma and Shay B. Cohen},
  title = {{Pre-training Time Series Models with Stock Data Customization}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2025},
}
Figure