StockMixer: A Simple Yet Strong MLP-Based Architecture for Stock Price Forecasting

Jinyong Fan, Yanyan ShenAAAI 2024 · DOI

Introduction

Predicting stock prices is a formidable challenge due to the noisy, chaotic, and limited nature of financial data. Effective forecasting requires capturing three primary types of correlations: indicator correlations (intra-day feature interactions), temporal correlations (trends over time), and stock correlations (inter-company movements). While complex models like Transformers and Graph Neural Networks (GNNs) are often applied, they frequently struggle with overfitting on sparse financial datasets. StockMixer addresses these issues with a lightweight, MLP-based architecture that prioritizes simplicity and efficiency.

Methodology

StockMixer replaces heavy attention mechanisms with a three-stage "mixing" pipeline designed to handle multi-scale temporal patches and market-level correlations.

The StockMixer architecture, detailing the Stock Mixing and Indicator & Time Mixing components.

Indicator Mixing

This stage utilizes a standard MLP to exchange information between various financial features, such as volume and price, for each individual stock.

Multi-Scale Time Mixing

Unlike standard MLP-Mixers, StockMixer incorporates temporal order. It employs an upper triangular mask to enforce causality, ensuring information flows only from the past to the future. Data is processed at multiple scales through patching to capture both short-term volatility and long-term trends.

Market-Aware Stock Mixing

To avoid the noise of direct $N \times N$ stock-to-stock modeling, StockMixer uses a bottleneck approach. It compresses global stock information into $m$ "market characteristics" before projecting this state back to individual stocks, effectively acting as a self-learnable hypergraph.

The model is trained using a hybrid loss function combining Mean Squared Error (MSE) with a pairwise ranking loss to improve relative stock performance prediction.

Experimental Setup

The model was evaluated on three major US market benchmarks:

  • NASDAQ: 1,026 stocks (2013–2017)
  • NYSE: 1,737 stocks (2013–2017)
  • S&P 500: 474 stocks (2016–2022)

These datasets include sector and industry relations, providing a rigorous baseline against graph-based methods.

Results and Discussion

StockMixer consistently outperformed state-of-the-art models like STHAN-SR and ESTIMATE. It achieved a 7.6% gain in Information Coefficient (IC) and a 10.8% improvement in Rank IC. Furthermore, the Sharpe Ratio (SR) improved by 10.9%, indicating superior risk-adjusted returns.

Impact of different activation functions on IC and RIC performance. HardSwish and ReLU show superior results for this temporal task.

A key finding was the impact of activation functions. While GeLU is standard in many modern models, ReLU and HardSwish proved more effective for this specific financial forecasting task. The simplicity of the MLP architecture acts as a regularizer, preventing the model from overfitting to noise in low-data regimes.

Conclusion

StockMixer demonstrates that simple MLP-based architectures can outperform complex Transformers in finance by leveraging appropriate inductive biases like causality and market bottlenecks. Future work will focus on automated hyperparameter tuning for lookback windows and market dimensions across diverse global exchanges.

Summary updated

BibTeX
@inproceedings{fan2024stockmixer,
  author = {Jinyong Fan and Yanyan Shen},
  title = {{StockMixer: A Simple Yet Strong MLP-Based Architecture for Stock Price Forecasting}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i8.28681},
}
Figure