Transformer Encoder and Multi-features Time2Vec for Financial Prediction

Nguyen Kim Hai Bui, Nguyen Duy Chien, Péter Kovács, Gergő Bognár
4/18/2025
cs.LGcs.CE

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

Financial prediction is a complex and challenging task of time series analysis and signal processing, expected to model both short-term fluctuations and long-term temporal dependencies. Transformers have remarkable success mostly in natural language processing using attention mechanism, which also influenced the time series community. The ability to capture both short and long-range dependencies helps to understand the financial market and to recognize price patterns, leading to successful applications of Transformers in stock prediction. Although, the previous research predominantly focuses on individual features and singular predictions, that limits the model's ability to understand broader market trends. In reality, within sectors such as finance and technology, companies belonging to the same industry often exhibit correlated stock price movements. In this paper, we develop a novel neural network architecture by integrating Time2Vec with the Encoder of the Transformer model. Based on the study of different markets, we propose a novel correlation feature selection method. Through a comprehensive fine-tuning of multiple hyperparameters, we conduct a comparative analysis of our results against benchmark models. We conclude that our method outperforms other state-of-the-art encoding methods such as positional encoding, and we also conclude that selecting correlation features enhance the accuracy of predicting multiple stock prices.

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. 3 weaker matches are hidden by default — 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{bui2025transformer,
  title  = {Transformer Encoder and Multi-features Time2Vec for Financial Prediction},
  author = {Nguyen Kim Hai Bui and Nguyen Duy Chien and Péter Kovács and Gergő Bognár},
  year   = {2025},
  eprint = {2504.13801},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.13801v2}
}

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

Discussion