HMN 2025: How Transformer AI models outperform neural networks in stock market prediction

stock market
Credit: Burak The Weekender from Pexels

Like other sectors of society, artificial intelligence is fundamentally changing how investors, traders and companies make decisions in financial markets. AI models have the ability to analyze massive amounts of data while reading company filings or news headlines almost instantaneously. This is allowing for faster, more automated trading, which is making it difficult for human traders—not utilizing AI—to find an edge in the markets.

One of the more interesting characteristics of AI is that the technology is advancing at near lightning speed. AI models that were “cutting-edge” just a year or so ago may be elementary when compared to current advancements. Past research has found neural networks, a computational machine learning model system, are among the best AI models for predicting the stock market. But is there a new AI system that can be more effective?

Zhiguang Wang is South Dakota State University’s DuBois Professor of Business Finance and Investments in the Ness School of Management and Economics. This fall, Wang published a study, titled Machine learning for stock return prediction: Transformers or simple neural networks,” which investigated if a newer AI architecture—transformers—could better predict stock market returns when analyzing economic data between 1957 and 2021. Wang’s study was published in Finance Research Letters.

Wang’s research found that transformers significantly outperform neural networks at one-month, three-month and one-year intervals when predicting stock market returns.

“These results suggest that transformer architectures better encode fundamental information,” Wang explained.

Transformers, which underlie large language models such as ChatGPT, are an improved type of neural network that can process large data sets, including text. What makes transformer models particularly powerful is their ability to understand the context and relationships between words in a sentence. This allows them to extract deep, fundamental structure in the data and uncover low-frequency patterns that simpler neural networks would not be able to identify.

In terms of stock market predictions, transformer models can pick up on long-term patterns and seasonality, allowing it to accurately forecast stock returns and improve upon previous AI-driven models.

“The transformer-based model can incorporate such macroeconomic variables as inflation, volatility indexes in credit and equity, and economic policy uncertainty,” Wang said.

“Given the similarity in input features and the omnipresence of seasonality and autocorrelation in financial time series, the model can also be applied to other developed and emerging equity markets, and even to corporate bond markets.”

More information:
Zhiguang Wang, Machine learning for stock return prediction: Transformers or simple neural networks, Finance Research Letters (2025). DOI: 10.1016/j.frl.2025.108783


The content is provided for information purposes only.