Gradient-Aligned Dual Encoder Framework for Stock Prediction Combining Self-Supervised Contrastive Learning and Regression
摘要
The stock market presents a compelling avenue for financial investment, offering substantial opportunities for wealth generation. However, accurate stock market prediction remains a significant challenge due to the noisy, non-stationary, and highly complex nature of financial time series data. In recent years, the application of artificial intelligence, particularly deep learning, which has gained considerable traction in this domain. Compared to traditional statistical models, deep learning methods are better equipped to process large-scale financial datasets and to uncover intricate market patterns. In this work, we propose a deep learning framework that jointly optimizes supervised and self-supervised objective, aiming to enhance the model’s ability to learn meaningful representations from stock data. To mitigate the issue of negative transfer—where the auxiliary self-supervised task may hinder the main supervised task, we introduce a gradient-based constraint mechanism that selectively filters conflicting gradient updates, ensuring that contrastive learning contributes positively to the model’s overall performance. We conduct extensive experiments on the NIFTY50 dataset, focusing on three representative stocks: ADANIPORTS, ASIANPAINT, and AXISBANK. The empirical results demonstrate that our method achieves state-of-the-art predictive accuracy, with low RMSE values (0.01492, 0.01463, 0.01754) and MAE values (0.01018, 0.01025, 0.01196), highlighting the robustness and effectiveness of the proposed framework in real-world stock market forecasting.